Page MenuHomeVyOS Platform

Ethernet device names changing, multiple hw-id being added
Closed, ResolvedPublicBUG

Description

Something really odd is going on in the last few rollings, from at least the August 26th on

My main VLAN trunk:

8: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:02:c9:3f:2c:41 brd ff:ff:ff:ff:ff:ff

But that's the wrong MAC

ethernet eth0 {         
    description "UNTAG"         
    duplex "auto"         
    hw-id "00:02:c9:3f:2c:40"

And then further down in that "eth0" block is another, that I definitely didn't put there.

hw-id "00:02:c9:3f:2c:41"

If I delete that, it shows back up after reboot.

It looks like all the interfaces have hw-id that's changed, either by adding " or by moving devices.

Screenshot_20200828_165340.png (372×315 px, 27 KB)

Details

Difficulty level
Unknown (require assessment)
Version
1.3
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

kroy renamed this task from Ethernet device names changing to Ethernet device names changing, multiple hw-id.Aug 28 2020, 10:02 PM
kroy renamed this task from Ethernet device names changing, multiple hw-id to Ethernet device names changing, multiple hw-id being added.
kroy created this task.

I got this when several times change boot with

set system image default-boot

1.2.6 => 1.3 => 1.2.6 => 1.3

interfaces {
    dummy dum0 {
        address "192.168.99.1/32"
    }
    ethernet eth0 {
        address "192.168.122.12/24"
        duplex "auto"
        hw-id "52:54:00:fa:c8:ea"
        speed "auto"
        hw-id 52:54:00:43:b8:2a
    }
    ethernet eth1 {
        address "100.64.0.1/24"
        duplex "full"
        hw-id "52:54:00:43:b8:2a"
        speed "10000"
        hw-id 52:54:00:fa:c8:ea
    }
    loopback     lo

Correct mac for eth0 should be 52:54:00:fa:c8:ea

So my feeling tells me that the offender is here.

What happens?

When upgrading from e.g. 1.2.6 -> 1.3 or 1.4 a ton of migration scripts is called using the new ConfigTree() class which is fine. When the config is migrated, and saved, ConfigTree() tends to place configuration strings into "" but the call mentioned above, or any running - non touched configuration has

 ethernet eth0 {
     duplex auto
     hw-id 00:50:56:bf:c5:6d
     smp-affinity auto
     speed auto
}

On a subsequent boot, the script from here is called and it simply inserts the hw-id node again - and does not test if it may already exist and now things go down the way of the dodo

Using this config is sufficient to reproduce it:

interfaces {
    dummy dum0 {
        address 172.18.254.201/32
    }
    ethernet eth0 {
        duplex auto
        hw-id 00:50:56:bf:c5:6d
        smp-affinity auto
        speed auto
        vif 10 {
            address 172.16.33.8/24
        }
        vif 201 {
            address 172.18.201.10/24
            ip {
                ospf {
                    authentication {
                        md5 {
                            key-id 10 {
                                md5-key mykey123
                            }
                        }
                    }
                    dead-interval 40
                    hello-interval 10
                    priority 1
                    retransmit-interval 5
                    transmit-delay 1
                }
            }
        }
    }
    ethernet eth1 {
        duplex auto
        hw-id 00:50:56:bf:ef:aa
        smp-affinity auto
        speed auto
    }
    ethernet eth2 {
        duplex auto
        hw-id 00:50:56:bf:19:26
        smp-affinity auto
        speed auto
    }
    ethernet eth3 {
        duplex auto
        hw-id 00:50:56:b3:dc:ec
        smp-affinity auto
        speed auto
    }
}
protocols {
    ospf {
        area 0 {
            network 172.18.201.0/24
            network 172.18.254.201/32
        }
        log-adjacency-changes {
        }
        parameters {
            abr-type cisco
            router-id 172.18.254.201
        }
        passive-interface default
        passive-interface-exclude eth0.201
    }
}
service {
    lldp {
        interface all {
        }
    }
    snmp {
        community public {
            authorization ro
            network 172.16.100.0/24
        }
        contact "Christian Poessinger <[email protected]>"
        listen-address 172.18.254.201 {
        }
        location "Wuerzburg"
    }
    ssh {
        disable-host-validation
        port 22
    }
}
system {
    config-management {
        commit-revisions 200
    }
    host-name vyos
    login {
        user vyos {
            authentication {
                encrypted-password $6$O5gJRlDYQpj$MtrCV9lxMnZPMbcxlU7.FI793MImNHznxGoMFgm3Q6QP3vfKJyOSRCt3Ka/GzFQyW1yZS4NS616NLHaIPPFHc0
                plaintext-password ""
            }
        }
    }
    name-server 172.16.254.30
    ntp {
        server 172.16.100.10 {
        }
        server 172.16.100.20 {
        }
        server 172.16.110.30 {
        }
    }
    syslog {
        global {
            facility all {
                level info
            }
            facility protocols {
                level debug
            }
        }
    }
    time-zone Europe/Berlin
}


/* Warning: Do not remove the following line. */
/* === vyatta-config-version: "broadcast-relay@1:cluster@1:config-management@1:conntrack-sync@1:conntrack@1:dhcp-relay@2:dhcp-server@5:dns-forwarding@1:firewall@5:ipsec@5:l2tp@1:mdns@1:nat@4:ntp@1:pptp@1:qos@1:quagga@6:snmp@1:ssh@1:system@9:vrrp@2:wanloadbalance@3:webgui@1:webproxy@1:webproxy@2:zone-policy@1" === */
/* Release version: 1.2.6 */

After the first boot with the new image all is fine - when you reboot one more time - the config is altered once more and you get

interfaces {
    dummy dum0 {
        address "172.18.254.201/32"
    }
    ethernet eth0 {
        duplex "auto"
        hw-id "00:50:56:bf:c5:6d"
        speed "auto"
        vif 10 {
            address "172.16.33.8/24"
        }
        vif 201 {
            address "172.18.201.10/24"
        }
        hw-id 00:50:56:bf:c5:6d
    }
    ethernet eth1 {
        duplex "auto"
        hw-id "00:50:56:bf:ef:aa"
        speed "auto"
        hw-id 00:50:56:bf:ef:aa
    }
    ethernet eth2 {
        duplex "auto"
        hw-id "00:50:56:bf:19:26"
        speed "auto"
        hw-id 00:50:56:bf:19:26
    }
    ethernet eth3 {
        duplex "auto"
        hw-id "00:50:56:b3:dc:ec"
        speed "auto"
        hw-id 00:50:56:b3:dc:ec
    }
}

There are two issues in this task (1) reordering of interfaces (2) redundant hw-id entries due to vyatta_net_name not parsing quoted values. A quick fix for (2) will be a PR for vyatta-cfg-system; the general issues the bug raises, regarding quoted values in configtree, will be addressed in the subtasks.

This looks very promising to me for VyOS 1.4-rolling-202104020417, can we please backport this @jestabro ?

There are two separate issues in this task: quoting of hw-id values (resolved in Sagitta/Equuleus); re-ordering of interfaces with respect to hw-id (Open).

erkin set Issue type to Bug (incorrect behavior).Aug 29 2021, 1:16 PM
erkin removed a subscriber: Active contributors.

As mentioned above, there were two separate issues here:
(1) the issue of quoting of hw-id values is resolved in this task, for both Sagitta and Equuleus

(2) the abiding issue of interface reordering is addressed in
https://vyos.dev/T3871

This will be closed for (1); see T3871 for (2).

jestabro moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.
jestabro moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus (1.3.3) board.