Have you encountered an issue with your VyOS instance where after upgrading the system, the interfaces either missing or got mixed around?
I have been dealing with this issue with my Supermicro MBD-A1SRi-2758F-O board with Intel x520-DA2. It is a hit and miss issue. The symptoms are the hardware MAC address of each interface got assigned to another interface. Another symptom is that some interfaces do not have hardware MAC addresses.
With these symptoms happening after the system upgrade, the sole purpose of a router is broken. The device cannot route because of the hardware addresses issues mentioned earlier. Apparently, the fix is pretty simple. Make sure to hard code the MAC address of each interface. What we need to happen here is the interfaces hardware MAC addresses to be saved to the /config/config.boot
. Otherwise, there is a high potential that you may encounter this issue.
Make sure you know what MAC address is assigned to each interface. The quickest way for me is to use the ifconfig
tool, but make sure that the current VyOS image is working well with your system; otherwise, you may get different results.
Since I have several virtual interfaces, I have to filter the output of the ifconfig
command to show only the ethernet interfaces.
vyos@fw01:~$ ifconfig | grep HW | grep eth eth0 Link encap:Ethernet HWaddr ac:1f:6b:b1:d3:a8 eth1 Link encap:Ethernet HWaddr ac:1f:6b:b1:d3:a9 eth2 Link encap:Ethernet HWaddr ac:1f:6b:b1:d3:aa eth3 Link encap:Ethernet HWaddr ac:1f:6b:b1:d3:ab eth4 Link encap:Ethernet HWaddr 00:1b:21:b9:f4:a1 eth5 Link encap:Ethernet HWaddr 00:1b:21:b9:f4:a1
To hard code these MAC addresses to their associated interfaces, we would need to configure each interface as shown below.
configure set interfaces ethernet eth0 hw-id ac:1f:6b:b1:d3:a8 set interfaces ethernet eth1 hw-id ac:1f:6b:b1:d3:a9 set interfaces ethernet eth2 hw-id ac:1f:6b:b1:d3:aa set interfaces ethernet eth3 hw-id ac:1f:6b:b1:d3:ab set interfaces ethernet eth4 hw-id 00:1b:21:b9:f4:a0 set interfaces ethernet eth5 hw-id 00:1b:21:b9:f4:a1 # commit and save commit;save
Verify the /config/config.boot
using the less
command. We are using less
command so that we can search for ethernet and jump to it quicker. Once in less
mode, enter /
to enter in search mode the search for “ethernet” i.e. /ethernet
. See the output below.
less /config/config.boot ethernet eth0 { address dhcp description "untrust interface - the Internet" duplex auto hw-id ac:1f:6b:b1:d3:a8 smp-affinity auto speed auto } ethernet eth1 { address 10.0.3.100/24 description "RESERVED FOR FUTURE EXPANSION" duplex auto hw-id ac:1f:6b:b1:d3:a9 smp-affinity auto speed auto } ethernet eth2 { address 172.31.0.1/24 description "(ipmi) vault1" duplex auto hw-id ac:1f:6b:b1:d3:aa smp-affinity auto speed auto } ethernet eth3 { address 10.2.3.2/24 description "(ipmi) pve1" duplex auto hw-id ac:1f:6b:b1:d3:ab smp-affinity auto speed auto } ethernet eth4 { bond-group bond0 description "link to sw1 ethernet 26" duplex auto hw-id 00:1b:21:b9:f4:a0 smp-affinity auto speed auto } ethernet eth5 { bond-group bond0 description "link to sw1 ethernet 27" duplex auto hw-id 00:1b:21:b9:f4:a1 smp-affinity auto speed auto } :
If the output of config.boot looks good, then you are golden.
Cheers!