sonic-mgmt-framework icon indicating copy to clipboard operation
sonic-mgmt-framework copied to clipboard

Interface allows non existent VLAN to be tagged

Open fzakfeld opened this issue 2 years ago • 0 comments

It is possible to tag a VLAN or VLAN range on an interface without the VLAN actually existing. When you create the VLAN afterwards, it is not working and needs to be added again.

  1. Tag a non existent VLAN on an interface, e.g.
interface PortChannel10
 switchport trunk allowed Vlan add 12
!
  1. Create the VLAN afterwards (e.g. interface Vlan12)
  2. Now the VLAN is not working, even though we tagged it:
sonic# show Vlan 12
Q: A - Access (Untagged), T - Tagged
NUM        Status      Q Ports            Autostate   Dynamic
12         Inactive                        Enable
  1. Repeat step 1 and afterwards repeat step 3 to see it now working.

I think the KLISH CLI should throw an error when you try to tag a VLAN that is not yet created. This will avoid both the situation described above, and will clarify for users that VLANs need to be created first.

Edit: This might also effect the 'all' tagging option

fzakfeld avatar Sep 22 '23 09:09 fzakfeld