srl-labs / containerlab

container-based networking labs
https://containerlab.dev
BSD 3-Clause "New" or "Revised" License
1.51k stars 260 forks source link

InitVirtualWiring broken #90

Closed henderiw closed 3 years ago

henderiw commented 3 years ago

InitVirtualWiring is broken, if you delete one end of the virtual wire the other end also disappears

hellt commented 3 years ago

as far as I see, now we don't create veth pairs with clab prefix anymore. We instead use the random number appended to the veth interface name.

For instance, for a newly deployed lab this will be the list of system interfaces:

❯ ip l show type veth
201: vetha594cb9@if200: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-1f7df5cf627e state UP mode DEFAULT group default
    link/ether 8e:37:42:54:ec:07 brd ff:ff:ff:ff:ff:ff link-netnsid 0
203: veth726af48@if202: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-1f7df5cf627e state UP mode DEFAULT group default
    link/ether 72:53:d8:ba:f6:8e brd ff:ff:ff:ff:ff:ff link-netnsid 1

So in the future we can remove the InitVirtualWiring part where the clab- interfaces get deleted altogether, since the latest published containerlab version (0.7.0) won't create such interfaces

The following command can be used to remove those interfaces manually:

ip l show type veth | grep clab | awk '{print $2}' | cut -d '@' -f1 | xargs -n1 ip l del
henderiw commented 3 years ago

we might just have a cleanup option that destroys the interfaces that are hanging

hellt commented 3 years ago

the root cause of the issue has been identified, the fix is in f5b46c0