ifcfg
Section: Networking (5)
Updated: 1.0.0
Page Index
NAME
ifcfg - Configuration file for network interfaces
DESCRIPTION
The ifup and ifdown scripts use configuration files
of the format ifcfg-[InterfaceName], for example
ifcfg-eth0. These configuration files are searched
for in the following places:
/etc/sysconfig/network-scripts
FORMAT
The file is a series of variable settings in the form:
-
NAME="value"
It is allowable to surround value with double quotes or single
quotes. It is required if the settings require spaces (no
settings in the network configuration use spaces).
PARAMETERS
The following are required settings:
- DEVICE
-
The network device name.
- BOOTPROTO
-
The protocol or system used to obtain an IP.
Valid settings are bootp, dhcp,
- ONBOOT
-
Determines whether the device is started at
system bootup. Valid settings are yes or no.
The following are required settings for static IP:
- IPADDR
-
Manually set the IP address.
- NETMASK
-
The mask that is applied to packets to determine
if it's destined for your network. It is a series of bits that
provide a "mask" for a logical AND with the addresses in the
packets it receives.
The following are optional settings:
- NETWORK
-
Set the network address. This setting is optional
because the network scripts can calculate it as long as the IP
address and Netmask are known (uses a logical AND with the
netmask.) Example: a 24 bit netmask is 255.255.255.0. If the
IP address is 192.168.1.20, the network is 192.168.1.0.
- BROADCAST
-
Set the broadcast address. This setting is
optional because the network scripts can calculate it as long as
the IP address and Netmask are known (uses a logic OR using the
inverse of the netmask with the network address.) Example: a
24 bit netmask is 255.255.255.0, so the inverse is 0.0.0.255. If
the IP address is 192.168.1.20, the broadcast is 192.168.1.255.
- MACADDR
-
Manually set the MAC Address (hardware address)
of the interface. Note that not all network drivers allow this.
- DHCP_HOSTNAME
-
Manually set a hostname that is required for DHCP to obtain the
IP address successfully. Frequently used for cablemodems.
- NEEDHOSTNAME
-
Controls whether or not the hostname is changed to what is
supplied by the DHCP server. Valid settings are yes
or no, default is no.
- PEERDNS
-
Controls whether or not /etc/resolv.conf is rewritten with
the information from a DHCP server. Valid settings are yes
or no, default is yes.
- PEERYP
-
Controls whether or not /etc/yp.conf is rewritten with the
information from a DHCP server. Valid settings are yes
or no, default is no.
- PEERNTPD
-
Controls whether or not /etc/ntpd.conf is rewritten with the
information from a DHCP server. Valid settings are yes
or no, default is no.
- DHCP_TIMEOUT
-
Sets the number of seconds to wait for an answer from a DHCP server,
default is 60 seconds.
- MTU
-
Sets the Maximum Transmission Unit, default is 1500.
- DYNCONFIG
-
- NOZEROCONF
-
Controls whether or not the zeroconf networking configuration will
be used. Valid settings are yes or no, default is
yes.
- ISALIAS
-
Determines if an IP address configuration is an alias or a real
interface. Valid settings are yes or no, default
is no.
- NETWORKING_IPV6
-
Determines if an interface is an IPv6 interface. Valid settings are
yes or no, default is no.
- IPX
-
Determines if an interface is an IPX interface. Valid settings are
yes or no, default is no.
The following are options specifically for wireless interfaces. The
options are not checked. They passed directly to the iwconfig
utility. Refer to the manual page for iwconfig to see exactly what
they do.
- WIRELESS_MODE
-
Sets the mode of the wireless device.
- WIRELESS_ESSID
-
Sets the ESSID of the wireless device.
- WIRELESS_NWID
-
Sets the NWID of the wireless device.
- WIRELESS_FREQ
-
Sets the frequency that the wireless device will use.
- WIRELESS_CHANNEL
-
Sets the channel at the wireless device will use.
- WIRELESS_SENS
-
Sets the sensitivity of the wireless device.
- WIRELESS_RATE
-
Sets the bit rate of the wireless device.
- WIRELESS_ENC_KEY
-
Sets the encryption mode to use.
- WIRELESS_RTS
-
Sets the rts threshhold.
- WIRELESS_FRAG
-
Sets the maximum fragment size.
- WIRELESS_IWCONFIG
-
Options that you can specify to be passed to iwconfig directly.
If it contains one or more spaces, the value must be in quotes.
- WIRELESS_IWSPY
-
Options that you can specify to be passed to iwspy directly.
If it contains one or more spaces, the value must be in quotes.
- WIRELESS_IWPRIV
-
Options that you can specify to be passed to iwpriv directly.
If it contains one or more spaces, the value must be in quotes.
EXAMPLES
ifcfg-eth0 configured for DHCP:
-
DEVICE=eth0
BOOTPROTO=dhcp
NETMASK=255.255.255.0
ONBOOT=yes
ifcfg-usb0 configurd for static IP:
-
DEVICE=usb0
BOOTPROTO=static
BROADCAST=192.168.129.255
IPADDR=192.168.129.1
NETMASK=255.255.255.0
NETWORK=192.168.129.0
ONBOOT=no
ifcfg-eth0:2 (the third virtual device) configured for static IP:
-
DEVICE="eth0:2"
IPADDR=192.168.3.89
NETMASK=255.255.255.0
ONBOOT=yes
FILES
/etc/sysconfig/network-scripts/ifcfg-*
/etc/sysconfig/network
/etc/resolv.conf
/sbin/ifup
/sbin/ifdown
SEE ALSO
ifup(8) ifdown(8)