---
name: "ifupdown-multi-interfaces"
section: "5"
platform: "linux"
package: "ifupdown-multi"
version: "1.0.0"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ifupdown-multi-interfaces"
---

# ifupdown-multi-interfaces(5)

ifupdown-multi extension for the interfaces(5) file format

## NAME

ifupdown-multi-interfaces - ifupdown-multi extension for the [interfaces(5)](/interfaces/5.md) file format

## DESCRIPTION

*/etc/network/interfaces* contains network interface information for the [**ifup**(8)](/ifup/8.md) and [**ifdown**(8)](/ifdown/8.md) commands. This manpage describes the **ifupdown-multi** extensions to the the standard [**interfaces**(5)](/interfaces/5.md) 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)](/ip/8.md) 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)](/ifup/8.md) is run and removes the same policy routing information when [**ifdown**(8)](/ifdown/8.md) is run.

## IFACE OPTIONS

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.

- **multi\_gateway *address***

  Default gateway for this interface. (Required.)

- **multi\_table *id***

  Table identifier. This must be a numeric value, and each interface must have a unique value. Recommended range: 1-1000. (Required.)

- **multi\_gateway\_weight *weight***

  Set this gateway's weight. This value is directly passed as the *weight* parameter to the *nexthop* part of an [**ip-route**(8)](/ip-route/8.md) 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)](/ip-rule/8.md) command to use this connection for the specified prefixes. (Optional.)

## EXAMPLES

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
```

## FILES

- ***/etc/network/interfaces***

  System-wide network interface configuration. See [**interfaces**(5)](/interfaces/5.md).

- ***/run/network/ifupdown-multi.\****

  State information used by **ifupdown-multi**.

## SEE ALSO

[**interfaces**(5)](/interfaces/5.md), [**ifup**(8)](/ifup/8.md), [**ip**(8)](/ip/8.md), [**ip-route**(8)](/ip-route/8.md), [**ip-rule**(8)](/ip-rule/8.md).

- **Linux Advanced Routing & Traffic Control HOWTO -- Chapter 4: Rules.**

  *http://www.tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.rpdb.html*
