Config Fails on Reboot when hw-id set

I am currently running:

Version:          VyOS 1.4-rolling-202212151959
Release train:    current

Built on:         Thu 15 Dec 2022 19:59 UTC
Build UUID:       342bf0cf-b054-4017-94cb-10261fd0c2d9
Build commit ID:  f56f9f9d7bc169

Architecture:     x86_64
Boot via:         installed image
System type:      bare metal

As you can see, this is running on bare metal and not under virtualization. My interface config looks like:

interfaces {
    ethernet eth0 {
        description "Connection to bs1:tge1/0/41 - Trunk Port"
        hw-id 00:30:3d:1b:2c:3e
         vif 900 {
            address 172.17.253.10/30
            description "VLAN 900 -- Connection to fw01.ind01"
        }
        vif 1000 {
            address 192.168.1.52/24
            description "VLAN 1000 -- Gateway to Spectrum"
        }
    }
}

Due to some issues, we are setting the mac-address via hw-id to an unique address. However, when the system reboots, the config cannot load and interface eth0 is no longer available. The device has 4 interfaces, normally eth0-eth3. But when there is an hw-id other than the NIC’s real address, all interfaces are renumbered starting at 1 (eth1 - eth4).

What should I be doing to persist the custom mac-address on reboot? If push came to shove, I guess I could remove the hw-id from the config, save it and whenever a reboot happens have something call the https://[vyos-ip/configure api-endpoint and set the hw-id, but not save the config. But I feel there should be another way of fixing this problem.

If logs or other information is needed, please let me know.

This is running on a Supermicro X8STi

I’d say to try the latest 1.4 rolling image first. Some interface naming logic did get updated recently.

I’ve made the same mistake before - hw-id is NOT how you set the MAC address of an adaptor.

hw-id is how you say “this phsyical card is mapped to this ethernet interface”

If you want to set the MAC address, use the mac command:

interfaces {
    ethernet eth0 {
        description "My Interface Of HappiNess"
        duplex auto
        mac 2c:23:56:78:e1:22
        mtu 9000
1 Like

I swear, had I just looked at the documentation I would have saw this. I remember looking up how to change the mac address and the first post I came upon spoke about hw-id. Had I even read that entire article, I would have saw the problem.

Thanks. This can be closed.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.