Building Professional Web Hosting Solution
<< Linux Basic Setup and Configuration Course
>> Linux VM/VPS Fundamental Configuration Section
- Configuring Local or Public DNS PTR Records
- Debian Based Hostname Plus Network Configuration
- Red Hat Based Hostname Plus Network Configuration
- Red Hat Based Systems Network Manager Text UI

Red Hat Based Systems Network Manager Text UI will show you step by step how to set your Public VPS Network Configuration using menu driven tool called Text User Interface. However, I still recommend using nano editor since it will give you more control over the settings. Besides, I have included how to change your CentOS Machine IP settings using command line Interface. Bottom line you got 3 different ways to edit or change Network Settings: nano editor, Cli, and TUI.
Objectives:
1. Configuring CentOS6 Network Settings
2. Configuring CentOS7 Network Settings
Prerequisites:
A. Basic Domain, Sub-domain, or DNS Knowledge
B. Login to your DigitalOcean or Vultr Account
Table of Contents
Configuring CentOS6 Network Settings
On CentOS6, I can use system-config-network to set static IP addresses, DNS Settings, and Hostname.
Public VPS users: I recommend using nano editor to edit or configure your Network settings as shown in Red Hat Based Hostname Plus Network Configuration, however, if you still not ready for nano editor yet, you can use the TUI as shown below.
Run the following steps (1 to 3)
1. Install Network Configuration Tools
yum install system-config-network-tui net-tools
2. Run System Network Configuration
system-config-network
[frame][/frame]
3. Restart Network Services
Note: the following command might disconnect you from Putty window. You need to reopen a new Putty Window session using the New IP address.
service network restart
(Optional) Add Extra IP addresses
Create the Interface file
nano /etc/sysconfig/network-scripts/ifcfg-eth0:0
Note: mark the colon and Zero at the end, it commands the network manager to create a Virtual Interface which would be part of the physical interface.
Copy and Paste the following inside the ifcfg-eth0:0 file, of course replace the IP address using your IP address.
# eth0:0 configuration DEVICE=eth0:0 BOOTPROTO=none # Bring the Interface on Boot ONBOOT=yes # eth0:0 IP Settings IPADDR=192.168.1.27 NETMASK=255.255.255.0
Save: Ctrl-X, Hit Y Key, and Enter.
Add another IP Address
nano /etc/sysconfig/network-scripts/ifcfg-eth0:1
# eth0:1 configuration DEVICE=eth0:1 BOOTPROTO=none # Bring the Interface on Boot ONBOOT=yes # eth0:1 IP Settings IPADDR=192.168.1.28 NETMASK=255.255.255.0
Save: Ctrl-X, Hit Y Key, and Enter.
Restart Network Services
service network restart
Configuring CentOS7 Network Settings
On CentOS7, I can use nmtui command to set static IP addresses, DNS Settings, and Hostname.
Public VPS users: I recommend using nano editor to edit or configure your Network settings as shown in Red Hat Based Hostname Plus Network Configuration, however, if you still not ready for nano editor yet, you can use the TUI as shown below.
Run the following steps (1 to 5)
1. Install Network Configuration Tools
yum install NetworkManager-tui net-tools -y
2. Unmask and start the Service
systemctl unmask NetworkManager systemctl start NetworkManager
3. Turn On the Service at Startup
systemctl enable NetworkManager.service
4. Run System Network Configuration
nmtui
[frame][/frame]
5. Restart Network Services
Note: the following command might disconnect you from Putty window. You need to reopen a new Putty Window session using the New IP address.
systemctl restart network
Using Network Manager Cli to Set Static IP Address
First, List Active Interfaces
nmcli dev status
Note: Based on your Infrastructure, each interface in here might be called different name. I’ve realized that when using VirtualBox or VMware Station, CentOS7 names its interface different than usual, but, that’s not the case when using a Public VPS.
For Example: Under VirtualBox
DEVICE TYPE STATE CONNECTION
enp0s3 ethernet connected enp0s3
lo loopback unmanaged --
root@centos7:~#
Under VMware Station:
DEVICE TYPE STATE CONNECTION
eno16777736 ethernet connected eno16777736
lo loopback unmanaged --
root@centos7:~#
Setting Static IP Address on VirtualBox: VM Interface name: enp0s3
Run the following steps (1 to 7)
Of course, you need to replace the IP using your IP address.
1. Set Static IPv4 Address with Prefix /24
nmcli con modify enp0s3 ipv4.addresses 192.168.1.26/24
2. Set Default Gateway
nmcli con modify enp0s3 ipv4.gateway 192.168.1.1
3. Set DNS Settings
nmcli con modify enp0s3 ipv4.dns "192.168.1.1 8.8.8.8"
Add another DNS Server using Plus Sign
nmcli con modify enp0s3 +ipv4.dns 8.8.4.4
Remove one of the DNS Servers using Mines Sign
nmcli con modify enp0s3 -ipv4.dns 8.8.8.8
4. Set manual for static “auto” for DHCP
nmcli con modify enp0s3 ipv4.method manual
5. Restart the interface to Reload new settings
Note: the following command might disconnect you from Putty window. You need to reopen a new Putty Window session using the New IP address.
systemctl restart network
6. Show Interface Settings
nmcli dev show enp0s3
GENERAL.DEVICE: enp0s3 GENERAL.TYPE: ethernet GENERAL.HWADDR: 08:00:27:F8:08:63 GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: enp0s3 GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/1 WIRED-PROPERTIES.CARRIER: on IP4.ADDRESS[1]: 192.168.1.26/24 IP4.GATEWAY: 192.168.1.1 IP4.DNS[1]: 192.168.1.1 IP4.DNS[2]: 8.8.4.4 IP6.ADDRESS[1]: fe80::a00:27ff:fef8:863/64 IP6.GATEWAY:
7. Show Interface Status
ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:f8:08:63 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.26/24 brd 192.168.1.255 scope global enp0s3
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fef8:863/64 scope link tentative dadfailed
valid_lft forever preferred_lft forever
Setting Static IP Address on VM Ware Station: VM Interface name: eno16777736
Run the following steps (1 to 7)
1. Set Static IPv4 Address with Prefix /24
nmcli con modify eno16777736 ipv4.addresses 192.168.1.26/24
2. Set Default Gateway
nmcli con modify eno16777736 ipv4.gateway 192.168.1.1
3. Set DNS Settings
nmcli con modify eno16777736 ipv4.dns "192.168.1.1 8.8.8.8"
Add another DNS Server using Plus Sign
nmcli con modify eno16777736 +ipv4.dns 8.8.4.4
Remove one of the DNS Servers using Mines Sign
nmcli con modify eno16777736 -ipv4.dns 8.8.8.8
4. Set manual for static “auto” for DHCP
nmcli con modify eno16777736 ipv4.method manual
5. Restart the interface to Reload new settings
Note: the following command might disconnect you from Putty window. You need to reopen a new Putty Window session using the New IP address.
systemctl restart network
6. Show Interface Settings
nmcli dev show eno16777736
GENERAL.DEVICE: eno16777736 GENERAL.TYPE: ethernet GENERAL.HWADDR: 00:0C:29:EA:42:B4 GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: eno16777736 GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2 WIRED-PROPERTIES.CARRIER: on IP4.ADDRESS[1]: 192.168.1.26/24 IP4.GATEWAY: 192.168.1.1 IP4.DNS[1]: 192.168.1.1 IP4.DNS[2]: 8.8.4.4 IP6.ADDRESS[1]: fe80::20c:29ff:feea:42b4/64 IP6.GATEWAY:
7. Show Interface Status
ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:ea:42:b4 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.26/24 brd 192.168.1.255 scope global eno16777736
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:feea:42b4/64 scope link tentative dadfailed
valid_lft forever preferred_lft forever
Subject Related
By Wikipedia CentOS | About CentOS | CentOS HowTos | HowtoForge CentOS7 Server
Building Professional Web Hosting Solution
<< Linux Basic Setup and Configuration Course
>> Linux VM/VPS Fundamental Configuration Section
- Configuring Local or Public DNS PTR Records
- Debian Based Hostname Plus Network Configuration
- Red Hat Based Hostname Plus Network Configuration
- Red Hat Based Systems Network Manager Text UI
LEAVE A COMMENT