ifcfg-name
, where name refers to the name of the device that the configuration file controls.
/etc/sysconfig/network-scripts/ifcfg-eth0
, which controls the first Ethernet network interface card or NIC in the system. In a system with multiple NICs, there are multiple ifcfg-ethX
files (where X is a unique number corresponding to a specific interface). Because each device has its own configuration file, an administrator can control how each interface functions individually.
ifcfg-eth0
file for a system using a fixed IP
address:
DEVICE=eth0 BOOTPROTO=none ONBOOT=yes NETMASK=255.255.255.0 IPADDR=10.0.1.27 USERCTL=no
ifcfg-eth0
file for an interface using DHCP
looks different because IP
information is provided by the DHCP
server:
DEVICE=eth0 BOOTPROTO=dhcp ONBOOT=yes
BONDING_OPTS
=parameters /etc/sysconfig/network-scripts/ifcfg-bondN
. These parameters are identical to those used for bonding devices in /sys/class/net/bonding_device/bonding
, and the module parameters for the bonding driver as described in bonding
Module Directives.
BONDING_OPTS
directive in ifcfg-name
. Do not specify options for the bonding device in /etc/modprobe.d/bonding.conf
, or in the deprecated /etc/modprobe.conf
file.
BOOTPROTO
=protocol none
— No boot-time protocol should be used.
bootp
— The BOOTP
protocol should be used.
dhcp
— The DHCP
protocol should be used.
BROADCAST
=addressipcalc
.
DEVICE
=name PPP
devices where it is the logical name).
DHCP_HOSTNAME
=nameDHCP
server. Use this option only if the DHCP
server requires the client to specify a host name before receiving an IP
address.
DHCPV6C
=answeryes
— Use DHCP
to obtain an IPv6
address for this interface.
no
— Do not use DHCP
to obtain an IPv6
address for this interface. This is the default value.
IPv6
link-local address will still be assigned by default. The link-local address is based on the MAC address of the interface as per RFC 4862.
DHCPV6C_OPTIONS
=answer-P
— Enable IPv6
prefix delegation.
-S
— Use DHCP
to obtain stateless configuration only, not addresses, for this interface.
-N
— Restore normal operation after using the -T
or -P
options.
-T
— Use DHCP
to obtain a temporary IPv6
address for this interface.
-D
— Override the default when selecting the type of DHCP Unique Identifier (DUID) to use.
DHCPv6
client (dhclient) creates a DHCP Unique Identifier (DUID) based on the link-layer address (DUID-LL) if it is running in stateless mode (with the -S
option, to not request an address), or it creates an identifier based on the link-layer address plus a timestamp (DUID-LLT) if it is running in stateful mode (without -S
, requesting an address). The -D
option overrides this default, with a value of either LL
or LLT
.
DNS{1,2}
=address/etc/resolv.conf
if the PEERDNS
directive is set to yes
.
ETHTOOL_OPTS
=options ethtool
. For example, if you wanted to force 100Mb, full duplex:
ETHTOOL_OPTS="autoneg off speed 100 duplex full"
ETHTOOL_OPTS
to set the interface speed and duplex settings. Custom initscripts run outside of the network init script lead to unpredictable results during a post-boot network service restart.
Set “autoneg off” before changing speed or duplex settings
autoneg off
option. This option needs to be stated first, as the option entries are order-dependent.
GATEWAY
=addressIP
address of the network router or gateway device (if any). Note that if this option is present in an interface configuration file it will take precedence over the GATEWAY
option in the /etc/sysconfig/network
file. It is therefore recommended that you chose between setting this option for global effect in /etc/sysconfig/network
or per-interface.
HOTPLUG
=answeryes
— This device should be activated when it is hot-plugged (this is the default option).
no
— This device should not be activated when it is hot-plugged.
HOTPLUG=no
option can be used to prevent a channel bonding interface from being activated when a bonding kernel module is loaded.
HWADDR
=MAC-address MACADDR
. See the Fedora Networking Guide for more information on device naming.
IPADDR
=address IPv4
address.
IPV6ADDR
=address IPv6
address on an interface.
/64
is assumed. Note that this setting depends on IPV6INIT
being enabled.
IPV6ADDR_SECONDARIES
=address IPv6
addresses.
/64
is assumed. Note that this setting depends on IPV6INIT
being enabled.
IPV6INIT
=answer yes
— Initialize this interface for IPv6
addressing.
no
— Do not initialize this interface for IPv6
addressing. This is the default value.
IPv6
static and DHCP
assignment of IPv6
addresses. It does not affect IPv6 Stateless Address Autoconfiguration (SLAAC) as per RFC 4862.
IPv6
.
IPV6_AUTOCONF
=answer yes
— Enable IPv6
autoconf configuration for this interface.
no
— Disable IPv6
autoconf configuration for this interface.
IPv6
address will be requested using Neighbor Discovery (ND) from a router running the radvd
daemon.
IPV6_AUTOCONF
depends on IPV6FORWARDING
as follows:
IPV6FORWARDING
=yes
, then IPV6_AUTOCONF
will default to no
.
IPV6FORWARDING
=no
, then IPV6_AUTOCONF
will default to yes
and IPV6_ROUTER
has no effect.
IPV6_MTU
=value IPV6_PRIVACY
=rfc3041 IPV6INIT
option being enabled.
EUI-64
method. The address is appended to a prefix but as the address is normally derived from the MAC address it is globally unique even when the prefix changes. In the case of a link-local address the prefix is fe80::/64
as per RFC 2462 IPv6 Stateless Address Autoconfiguration.
LINKDELAY
=time MACADDR
=MAC-address HWADDR
directive.
MASTER
=bond-interface SLAVE
directive.
NETMASK
=mask NETWORK
=address ipcalc
.
NM_CONTROLLED
=answer yes
— NetworkManager is permitted to configure this device. This is the default behavior and can be omitted.
no
— NetworkManager is not permitted to configure this device.
Note
NM_CONTROLLED
directive is dependent on the NM_BOND_VLAN_ENABLED
directive in /etc/sysconfig/network
. If and only if that directive is present and is one of yes
, y
, or true
, will NetworkManager detect and manage bonding and VLAN interfaces.
NOZEROCONF
=answeryes
— Do not set a route for dynamic IPv6
link-local addresses.
no
— Allow setting a route for dynamic IPv6
link-local addresses.
ONBOOT
=answeryes
— This device should be activated at boot-time.
no
— This device should not be activated at boot-time.
PEERDNS
=answeryes
— Modify /etc/resolv.conf
if the DNS
directive is set. If using DHCP
, then yes
is the default.
no
— Do not modify /etc/resolv.conf
.
SLAVE
=answeryes
— This device is controlled by the channel bonding interface specified in the MASTER
directive.
no
— This device is not controlled by the channel bonding interface specified in the MASTER
directive.
MASTER
directive.
SRCADDR
=address IP
address for outgoing packets.
USERCTL
=answer yes
— Non-root
users are allowed to control this device.
no
— Non-root
users are not allowed to control this device.
SUBCHANNELS=<read_device_bus_id>, <write_device_bus_id>, <data_device_bus_id>
PORTNAME=myname;
CTCPROT
=answer 0
— Compatibility mode, TCP/IP for Virtual Machines (used with non-Linux peers other than IBM S/390 and IBM System z operating systems). This is the default mode.
1
— Extended mode, used for Linux-to-Linux Peers.
3
— Compatibility mode for S/390 and IBM System z operating systems.
OPTION
='answer'OPTIONS='layer2=1 portno=0'
NETTYPE
=answerctc
— Channel-to-Channel communication. For point-to-point TCP/IP or TTY.
lcs
— LAN Channel Station (LCS).
qeth
— QETH (QDIO Ethernet). This is the default network interface. It is the preferred installation method for supporting real or virtual OSA cards and HiperSockets devices.
ip
command of the iproute package now supports assigning multiple address to the same interface it is no longer necessary to use this method of binding multiple addresses to the same interface.
Note
IP
aliases in ifcfg
files. For example, if ifcfg-eth0
and ifcfg-eth0:1
files are present, NetworkManager creates two connections, which will cause confusion.
IPv4
or IPv6
tab in NetworkManager to assign multiple IP
address to the same interface. For more information on using this tool, see the Fedora Networking Guide.
ifcfg-if-name:alias-value
naming scheme. Do not confuse alias ifcfg
file and interface names with VLAN ifcfg
file and interface names which take the form: ifcfg-if-name.vlan-id
and ethX.
vlan-id respectively.
ifcfg-eth0:0
file could be configured to specify DEVICE=eth0:0
and a static IP
address of 10.0.0.2
, serving as an alias of an Ethernet interface already configured to receive its IP
information via DHCP
in ifcfg-eth0
. Under this configuration, eth0
is bound to a dynamic IP
address, but the same physical network card can receive requests via the fixed, 10.0.0.2
IP
address.
Warning
DHCP
.
ifcfg-if-name-clone-name
. While an alias file allows multiple addresses for an existing interface, a clone file is used to specify additional options for an interface. For example, a standard DHCP
Ethernet interface called eth0
, may look similar to this:
DEVICE=eth0 ONBOOT=yes BOOTPROTO=dhcp
USERCTL
directive is no
if it is not specified, users cannot bring this interface up and down. To give users the ability to control the interface, create a clone by copying ifcfg-eth0
to ifcfg-eth0-user
and add the following line to ifcfg-eth0-user
:
USERCTL=yes
eth0
interface using the /sbin/ifup eth0-user
command because the configuration options from ifcfg-eth0
and ifcfg-eth0-user
are combined. While this is a very basic example, this method can be used with a variety of options and interfaces.
IP
address to the same interface. For new installations, users should select the Manual method on the IPv4
or IPv6
tab in NetworkManager to assign multiple IP
address to the same interface. For more information on using this tool, see the Fedora Networking Guide.
PPP
interface files are named using the following format:
ifcfg-pppX
PPP
interface configuration file is created automatically when wvdial
, or Kppp is used to create a dialup account. It is also possible to create and edit this file manually.
/etc/sysconfig/network-scripts/ifcfg-ppp0
file:
DEVICE=ppp0 NAME=test WVDIALSECT=test MODEMPORT=/dev/modem LINESPEED=115200 PAPNAME=test USERCTL=true ONBOOT=no PERSIST=no DEFROUTE=yes PEERDNS=yes DEMAND=no IDLETIMEOUT=600
SLIP
files have interface configuration file names such as ifcfg-sl0
.
DEFROUTE
=answer yes
— Set this interface as the default route.
no
— Do not set this interface as the default route.
DEMAND
=answeryes
— This interface allows pppd
to initiate a connection when someone attempts to use it.
no
— A connection must be manually established for this interface.
IDLETIMEOUT
=valueINITSTRING
=stringSLIP
interfaces.
LINESPEED
=value57600
, 38400
, 19200
, and 9600
.
MODEMPORT
=deviceMTU
=value576
results in fewer packets dropped and a slight improvement to the throughput for a connection.
NAME
=namePAPNAME
=namePERSIST
=answeryes
— This interface should be kept active at all times, even if deactivated after a modem hang up.
no
— This interface should not be kept active at all times.
REMIP
=addressIP
address of the remote system. This is usually left unspecified.
WVDIALSECT
=name /etc/wvdial.conf
. This file contains the phone number to be dialed and other important information for the interface.
ifcfg-lo
IP
address pointing back to the same system. Any data sent to the loopback device is immediately returned to the host's network layer.
Do not manually edit the ifcfg-lo script
/etc/sysconfig/network-scripts/ifcfg-lo
, should never be edited manually. Doing so can prevent the system from operating correctly.
ifcfg-irlan0
ifcfg-plip0
ifcfg-hsiN