IFTAB(5) | Linux Programmer's Manual | IFTAB(5) |
iftab - static information about the network interfaces
The file /etc/iftab contains descriptive information about the various network interfaces. iftab is only used by the program ifrename(8) to assign a consistent network interface name to each network interface.
/etc/iftab defines a set of mappings. Each mapping contains an interface name and a set of selectors. The selectors allow ifrename to identify each network interface on the system. If a network interface matches all descriptors of a mapping, ifrename attempt to change the name of the interface to the interface name given by the mapping.
Each mapping is described on a separate line, it starts with an interface name, and contains a set of descriptors, separated by space or tabs.
The relationship between descriptors of a mapping is a logical and. A mapping matches a network interface only is all the descriptors match. If a network interface doesn't support a specific descriptor, it won't match any mappings using this descriptor.
If you want to use alternate descriptors for an interface name (logical or), specify two different mappings with the same interface name (one on each line). Ifrename always uses the last matching mapping in iftab.
The first part of each mapping is an interface name. If a network interface matches all descriptors of a mapping, ifrename attempt to change the name of the interface to the interface name given by the mapping.
The interface name of a mapping is either a plain interface name (such as eth2 or wlan1) or a interface name pattern containing a single wildcard (such as eth* or wlan*). In case of wildcard, the kernel replace the '*' with the lowest available integer making this interface name unique. Note that wildcard is only supported for kernel 2.6.1 and 2.4.30 and later.
It is discouraged to try to map interfaces to default interfaces
names such as eth0, wlan0 or ppp0. The kernel use those
as the default name for any new interface, therefore most likely an
interface will already use this name and prevent ifrename to use it. Even if
you use takeover, the interface may already be up in some cases. Not using
those name will allow you to immediately spot unconfigured or new
interfaces.
Good names are either totally unique and meaningfull, such as mydsl or
privatehub, or use larger integer, such as eth5 or
wlan5. The second type is usually easier to integrate in various
network utilities.
Each descriptor is composed of a descriptor name and descriptor value. Descriptors specify a static attribute of a network interface, the goal is to uniquely identify each piece of hardware.
Most users will only use the mac selector despite its potential problems, other selectors are for more specialised setup. Most selectors accept a '*' in the selector value for wilcard matching, and most selectors are case insensitive.
Sysfs attributes for a specific interface are located on most systems in the directory named after that interface at /sys/class/net/. Most sysfs attribute are files, and their values can be read using cat(1) or more(1). It is also possible to match attributes in subdirectories.
Some sysfs attributes are symlinks, pointing to another directory in sysfs. If the attribute filename is a symlink the sysfs attribute resolves to the name of the directory pointed by the symlink using readlink(1). The location is a directory in the sysfs tree is also important. If the attribute filename ends with /.., the sysfs attribute resolves to the real name of the parent directory using pwd(1).
The sysfs filesystem is only supported with 2.6.X kernel and need to be mounted (usually in /sys). sysfs selectors are not as efficient as other selectors, therefore they should be avoided for maximum performance.
These are common sysfs attributes and their corresponding ifrename descriptors.
# This is a comment
eth2 mac 08:00:09:DE:82:0E
eth3 driver wavelan interrupt 15 baseaddress 0x390
eth4 driver pcnet32 businfo 0000:02:05.0
air* mac 00:07:0E:* arp 1
myvpn SYSFS{address} 00:10:83:* SYSFS{type} 1
bcm* SYSFS{device} 0000:03:00.0 SYSFS{device/driver} bcm43xx
bcm* SYSFS{..} 0000:03:00.0 SYSFS{../driver} bcm43xx
Jean Tourrilhes - jt@hpl.hp.com
/etc/iftab
26 February 2007 | wireless-tools |