1. 1
CENTOS SERVER CLI CONFIGURATION
To set the IP address and gateway on terminal, we have to use “nmcli” command
“nmcli” is a command-line tool which is used for controlling NetworkManager. Command can also be
used to display network device status, create, edit, activate/deactivate, and delete network connections.
Typical Uses
- Scripts: Instead of manually managing the network connections it utilize NetworkManager via nmcli.
- Servers, headless machine and terminals: Can be used to control NetworkManager with no GUI and
control system-wide connections.
We configure the IP address is shown below.
nmcli connection edit ens160
set ipv4.addresses 10.30.30.5/24
set ipv4.gateway 10.30.30.1
set ipv4.dns 10.30.30.5
save
quit
We will configure the Virtual network adapter in our Physical machine to connect to the server.
2. 2
After we configured our physical computer’s VM Network Adapter, we are able to connect
To change the DNS resolver of our CentOS server, we will go to the path “/etc/resolv.conf”
vi /etc/resolv.conf
(Use “i” to insert data, and “:wq” to save and quit. If you want to save without quit, use :q!)
Now to see with “cat” command
cat /etc/resolv.conf
3. 3
To configure the hostname, you have to use the the “/etc/hosts” path. We configure our
hostname as “apacheserver.kaantest.com”
Now we are able to ping our host name. If we want other clients to resolve our host name
also, we have to install named package and configure CentOS server as BIND DNS server. Then
enter the DNS server IP to our client.
Set hostname commands are shown below. (root@kaantest)
We can also do that via Settings on GUI
1/24/2022
X
Kaan Aslandag
Signed by: www.kaan1.com