Interface configuration files control the software interfaces for individual network devices.
As the system boots, it uses these files to determine what interfaces to bring up and how to configure them.
These files are usually named ifcfg-<name>, where <name> refers to the name of the device that the configuration file controls.
Because each device has its own configuration file, an administrator can control how each interface functions individually.
Configure Network Interface Settings
You can configure network interface by editing configuration files stored in
Lets configure the first network interface eth0. Edit the interface configuration file.
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Append/Modify as follows:
For a system using a Static IP Address
eth0" BOOTPROTO="none" ONBOOT="yes" IPADDR="
For a system using a DHCP
DEVICE="eth0" BOOTPROTO="dhcp" ONBOOT="yes"
|DEVICE=<name>||Name of the physical device|
|BOOTPROTO=<none|bootp|dhco>||Protocol to use.
none – No boot-time protocol should be used
bootp – The BOOTP protocol should be used
dhcp – The DHCP protocol should be used
|ONBOOT=<yes|no>||Should the device be activated at boot-time|
|GATEWAY=<address>||Gateway IP address|
Edit the main network configuration file:
# vi /etc/sysconfig/network
Append the following settings:
# /etc/init.d/network restart
If the modifying of the file
/etc/sysconfig/network is not needed, then you can restart only the interface:
# ifdown eth0 && ifup eth0
Configure DNS settings
Edit ‘resolv.conf’ file:
# vi /etc/resolv.conf
Append your DNS servers:
nameserver 192.168.1.2 nameserver 192.168.1.3
If you don’t have private DNS servers, you can pick them from a list of Free Fast Public DNS Servers
Test Your Settings
Check if the Gateway is reachable:
# ping 192.168.1.1
Check if the Public IPs are reachable:
# ping 22.214.171.124
Check if DNS works:
# nslookup google.com