Skip to content

ifupdown2 testing

Amy Buck edited this page Dec 11, 2018 · 10 revisions

ifupdown2 is an alternate implementation of Debian's network interface manager ifupdown. It has been tested on OPX, and this information includes usage examples from that testing. ifupdown2 is not included by default in the OPX installer. To install it, you should run sudo apt-get install ifupdown2.

Things that work

This information details interface features that do work.

Interface ranges

Interface ranges may be specified in the /etc/network/interfaces file:

auto bond11
iface bond11 inet manual
    bond-slaves glob e101-00[3-9]-[1-4]   # These are the breakout ports e101-003-1 to e101-009-4
    bond-mode 802.3ad
    bond-miimon 100
    bond-min-links 1
    bond-lacp-rate 1
 
auto br1
iface br1 inet manual
    bridge-ports glob e101-00[1-10]-0.1  # ports from e101-001-1 to e101-001-10 tagged with vlan 1

Bringing interfaces up and down, reloading

  • ifup brings up all interfaces specified in the /etc/network/interfaces file
  • ifdown brings down all interfaces and removes their configurations from the kernel
  • ifreload reloads the /etc/network/interfaces file without affecting the existing configuration
  • ifreload -s -a performs a syntax check and reloads the /etc/network/interfaces file

Configuration display

ifquery queries the configuration from /etc/network/interfaces and displays it.

root@OS10:/etc/network# ifquery br1011
auto br1011
iface br1011 inet static
        address 100.1.10.1/31
        bridge-ports bond11.1011

Python Mako templates

This is more of a tip, but you can use a Python Mako template to generate configurations for /etc/network/interfaces. This example template was used to generate configurations in OPX system testing. Note that you must first install mako using pip install mako. Use mako-render <template-file> to convert the template to an actual configuration.

auto bond11
iface bond11 inet manual
bond-slaves glob e101-00[3-9]-[1-4]
bond-mode 802.3ad
bond-miimon 100
bond-min-links 1
bond-lacp-rate 1
% for i in range(1, 5):
pre-down sudo /usr/bin/opx-ethtool -s e101-003-${i} autoneg off
pre-down sudo /usr/bin/opx-ethtool -s e101-004-${i} autoneg off
pre-down sudo /usr/bin/opx-ethtool -s e101-009-${i} autoneg off
pre-down sudo /usr/bin/opx-ethtool -s e101-010-${i} autoneg off
% endfor
 
<% j = 0 %>
%for i in range(1001,1065):
auto br${i}
iface br${i} inet static
address 100.1.${j}.1/31
bridge_ports bond11.${i}
<% j += 1 %>
% endfor

Dummy loopback IP address

Dummy loopback IP address programming works without having to make any changes to OPX scripts or service files.

Things that don't work

  • VLAN-aware bridge mode
  • VxLAN-aware bridge mode
  • ethtool-related settings
    • Setting link speed, duplex, and auto-negotiation settings on the /etc/network/interfaces file doesn't work. Cumulus uses the ethtool command to configure these parameters, whereas OPX provides opx-ethtool to push those parameters to the interface.
Clone this wiki locally