After several hardware generations of our servers we had enough of the ever-changing naming schemes of the network interfaces.
This had troubled us in so many different ways:
- "Does this NIC count the ports from left to right or right to left!?" during hardware install.
- Interface names need to be specified in BGP daemon config.
- Prometheus alerting rules specify the interfaces.
- ...
The solution is simple, but very effective:
- During installation of the server OS, we are installing a small utility binary (
ifnamedhcp). - This binary iterates over all Ethernet interfaces, does a DHCP request and waits for the response containing a custom Option that specifies the interface name to configure.
- The name is then configured using systemd-networkd config.