Configuration for network interfaces is located under /etc/sysconfig/network-scripts (just like Red Hat). /etc/sysconfig is a symlink pointing to /mnt/ramdisk/sysconfig.
The files in /etc/sysconfig/network-scripts are named just like the interfaces themselves, that is in order to configure eth0, you have to edit /etc/sysconfig/network-scripts/eth0 (and not ifcfg-eth0 like in other distributions).
Some of the options are universal for almost any device type, some are specific for example for wireless or ppp devices. In general, all the parameters are optional, but if something critical is missing (like username for authenticated PPP links), it won’t work.
The following options can be used for any type of device:
IP=ip1/mask1[,ip2/mask2[,ip3/mask3]]... ROUTE=ip route command1[,ip route command2[ip route command3]]...
If IP is missing or set to dhcp, dhcp will be used. If set to none, the interface will stay down.
The ip/mask are the same you would give to “ip addr add …..”. Unlike many other distributions, you can use more than one ip/mask without using device name aliases.
Example:
IP=1.2.3.4/24, 5.6.7.8/29
The ROUTE is the same parameter you would give to “ip route add ….”. You can use as many commands as “ip route” can take. Some examples are:
If you have a default gateway 1.2.3.4:
ROUTE=default via 1.2.3.4
If you route 10.0.0.0/24 through 1.2.3.4 with a source IP of 5.6.7.8:
ROUTE=10.0.0.0/24 via 1.2.3.4 src 5.6.7.8
MODULE=kernel_module_name IRQ=number IO=0xnumber
MODULE, IRQ and IO are only needed if the interface isn’t autodetected, for example if it’s an ISA card. kernel_module_name is without the “.o” extension, e.g. “ne”. IRQ and IO are the same as modprobe takes.
If you want to name your interfaces differently than they are autonamed by the kernel, you can use HWADDR to rename them. It is highly recommended to use HWADDR on ALL of the interfaces that are related to this change, otherwise you may end up with something odd.
# inside /etc/sysconfig/network-scripts/eth0 HWADDR=01:23:45:67:89:AB
(this will try to find a network interface with the above MAC and rename it to eth0).
If you want to change the MAC the card will use to communicate with the network, use this parameter
MACADDR=00:11:22:33:44:55
If you want to change the card’s duplex or speed settings, use these, it will turn autonegotiation off. Otherwise driver’s default behaviour is used (usually autonegotiation). Valid values for DUPLEX are full and half, and for SPEED 10, 100 and 1000.
VLANs don’t have any special parameters. VLAN ID is assigned based on the configuration file name, e.g. /etc/sysconfig/network-scripts/eth0.5 will create a subdevice on eth0 with VLAN ID 5.
ESSID=essid IWCHANNEL=iwchannel IWMODE=iwmode IWKEY=iwkey
These are only usable with wireless cards. Use the same syntax as when using iwconfig.
This determines the mode of the ppp connection. If IP is defined, it will use pptp to connect to that address. If DEV is defined, PPPoE will be used on this interface.
User (login) for the ppp authentication. Define password in /etc/ppp/chap-secrets
Microsoft Point-to-Point Encryption (and Compression). Possible values are yes and no.
Use the DNS provided by the other side (server) and put it into /etc/resolv.conf. yes or no.
This interface is the default route (to the internet). If this is how you connect to the internet, set to yes, otherwise no.
OpenVPN is supported in the “older” mode (non-TLS) as a tunnel interface.
The only supported value is “openvpn”.
In this context, IP means the IP or hostname of the remote OpenVPN server (just like in PPP). If you want to run as a server, don’t set this parameter.
IP of the local tunnel side.
IP of the remote tunnel side.
File with the secret.
Optional route for the tunnel. At the moment, you have to use a different syntax for this than on other interfaces. The syntax is the same as –route parameter for openvpn. Netmask is ignored, /24 is assumed (this will be fixed in the future).
If using a bridge, it is recommended to configure the participating interfaces to
IP=0.0.0.0/0
Bridge supports universal options. Moreover it has
The BRIDGE parameter lists the real interfaces that are part of the bridge. For example:
BRIDGE=eth0,eth1
Allows to to enable Spanning Tree Protocol (defaults to off)
STP=1