INTERFACES(5)

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, by setting IP addresses, and other related information.

The file can contain comments; all lines starting with `#' are ignored. A line may be extended across multiple lines by making the last character a \ in the usual manner.

The file consists of zero or more "iface", "mapping" and "auto" stanzas, each of which defines one network interface. Here are some sample stanzas:
 auto lo eth0
 iface lo inet loopback
 mapping eth0
     script /usr/local/sbin/map-scheme
     map HOME eth0-home
     map WORK eth0-work
 iface eth0-home inet static
     address 192.168.1.1
     netmask 255.255.255.0
 iface eth0-work inet dhcp Stanzas beginning with the word "auto" are used to identify interfaces that should be brought up automatically on system boot. Interface names should follow the word "auto" on the same line. Multiple "auto" stanzas may be used, or they may be combined into a single line.

Stanzas beginning with the word "mapping" are used to automatically translate a physical interface name into a logical interface specified by an "iface" stanza. The first line of a mapping stanza begins with the word "mapping" followed by the names of each physical interface this mapping should apply to. Shell globs (* and ? wildcards) may be used when specifying interfaces. Each mapping must specify a script, which will be run when the mapping is applied. In addition, a mapping may specify any number of "map" parameters that will be passed to the script.

Stanzas defining interfaces start with the word "iface". The next word is the name of the interface, as used by the ifconfig(8) or route(8) commands (ie, things like "lo", "eth0", or "ppp0", and "eth1:0").

The interface name is followed by address family the interface uses -- generally 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 method used to configure the interface. In the example above, this is "static", which means that eth0 is a staticly allocated IPv4 address.

Further options may follow the "iface" header line on additional lines in the stanza. These are usually indented for clarity (as in the example) but are not required to be.

IFACE OPTIONS
There are currently three standard options available for all interfaces, regardless of address family or method. These are:

up command
    Run command after bringing the interface up. This option can be given multiple times for a single interface. If so, the commands will be executed in order. If one of the commands fails, none of the others will be executed, but the interface will remain configured. (You can ensure a command never fails by suffixing "|| true".)

pre-up command
    Run command before bringing the interface up. This option can be given multiple times for a single interface. If so, the commands will be executed in order. If one of the commands fails, none of the others will be executed, and the interface will not be configured. (You can ensure a command never fails by suffixing "|| true".)

down command
    Run command before taking the interface down. This option can be given multiple times for a single interface. If so, the commands will be executed in order. If one of the commands fails, none of the others will be executed, and the interface will not be deconfigured. (You can ensure a command never fails by suffixing "|| true".)

post-down command
    Run command after taking the interface down. This option can be given multiple times for a single interface. If so, the commands will be executed in order. If one of the commands fails, none of the others will be executed, but the interface will remain deconfigured. (You can ensure a command never fails by suffixing "|| true".)

Most methods require additional information, such as address, and netmask; details about the available methods and the information they require follows.

INET ADDRESS FAMILY
This section documents the methods available in the inet address family.

  The loopback Method
This method may be used to define the IPv4 loopback interface.

Options

    (No options)

  The static Method
This method may be used to define ethernet interfaces with statically allocated IPv4 addresses.

Options

    address address
        Address (dotted quad) required

    netmask netmask
        Netmask (dotted quad) required

    broadcast broadcast_address
        Broadcast address (dotted quad)

    network network_address
        Network address (dotted quad) required for 2.0.x kernels

    gateway address
        Default gateway (dotted quad)

    pointopoint address
        Address of other end point (dotted quad). Note the spelling of "point-to".

  The dhcp Method
This method may be used to obtain an address via DHCP with any of the tools: dhclient, pump (2.2.x kernels only), or dhcpcd. If you have a complicated DHCP setup you should note that some of these clients use their own configuration files, rather than obtaining their configuration via *ifup*.

Options

    hostname hostname
        Hostname to be requested (pump, dhcpcd)

    leasehours leastime
        Preferred lease time in hours (pump)

    leasetime leasetime
        Preferred lease time in seconds (dhcpcd)

    vendor vendor
        Vendor class identifier (dhcpcd)

    client client_id
        Client identifier (dhcpcd)

  The bootp Method
This method may be used to obtain an address via bootp.

Options

    bootfile file
        Tell the server to use file as the bootfile.

    server address
        Use the IP address address to communicate with the server.

    hwaddr addr
        Use addr as the hardware address instead of whatever it really is.

  The ppp Method
This method uses pon/poff to configure a PPP interface. See those commands for details.

Options

    provider name
        Use name as the provider (from /etc/ppp/peers).

  The wvdial Method
This method uses wvdial to configure a PPP interface. See that command for ore details.

Options

    provider name
        Use name as the provider (from /etc/ppp/peers).

IPX ADDRESS FAMILY
This section documents the methods available in the ipx address family.

  The static Method
This method may be used to setup an IPX interface.

Options

    frame

    netnum

  The dynamic Method
This method may be used to setup an IPX interface dynamically.

Options

    frame

INET6 ADDRESS FAMILY
This section documents the methods available in the inet6 address family.

  The loopback Method
This method may be used to define the IPv6 loopback interface.

Options

    (No options)

  The static Method
This method may be used to define interfaces with statically assigned IPv6 addresses.

Options

    address address
        Address (colon delimited) required

    netmask mask
        Netmask (number of bits, eg 64) required

    gateway address
        Default gateway (colon delimited)

  The v4tunnel Method
This method may be used to setup an IPv6-over-IPv4 tunnel. It requires the ip command from the iproute package.

Options

    address address
        Address (colon delimited) required

    netmask mask
        Netmask (number of bits, eg 64) required

    endpoint address
        Address of other tunnel endpoint (IPv4 dotted quad) required

    gateway address
        Default gateway (colon delimited)

AUTHOR
The ifupdown suite was written by Anthony Towns <aj@azure.humbug.org.au>. This manpage was contributed by Joey Hess <joey@kitenet.net>

SEE ALSO
ifup(8), ifdown(8)