Konfigurasi network di Linux CentOS terdapat dalam file-file berikut:
The main purpose of this file is to resolve hostnames that cannot be resolved any other way. It can also be used to resolve hostnames on small networks with no DNS server. Regardless of the type of network the computer is on, this file should contain a line specifying the IP address of the loopback device (127.0.0.1) as localhost.localdomain. For more information, refer to the hosts man page.
This file specifies the IP addresses of DNS servers and the search domain. Unless configured to do otherwise, the network initialization scripts populate this file. For more information about this file, refer to the resolv.conf man page.
This file specifies routing and host information for all network interfaces. The /etc/sysconfig/network file is used to specify information about the desired network configuration. The following values may be used:
NETWORKING=, where is one of the following boolean values: and .
HOSTNAME=, where should be the Fully Qualified Domain Name (FQDN), such as hostname.expample.com, but can be whatever hostname is necessary.
GATEWAY=, where is the IP address of the network’s gateway.
GATEWAYDEV=, where is the gateway device, such as eth0. Configure this option if you have multiple interfaces on the same subnet, and require one of those interfaces to be the preferred route to the default gateway.
NISDOMAIN=, where is the NIS domain name.
NOZEROCONF=, where setting to true disables the zeroconf route. By default, the zeroconf route (169.254.0.0) is enabled when the system boots. For more information about zeroconf, refer to http://www.zeroconf.org/.
For each network interface, there is a corresponding interface configuration script. Each of these files provide information specific to a particular network interface. 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-, where refers to the name of the device that the configuration file controls.
Contoh Konfigurasi /etc/sysconfig/network-scripts/ifcfg-eth0
Setelah konfigurasi selesai dan disimpan, jangan lupa restart service network-nya.