Comparing ifupdown2 Commands with ifupdown Commands

ifupdown2 is the network interface manager for Cumulus Linux. It is an updated version of the original ifupdown in both Cumulus Linux and Debian. This article demonstrates the differences between the two in how you configure interfaces.

{{table_of_contents}}

Viewing Every ifupdown2 Configuration Keyword/Option

To determine which options you can configure for the bridge settings or bond settings, run:

Layer 2 Bond Interface - with Trunking

The following shows you how to configure bonds with trunking under ifupdown2.

ifupdown

ifupdown2

auto swp3
iface swp3 inet manual
up link set $IFACE up
down link set $IFACE down
auto swp4
iface swp4 inet manual
up link set $IFACE up
down link set $IFACE down
auto bond0
iface bond0 inet manual
up link set $IFACE up
down link set $IFACE down
bond-slaves swp3 swp4
bond-miimon 100
bond-min-links 1
bond-mode 802.3ad
bond-xmit-hash-policy layer3+4
bond-lacp-rate
auto bond0.100
iface bond0.100 inet manual
up link set $IFACE up
down link set $IFACE down
auto bond0.200
iface bond0.200 inet manual
up link set $IFACE up
down link set $IFACE down
auto vlan100
iface vlan100 inet manual
up link set $IFACE up
down link set $IFACE down
mstpctl_ports bond0.100
mstpctl_stp on
auto vlan200
iface vlan200 inet manual
up link set $IFACE up
down link set $IFACE down
mstpctl_ports bond0.200
mstpctl_stp on

Layer 2 Trunk - Port Ranges

The glob keyword replaces regular expressions for creating port ranges, because it doesn't require the interfaces to be mentioned in /etc/network/interfaces. Multiple glob statements can be mentioned in the stanza so one can do a discontiguous port range.

ifupdown

ifupdown2

auto swp3
iface swp3 inet manual
up link set $IFACE up
down link set $IFACE down
auto swp3.100
iface swp3.100 inet manual
up link set $IFACE up
down link set $IFACE down
auto swp4
iface swp4 inet manual
up link set $IFACE up
down link set $IFACE down
auto swp4.100
iface swp4.100 inet manual
up link set $IFACE up
down link set $IFACE down
auto swp12
iface swp12 inet manual
up link set $IFACE up
down link set $IFACE down
auto swp12.100
iface swp12.100 inet manual
up link set $IFACE up
down link set $IFACE down
auto swp21
iface swp21 inet manual
up link set $IFACE up
down link set $IFACE down
auto swp21.100
iface swp21.100 inet manual
up link set $IFACE up
down link set $IFACE down
auto swp22
iface swp22 inet manual
up link set $IFACE up
down link set $IFACE down
auto swp22
iface swp22.100 inet manual
up link set $IFACE up
down link set $IFACE down
auto vlan100
iface vlan100 inet manual
up link set $IFACE up
down link set $IFACE down
mstpctl_ports swp3.100 swp4.100 swp12.100 swp21.100 swp22.100
mstpctl_stp on

IPv6 Address Assignment

ifupdown2 does not require IPv6 addresses to be configured under an independent inet6 section. All interface configuration is done under the same section. The same is true for the loopback configuration as well.

Creating the Default Configuration Using Mako

Mako is a templating engine that can be used to generate the /etc/network/interfaces configuration. It can be used to generate a default configuration. The example below shows how to set defaults for bonds. By default, ifupdown2 will read Mako files in the /etc/network/ifupdown2/templates directory. You can change this location in the /etc/network/ifupdown2/ifupdown2.conf. To view the expanded configuration, like a running config, run ifquery bond0 or ifquery -a.