Files related to networking functionality
In Linux, the TCP/IP network is configured through several text files you may have to edit to make networking work. It’s very important to know the configurations files related to TCP/IP networking, so that you can edit and configure the files if necessary. Remember that our server doesn’t have an Xwindow interface to configure files via graphical interface. Even if you use a GUI in your daily activities it is important to know how to configure network in text mode. The following sections describe the basic TCP/IP configuration files.
The “/etc/HOSTNAME” file
This file stores your system’s host name—your system’s fully qualified domain name (FQDN), such as deep.openna.com.
Following is a sample 7etc/H0STNAME” file: deep.openna.com
The “/etc/sysconfig/network-scripts/ifcfg-ethN” files
File configurations for each network device you may have or want to add on your system are located in the 7etc/sysconfig/network-scripts/” directory with Red Hat Linux 6.1 or 6.2 and are named ifcfg-ethO for the first interface and ifcfg-eth1 for the second, etc.
Following is a sample 7etc/sysconfig/network-scripts/ifcfg-ethO” file:
DEVICE=ethO IPADDR=208.164.186.1 NETMASK=255.255.255.0 NETWORK=208.164.186.0 BROADCAST=208.164.186.255 ONBOOT=yes BOOTPROTO=none USERCTL=no
If you want to modify your network address manually, or add a new network on a new interface, edit this file (ifcfg-ethN), or create a new one and make the appropriate changes.
DEVICE=deWcename, where devicename is the name of the physical network device.
IPADDR=/paddr, where ipaddr\s the IP address.
NETMASK=nefmasfr, where netmask is the netmask IP value.
NETWORK=nefworir, where network is the network IP address.
BROADCAST=broadcast, where broadcast is the broadcast IP address.
ONBOOT=answer, where answer is yes or no (Does the interface will be active or inactive at boot time).
BOOTPROTO=proto, where proto is one of the following:
• none - No boot-time protocol should be used.
• bootp - The bootp (now pump) protocol should be used.
• dhcp - The dhcp protocol should be used.
USERCTL=answer, where answer is one of the following:
• yes (Non-root users are allowed to control this device).
• no (Only the super-user root is allowed to control this device).
The “/etc/resolv.conf’ file
This file is another text file, used by the resolver—a library that determines the IP address for a host name.