[RETIRED] Using udev for Interface Mappings in Cumulus Workbench Servers


Important! This article has been retired. Check out our GitHub site for the latest demos.

Cumulus Networks uses udev in Cumulus Workbench server hosts to consistently map network interfaces to the physical ports on those servers.

While you can use either MAC addresses or PCI IDs for udev assignments, PCI IDs are the preferred way to do this because you can assign an interface or one of its sub-interfaces to the physical port, while you cannot assign a sub-interface to a physical port when using a MAC address.

For example, mapping eth0 to the PCI ID of the top leftmost physical port on the server means you can always expect eth0 to be mapped that physical port. Likewise, since using PCI IDs for udev assignments enables you to map a virtual sub-interface instead, you could map eth0.100 to that physical port.

Note: All sub-interfaces of a given interface get mapped to the same physical port. Sub-interfaces are specified in /etc/network/interfaces; you don't specify any mappings for them with udev.

If you tried using MAC addresses for udev assignments, you wouldn't be able to map the sub-interface to the physical port. This is because the virtual interfaces share the same MAC address, which causes Linux to create interfaces called randomXX.

Without udev, the interfaces can be assigned in an unpredictable manner, so either eth0 or eth1 could be mapped to that physical port.

The udev rules are stored in /etc/udev/.

The following example uses both MAC addresses and PCI IDs to show you the difference. The top two entries use MAC addresses (specified in the ATTR{address} attribute) while the remaining entries use PCI IDs (specified in the KERNELS attribute):

SUBSYSTEM=="net", ATTR{address}=="c8:1f:66:b8:c4:7a", NAME="eth0", DRIVERS=="?*"
SUBSYSTEM=="net", ATTR{address}=="c8:1f:66:b8:c4:7b", NAME="eth1", DRIVERS=="?*"
SUBSYSTEM=="net", KERNELS=="0000:0a:00.0", NAME="eth2", DRIVERS=="?*"
SUBSYSTEM=="net", KERNELS=="0000:0a:00.1", NAME="eth3", DRIVERS=="?*"

Cumulus Linux uses a Python script to dynamically generate this file from /var/www/wbench.json on each workbench when you install the cldemo-wbench-ubuntuserver-trusty package.

Learn more about udev on Wikipedia.


Have more questions? Submit a request


Powered by Zendesk