By default, Debian uses the ifupdown package to configure network interfaces. Ifupdown uses a context-free configuration mechanism wherein a configuration (/etc/network/interfaces) is processed once for each requested interfaces. Interfaces may be requested for configuration manually--via the ifup interface and ifdown interface commands--or automatically--via the ifup -a and ifdown -a commands. In the automatic case, the configuration is first checked for any interfaces marked as automatic and then processes the configuration once for each. A key point is that the interface name requested, either automatically or manually, is the kernel name of the interface, not the logical name described in the documentation.
For a requested kernel interface, ifupdown processes the configuration in two phases. First, it finds a mapping from the requested interface name to a logical interface name. The logical interface name is used only to select a specific set of parameters from the configuration. A mapping is defined in a mapping stanza like this:
mapping eth0 eth1 script /path/to/map-script map argument1 argument2 logical-name0 map argument3 argument4 logical-name1 ...
The mapping keyword begins the stanza and is followed by a blank-separated list of kernel interface names on the same line. An interface on this line tells ifupdown to use this mapping stanza to find a logical name for it.
The script keyword tells ifupdown to run the specified program to begin the mapping process. The current kernel interface name is passed in $1 and the text following each map keyword in the stanza is passed in standard input.
The program specified by script returns a line in standard output consisting of the logical name to use for this interface. The logical name found in the mapping phase is used to select an iface stanza that looks like this:iface logical-name0 inet static address 192.168.1.1 netmask 255.255.255.0This stanza tells ifupdown that whatever interface was mapped to 'logical-name0' should be configured with the static internet address and netmask found in the address and netmask lines that follow. Other configuration options are possible, including other protocols, routes, automatic configuration via DHCP or BOOTP, etc. See ifup(8), ifdown(8), and interfaces(5) for these details. 11/16/2001 Greg Wiley