How to configure Network Settings in CentOS command mode?

1. Log in to the CentOS via console.

2. Change directory to /etc/sysconfig/

3. Add the gateway information to the file network. You can use a text editor such as nano or vi to edit the file.

i.e. vi /etc/sysconfig/network

The network file should look similar to this

NETWORKING=yes
HOSTNAME=myserver.cybercon.net
GATEWAY=184.175.92.241

Please note that your gateway and hostname should be different from the above example. Once you finish adding the GATEWAY line, save the file and exit.

4. Next, you need to modify the Ehternet interface 0 file located at /etc/sysconfig/network-scripts/ifcfg-eth0

i.e.

vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT="yes"
NETMASK=255.255.255.0
IPADDR=192.168.0.2

Again, your IPADDR and NETMASK settings may be different from the above example. Once you finish editing the file, save it and exit.

5. The next file you need to modify is resolv.conf located in /etc/resolv.conf

Add the following 2 lines to the file.

nameserver 216.15.129.205
nameserver 216.15.129.206

Please check the welcome email you received from Cybercon for the name server IP address. Yours may not be 216.15.129.205 or 216.15.129.206. Once that is done, save the file and exit.

6. After you modify all the above files, you need to restart the network. You can do so by issuing the following command.

service network restart