quattor / configuration-modules-core

Node Configuration Manager Components for Everyone
www.quattor.org
Other
6 stars 54 forks source link

ncm-network: nmstate - provide backward capability support for vlan interface in nmstate. #1660

Closed aka7 closed 5 months ago

aka7 commented 6 months ago

currently nmstate supports vlan interface configuration if its defined in following format.

"/system/network/interfaces/eth0.123"
"/system/network/interfaces/eth0.123/vlan"=true

see vlaninterface.pan in test/

Looking at network.pm code, it supports vlan interface if interface name is given with prefix vlan, such as this.

"/system/network/interfaces/vlan0" = create("defaultinterface");
prefix "/system/network/interfaces/vlan0";
"device" = "eth0.123";
"physdev" = "eth0";
"route/0" = dict("address", "1.2.3.4");

we use the format "/system/network/interfaces/eth0.123" so not a issue for us, but this may have impact on anyone else who is using vlan in previous release and want to move to nmstate.

Also nmstate code assumes interface name and device name might always be same in few places, which won't be case here, so may need few fixes on this along the way.