IFUPDOWN-MULTI-INTERFACES(5)

✨ IFUPDOWN-MULTI-INTERFACES ✨

ok so bestie, this is the ifupdown-multi-interfaces(5) page β€” section 5, File formats, the whole vibe πŸ’… it's the ifupdown-multi extension for the interfaces(5) file format and honestly? she ate.


πŸŽ€ NAME πŸŽ€

ifupdown-multi-interfaces β€” the ifupdown-multi extension for the interfaces(5) file format. no cap, that's literally it 🫢


🌸 DESCRIPTION 🌸

So. /etc/network/interfaces is the file that holds all your network interface info for the ifup(8) and ifdown(8) commands. And THIS page is about the ifupdown-multi extensions to the standard interfaces(5) file format. ✨

The way that ifupdown-multi extends ifupdown is by integrating Linux's policy routing based support for multiple default gateways on independent network connections. πŸ”₯ Like, multiple uplinks, multiple gateways, all coexisting, all in one file.

And the best part? These extensions can replace a typical shell script based approach that directly invokes a sequence of ip(8) commands for configuring multiple uplinks. Instead of a whole script girl, you get declarative syntax right there in the /etc/network/interfaces file. iconic behavior tbh πŸ‘‘

So how does she work? ifupdown-multi records the policy information used to bring up each network interface when ifup(8) is run, and then removes the same policy routing information when ifdown(8) is run. clean up after yourself, periodt 🧚


πŸ’… IFACE OPTIONS πŸ’…

Okay so real talk first β€” the standard address and netmask options must be set for each interface. and the gateway option must NOT be set. like, do not. πŸ™ˆ

Then, the new multi_gateway and multi_table options must be set to configure policy routing with ifupdown-multi. Those two are the main characters, you cannot skip them. ⭐

And additionally, the multi_gateway_weight and multi_preferred_prefixes options can be specified in order to control optional policy routing features. optional but cute, yk?

  • multi_gateway address β€” the default gateway for this interface. (Required.) like genuinely required bestie.
  • multi_table id β€” the table identifier. This must be a numeric value, and every single interface must have a unique value β€” no sharing, that's not the vibe. Recommended range: 1-1000. (Required.)
  • multi_gateway_weight weight β€” sets this gateway's weight. This value is directly passed as the weight parameter to the nexthop part of an ip-route(8) route object. Higher values indicate higher relative bandwidth or quality. (Optional. πŸ’«)
  • multi_preferred_prefixes prefix [prefix]... β€” prefer this connection for the given prefixes. This option configures the routing policy database using the ip-rule(8) command to use this connection for the specified prefixes. (Optional. πŸ¦‹)

🌈 EXAMPLES 🌈

Example 1: the basic girlie πŸ“

The following example shows a basic configuration with two network interfaces. eth0 is on the 198.51.100.0/24 network, while eth1 is on the 203.0.113.0/24 network. Each interface stanza has a multi_gateway option, as opposed to the usual gateway option. Each interface stanza also needs a multi_table option, whose parameter is a small, unique non-negative integer. (This number will be used internally to uniquely identify an interface-specific routing table. πŸ”‘)

auto eth0
iface eth0 inet static
    address 198.51.100.123
    netmask 255.255.255.0
    multi_table 1
    multi_gateway 198.51.100.1

auto eth1
iface eth1 inet static
    address 203.0.113.234
    netmask 255.255.255.0
    multi_table 2
    multi_gateway 203.0.113.1

Example 2: the deluxe edition ✨

The following example shows a more complicated setup using optional ifupdown-multi parameters. It is similar to the first example, but the network connection on eth0 is preferred for most connections, and several network prefixes prefer to use one or the other network connection. it's giving ✨strategic✨

auto eth0
iface eth0 inet static
    address 198.51.100.123
    netmask 255.255.255.0
    multi_table 1
    multi_gateway 198.51.100.1
    multi_gateway_weight 5
    multi_preferred_prefixes 10.0.0.0/8

auto eth1
iface eth1 inet static
    address 203.0.113.234
    netmask 255.255.255.0
    multi_table 2
    multi_gateway 203.0.113.1
    multi_gateway_weight 1
    multi_preferred_prefixes 172.16.0.0/12 192.168.0.0/16

πŸŽ€ FILES πŸŽ€

  • /etc/network/interfaces β€” system-wide network interface configuration. See interfaces(5). πŸ‘€
  • /run/network/ifupdown-multi.* β€” state information used by ifupdown-multi. that's where she keeps the receipts πŸ’Ύ

🫢 SEE ALSO 🫢

interfaces(5), ifup(8), ip(8), ip-route(8), ip-rule(8).

Linux Advanced Routing & Traffic Control HOWTO -- Chapter 4: Rules. http://www.tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.rpdb.html


ok bye bestie, that's the whole page πŸ’– this was ifupdown-multi version 0.1.0, dated 17 September 2013 β€” yes she's a 2013 girlie and she's still serving πŸŒΈπŸ’…πŸ¦‹ iykyk