C++ CSS HTML Java JavaScript MySQL Oracle PERL PHP SQL Unix VBScript XHTML XML Сети
Interface Configuration Files
 

8.2. Interface Configuration Files

them. These files are usually named ifcfg-<name>, where <name> refers to the name of the device that the configuration file controls.

8.2.1. Ethernet Interfaces

One of the most common interface files is 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-eth<X> files (where <X>

Below is a sample ifcfg-eth0 file for a system using a fixed IP address:

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
NETWORK=10.0.1.0
NETMASK=255.255.255.0
IPADDR=10.0.1.27
USERCTL=no

The values required in an interface configuration file can change based on other values. For example, the ifcfg-eth0 file for an interface using DHCP looks quite a bit different, because IP information is provided by the DHCP server:

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

The Network Administration Tool (redhat-config-network) is an easy way to make changes to the various network interface configuration files (see the chapter titled Network Configuration in the Red Hat Linux Customization Guide for detailed instructions on using this tool).

However, it is also possible to edit the configuration files for a given network interface by hand.

Below is a listing of the configurable parameters in an Ethernet interface configuration file:

8.2.2. Dialup Interfaces

If connecting to the Internet via a dialup connection, a configuration file is necessary for the interface.

PPP interface files are named using the following format ifcfg-ppp<X> (where <X> is a unique number corresponding to a specific interface).

The PPP interface configuration file is created automatically when wvdial, the Network Administration Tool or Kppp is used to create a dialup account. The Red Hat Linux Getting Started Guide

The following is a typical ifcfg-ppp0 file:

Serial Line Internet Protocol (SLIP)ifcfg-sl0.

Other options, not already discussed, that may be used in these files include:

8.2.3. Other Interfaces

Other common interface configuration files that use these options include the following:

8.2.4. Alias and Clone Files

Two lesser-used types of interface configuration files found in the /etc/sysconfig/network-scripts/ directory are alias and clone files.

Alias interface configuration files take names in the format of ifcfg-<if-name>:<alias-value>, and they allow an alias to point to an interface. For example, an ifcfg-eth0:0 file could be configured to specify DEVICE=eth0:0ifcfg-eth0. At that point, the eth0 device is bound to a dynamic IP address, but it can always be referred to on that system via the fixed 10.0.0.2 IP address.

A clone interface configuration file should follow this naming convention, ifcfg-<if-name>-<clone-name> have a standard DHCP Ethernet interface called eth0, it may look similar to this:

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp

Since USERCTL is set to noifcfg-eth0 to ifcfg-eth0-user and add the following line:

USERCTL=yes

When a user brings up the eth0 interface with the ifup eth0-user command, 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.

The easiest way to create alias and clone interface configuration files is to use the graphical Network Administration Tool. For more on using this tool, see the chapter called Network Configuration in the Red Hat Linux Customization Guide.

Главная