IFUPDOWN-MULTI-INTERFACES(5) | File formats | IFUPDOWN-MULTI-INTERFACES(5) |
ifupdown-multi-interfaces - ifupdown-multi extension for the interfaces(5) file format
/etc/network/interfaces contains network interface information for the ifup(8) and ifdown(8) commands. This manpage describes the ifupdown-multi extensions to the the standard interfaces(5) file format.
The ifupdown-multi extensions to ifupdown integrate Linux's policy routing based support for multiple default gateways on independent network connections. These extensions can replace a typical shell script based approach that directly invokes a sequence of ip(8) commands for configuring multiple uplinks with declarative syntax in the /etc/network/interfaces file.
ifupdown-multi records the policy information used to bring up each network interface when ifup(8) is run and removes the same policy routing information when ifdown(8) is run.
The standard address and netmask options must be set for each interface. The gateway option must NOT be set.
The new multi_gateway and multi_table options must be set to configure policy routing with ifupdown-multi.
Additionally, the multi_gateway_weight and multi_preferred_prefixes options can be specified in order to control optional policy routing features.
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
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.
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
interfaces(5), ifup(8), ip(8), ip-route(8), ip-rule(8).
17 September 2013 | 0.1.0 |