TCP / IP For Dummies
Book image
Explore Book Buy On Amazon

Each Linux network interface has an ifcfg configuration file located in /etc/sysconfig/network-scripts. The device name is added to the end of the filename. So, for example, the configuration file for the first Ethernet interface is called ifcfg-eth0.

This file is created and updated by the Network Configuration program, so you don’t have to edit it directly (if you don’t want to).

Here’s a typical ifcfg file for an interface that has a static IP address:


Here’s an example for an interface that uses DHCP:


Here, the ifcfg file doesn’t have to specify the IP address information because the interface gets that information from a DHCP server.

The following paragraphs describe the settings that you’re most likely to see in this file:

  • DEVICE: The name of the device, such as eth0 or eth1.

  • USERCTL: Specifies YES or NO to indicate whether local users are allowed to start or stop the network.

  • ONBOOT: Specifies YES or NO to indicate whether the device should be enabled when Linux boots up.

  • BOOTPROTO: Specifies how the device gets its IP address. Possible values are NONE for static assignment, DHCP, or BOOTP.

  • BROADCAST: The broadcast address used to send packets to everyone on the subnet. For example:

  • NETWORK: The network address. For example:

  • NETMASK: The subnet mask. For example:

  • IPADDR: The IP address for the adapter.

About This Article

This article can be found in the category: