Configuring Network on CentOS/RHEL -- Basic Configuration
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.
Append/Modify as follows :
For a system using a Static IP Address
For a system using a DHCP
|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 :
Append the following settings :
Restart networking :
If the modifying of the file
Configure DNS settings
Edit 'resolv.conf' file :
Append your DNS servers :
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 :
Check if the Public IPs are reachable :
Check if DNS works :