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 ๐
autoobject โ 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.ifaceobject 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 ๐ซถsourcefilename โ includes the file filename as configuration data. shell wildcards can be used. seewordexp(3).source-directorydirectory โ includes the files in directory as configuration data.templateobject options... โ begins a new declaration for object, likeiface, 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:
addressaddress โ associates an IPv4 or IPv6 address in CIDR notation with the parent interface. if an IP address without a prefix length is given, a givennetmaskattribute is used if present. if neither a prefix length nor a netmask are given, a/24or/64prefix length is presumed for IPv4 / IPv6 as of compatibility reasons to classic ifupdown. so yeah, it just guesses, and we let it ๐ซถnetmasknetmask โ 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-pointaddress โ 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/32netmask. for compatibility with ifupdown and ifupdown2,pointopointis an alias for this parameter. (yes, the typo alias is real, it's legacy, we respect it ๐)gatewayaddress โ 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-typelink-type โ denotes the link-type of the interface. when set todummy, the interface is created as a virtual dummy interface. when set toveththe interface is created as virtual veth interface (pair). pick your fighter ๐veth-peer-namepeer-name โ denotes the name of the veth peer interface. if not set the kernel will name the veth peer interface asvethNwithNbeing an integer number. the kernel just picks for you, main character energy โจaliasalias โ sets the given alias on the interface.requiresinterfaces... โ 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 ๐inheritobject โ designates that the configured interface should inherit configuration data from object. normally object must be a template. passing down the genes ๐useexecutor โ designates that an executor should be used. see the EXECUTORS section for more information on executors.pre-downcommand โ runs command before taking the interface down.downcommand โ runs command when the interface is taken down.post-downcommand โ runs command after taking the interface down.pre-upcommand โ runs command before bringing the interface up.upcommand โ runs command when the interface is brought up.post-upcommand โ 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 thebatctlutility to be installed.bondโ the interface is a bonded interface. configuration of bonded interfaces requires thebondingpackage to be installed.bridgeโ the interface is an ethernet bridge. configuration of ethernet bridges requires thebridgepackage 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 thepppand probably thepppoepackages to be installed.tunnelโ the interface is a tunnel. configuration of tunnels requires thetunnelpackage to be installed on Alpine Linux.vrfโ the interface is a VRF. configuration of VRFs requires thevrfpackage to be installed.vrrpโ the interface has Virtual Router Redundancy Protocol configuration. configuration of VRRPs requires thevrrppackage 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 thewireless-toolspackage to be installed. thewpa_supplicantpackage 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 theauto_executor_selectionifupdown-ng.confoption is enabled,usestatements 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
- alpine 3.24: ifupdown-ng-doc 0.13.0-r0 ยท ISC
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms