interfaces(5)

โœจ interfaces(5) โ€” the interface config database, bestie โœจ

okay so this is the <pink>interfaces</pink> manual page, and honestly? it's kind of the main character of your network setup. it's <italic>interfaces</italic> from the <purple>File Formats Manual</purple>, and we're gonna go through the whole thing together, no skipping ๐Ÿ’…


๐ŸŒธ NAME ๐ŸŒธ

/etc/network/interfaces โ€” the interface configuration database. that's it, that's the vibe ๐ŸŽ€


๐Ÿ’– DESCRIPTION ๐Ÿ’–

so the /etc/network/interfaces file is literally where you tell the system how your network interfaces should be configured. it gets processed by ifquery(8), ifup(8) and ifdown(8) โ€” those are the besties that read it and then go introspect and change system state for you ๐Ÿซถ

and like, in most cases, syntax from legacy implementations is supported too?? but bestie, that syntax is not discussed in detail here, so don't come for me ๐Ÿ™ˆ


๐Ÿฆ‹ FILE SYNTAX ๐Ÿฆ‹

the interface configuration database is composed of a series of stanzas. hash symbols (#) designate comments, and the system just ignores those, no thoughts head empty โœจ

a stanza is a collection of triples, where a triple is a key and value combination that's related to an object. triples that are not associated with an object are considered to be part of the root of the configuration tree ๐ŸŒณ

all keywords are case-sensitive and are expected to be lower-case. lowercase or it doesn't count, periodt.

the following is a simple example of a stanza:

auto eth0
iface eth0
    address 203.0.113.2/24
    gateway 203.0.113.1

this stanza defines an interface named eth0 which is configured with an address of 203.0.113.2 and gateway of 203.0.113.1. iconic behavior honestly ๐Ÿ‘‘


๐ŸŽ€ SUPPORTED KEYWORDS FOR UNASSOCIATED TRIPLES ๐ŸŽ€

  • auto object โ€” designates that object should be automatically configured by the system when appropriate. the system justโ€ฆ handles it. queen shit ๐Ÿ’…
  • defaults โ€” designates default configuration settings that should be added to interface and template objects when instantiated.
  • iface object options... โ€” begins a new declaration for object. any child keyword associated with the declaration will be stored inside object. this is like, the opening of the group chat ๐Ÿซถ
  • source filename โ€” includes the file filename as configuration data. shell wildcards can be used. see wordexp(3).
  • source-directory directory โ€” includes the files in directory as configuration data.
  • template object options... โ€” begins a new declaration for object, like iface, except that object is defined as a template. it's giving blueprint energy ๐Ÿฆ‹

โญ SUPPORTED OPTIONS FOR INTERFACES AND TEMPLATES โญ

interface and template objects may take optional arguments which modify how they are instantiated. so like, little tweaks to the vibe check:

  • no-defaults โ€” disables processing of default settings when instantiating the object. no defaults for you, bestie ๐Ÿšซ

๐Ÿ’œ SUPPORTED KEYWORDS FOR OBJECT TRIPLES ๐Ÿ’œ

so here's the thing โ€” any keyword may be used inside an interface declaration block, but the system will only respond to certain keywords by default. here's the official roster, bestie:

  • address address โ€” associates an IPv4 or IPv6 address in CIDR notation with the parent interface. if an IP address without a prefix length is given, a given netmask attribute is used if present. if neither a prefix length nor a netmask are given, a /24 or /64 prefix length is presumed for IPv4 / IPv6 as of compatibility reasons to classic ifupdown. so yeah, it just guesses, and we let it ๐Ÿซถ
  • netmask netmask โ€” associates a fallback netmask with the parent interface for addresses which do not have a CIDR length set. this option is for backwards compatibility and should not be used in new deployments. ngl bestie, this one's a little vintage ๐Ÿ‘ต
  • point-to-point address โ€” sets the given IPv4 address as the peer address on the interface. this setting only takes effect for the IPv4 address family and only makes sense in combination with a /32 netmask. for compatibility with ifupdown and ifupdown2, pointopoint is an alias for this parameter. (yes, the typo alias is real, it's legacy, we respect it ๐Ÿ™)
  • gateway address โ€” associates an IPv4 or IPv6 address with the parent interface for use as a default route (gateway). this usually is given once for IPv4 and once for IPv6 (in a Dual-Stack setup). dual-stack girlies rise ๐ŸŒˆ
  • link-type link-type โ€” denotes the link-type of the interface. when set to dummy, the interface is created as a virtual dummy interface. when set to veth the interface is created as virtual veth interface (pair). pick your fighter ๐Ÿ’€
  • veth-peer-name peer-name โ€” denotes the name of the veth peer interface. if not set the kernel will name the veth peer interface as vethN with N being an integer number. the kernel just picks for you, main character energy โœจ
  • alias alias โ€” sets the given alias on the interface.
  • requires interfaces... โ€” designates one or more required interfaces that must be brought up before configuration of the parent interface. interfaces associated with the parent are taken down at the same time as the parent. it's a package deal, bestie ๐ŸŽ
  • inherit object โ€” designates that the configured interface should inherit configuration data from object. normally object must be a template. passing down the genes ๐Ÿ’–
  • use executor โ€” designates that an executor should be used. see the EXECUTORS section for more information on executors.
  • pre-down command โ€” runs command before taking the interface down.
  • down command โ€” runs command when the interface is taken down.
  • post-down command โ€” runs command after taking the interface down.
  • pre-up command โ€” runs command before bringing the interface up.
  • up command โ€” runs command when the interface is brought up.
  • post-up command โ€” runs command after bringing the interface up.

additional packages such as bonding, bridge, tunnel, vrf, vrrp and vxlan add additional keywords to this vocabulary. so there's more where that came from ๐Ÿ‘€


๐Ÿ”ฅ EXECUTORS ๐Ÿ”ฅ

the use keyword designates that an executor should be used. this system is extendable by additional packages, but the most common executors are:

  • batman โ€” the interface is a B.A.T.M.A.N. adv. mesh interface. configuration of B.A.T.M.A.N. adv. interfaces requires the batctl utility to be installed.
  • bond โ€” the interface is a bonded interface. configuration of bonded interfaces requires the bonding package to be installed.
  • bridge โ€” the interface is an ethernet bridge. configuration of ethernet bridges requires the bridge package to be installed.
  • dhcp โ€” use a DHCP client to learn the IPv4 address of an interface.
  • forward โ€” configures forwarding settings on the interface.
  • ipv6 โ€” configures IPv6 parameters.
  • loopback โ€” designates the interface as a loopback device.
  • ppp โ€” designates the interface as a PPP device. configuration of PPP interfaces requires the ppp and probably the pppoe packages to be installed.
  • tunnel โ€” the interface is a tunnel. configuration of tunnels requires the tunnel package to be installed on Alpine Linux.
  • vrf โ€” the interface is a VRF. configuration of VRFs requires the vrf package to be installed.
  • vrrp โ€” the interface has Virtual Router Redundancy Protocol configuration. configuration of VRRPs requires the vrrp package to be installed.
  • vxlan โ€” the interface is a Virtual Extensible LAN (VXLAN) tunnel endpoint.
  • wifi โ€” the interface is a Wi-Fi (IEEE 802.11) client interface. configuration of the WiFi client interface requires the wireless-tools package to be installed. the wpa_supplicant package must also be installed to connect to hotspots using WPA-based security.
  • wireguard โ€” the interface is a Wireguard VPN tunnel endpoint.

check interfaces-<executor>(5) for further information about a given executor and available configuration parameters. iykyk ๐Ÿงš

if the auto_executor_selection ifupdown-ng.conf option is enabled, use statements will automatically be added for executors when their configuration statements are present in the interfaces file. so it literally does the work for you, slay โœจ

๐ŸŒˆ EXAMPLES ๐ŸŒˆ

okay so first one: configure a bridge interface br0 with bond0 attached to it, which is a failover between eth0 and eth1. this requires the bonding and bridge packages to be installed:

auto br0
iface br0
    use bridge
    requires bond0
    address 203.0.113.2/24
    gateway 203.0.113.1

iface bond0
    use bond
    requires eth0 eth1
    bond-mode 802.3ad
    bond-xmit-hash-policy layer2+3

and second: configure a network interface to use DHCP to learn its IPv4 address. simple, clean, ate ๐Ÿ’…

auto eth0
iface eth0
    use dhcp

๐Ÿซถ SEE ALSO ๐Ÿซถ

ifstate(5) ifupdown-ng.conf(5) ifup(8) ifdown(8) ifquery(8) ifctrstat(8) interfaces-batman(5) interfaces-bond(5) interfaces-bridge(5) interfaces-forward(5) interfaces-mpls(5) interfaces-ppp(5) interfaces-tunnel(5) interfaces-vrf(5) interfaces-vrrp(5) interfaces-vxlan(5) interfaces-wifi(5) interfaces-wireguard(5)

go read them, bestie, they're all connected ๐Ÿฆ‹


๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

  • Ariadne Conill <ariadne@dereferenced.org>
  • Maximilian Wilhelm <max@sdn.clinic>

and that's the page, bestie!! ๐Ÿ’– this lil masterpiece is dated 2026-05-10 and it's the interfaces(5) page from the File Formats Manual โ€” go forth and configure your interfaces, you gorgeous nerd, you're literally gonna slay ๐ŸŒธโœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from