INTERFACESSection: File formats (5)
Updated: 5 April 2004
Return to Main Contents
NAME/etc/network/interfaces - network interface configuration for ifup and ifdown
DESCRIPTION/etc/network/interfaces contains network interface configuration information for the ifup(8) and ifdown(8) commands. This is where you configure how your system is connected to the network. Lines starting with `#' are ignored. A line may be extended across multiple lines by making the last character a backslash. The file consists of zero or more "iface", "mapping" and "auto" stanzas. Here is an example.
Stanzas beginning with the word "auto" are used to identify the physical interfaces to be brought up when ifup is run with the -a option. (This option is used by the system boot scripts.) Physical interface names should follow the word "auto" on the same line. There can be multiple "auto" stanzas. ifup brings the named interfaces up in the order listed. Stanzas beginning with the word "mapping" are used to determine how a logical interface name is chosen for a physical interface that is to be brought up. The first line of a mapping stanza consists of the word "mapping" followed by a pattern in shell glob syntax. Each mapping stanza must contain a script definition. The named script is run with the physical interface name as its argument and with the contents of all following "map" lines (without the leading "map") in the stanza provided to it on its standard input. The script must print a string on its standard output before exiting. See /usr/share/doc/ifupdown/examples for examples of what the script must print. Mapping a name consists of searching the remaining mapping patterns and running the script corresponding to the first match; the script outputs the name to which the original is mapped. ifup is normally given a physical interface name as its first non-option argument. ifup also uses this name as the initial logical name for the interface unless it is accompanied by a suffix of the form =LIFACE, in which case ifup chooses LIFACE as the initial logical name for the interface. It then maps this name, possibly more than once according to successive mapping specifications, until no further mappings are possible. If the resulting name is the name of some defined logical interface then ifup attempts to bring up the physical interface as that logical interface. Otherwise ifup exits with an error. Stanzas defining logical interfaces start with a line consisting of the word "iface" followed by the name of the logical interface. In simple configurations without mapping stanzas this name should simply be the name of the physical interface to which it is to be applied. (The default mapping script is, in effect, the echo command.) The interface name is followed by the name of the address family that the interface uses. This will be "inet" for TCP/IP networking, but there is also some support for IPX networking ("ipx"), and IPv6 networking ("inet6"). Following that is the name of the method used to configure the interface. Additional options can be given on subsequent lines in the stanza. Which options are available depends on the family and method, as described below. Additional options can be made available by other Debian packages. For example, the wireless-tools package makes available a number of options prefixed with "wireless-" which can be used to configure the interface using iwconfig(8). (See wireless(7) for details.) Options are usually indented for clarity (as in the example above) but are not required to be.
IFACE OPTIONSThe following "command" options are available for every family and method. Each of these options can be given multiple times in a single stanza, in which case the commands are executed in the order in which they appear in the stanza. If one of the commands fails, none of the others will be executed but the interface will still be configured. (You can ensure a command never fails by suffixing "|| true".)
INET ADDRESS FAMILYThis section documents the methods available in the inet address family.
The loopback MethodThis method may be used to define the IPv4 loopback interface.
The static MethodThis method may be used to define ethernet interfaces with statically allocated IPv4 addresses.
The manual MethodThis method may be used to define interfaces for which no configuration is done by default. Such interfaces can be configured manually by means of up and down commands or /etc/network/if-*.d scripts.
The dhcp MethodThis method may be used to obtain an address via DHCP with any of the tools: dhclient, pump, udhcpc, dhcpcd. (They have been listed in their order of precedence.) If you have a complicated DHCP setup you should note that some of these clients use their own configuration files and do not obtain their configuration information via ifup.
The bootp MethodThis method may be used to obtain an address via bootp.
The ppp MethodThis method uses pon/poff to configure a PPP interface. See those commands for details.
The wvdial MethodThis method uses wvdial to configure a PPP interface. See that command for ore details.
IPX ADDRESS FAMILYThis section documents the methods available in the ipx address family.
The static MethodThis method may be used to setup an IPX interface. It requires the ipx_interface command.
The dynamic MethodThis method may be used to setup an IPX interface dynamically.
INET6 ADDRESS FAMILYThis section documents the methods available in the inet6 address family.
The loopback MethodThis method may be used to define the IPv6 loopback interface.
The static MethodThis method may be used to define interfaces with statically assigned IPv6 addresses.
The v4tunnel MethodThis method may be used to setup an IPv6-over-IPv4 tunnel. It requires the ip command from the iproute package.
KNOWN BUGS/LIMITATIONSThe ifup and ifdown programs work with so-called "physical" interface names. These names are assigned to hardware by the kernel. Unfortunately it can happen that the kernel assigns different physical interface names to the same hardware at different times; for example, what was called "eth0" last time you booted is now called "eth1" and vice versa. This creates a problem if you want to configure the interfaces appropriately. A way to deal with this problem is to use mapping scripts that choose logical interface names according to the properties of the interface hardware. See the get-mac-address.sh script in the examples directory for an example of such a mapping script. See also Debian bug #101728. It is not currently possible to divide up /etc/network/interfaces into multiple files. A feature that would make this possible is some sort of inclusion directive. No such feature exists in the current ifupdown program. For more information see Debian bug #159884.
AUTHORThe ifupdown suite was written by Anthony Towns <firstname.lastname@example.org>. This manpage was contributed by Joey Hess <email@example.com>.
SEE ALSOifup(8), iwconfig(8), run-parts(8). For advice on configuring this package read the Network Configuration chapter of the Debian Reference manual, available at http://www.debian.org/doc/manuals/reference/ch-gateway.en.html or in the debian-reference-en package. Examples of how to set up interfaces can be found in /usr/share/doc/ifupdown/examples/network-interfaces.
This document was created by man2html, using the manual pages.
Time: 01:18:33 GMT, July 08, 2020