sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
741 stars 1.44k forks source link

It's not allowed to create subinterface on a interface that is assigned to VLAN #20259

Open johndexter1 opened 2 months ago

johndexter1 commented 2 months ago

Description

It's not allowed to create subinterface on a interface that is assigned to vlan.

Steps to reproduce the issue:

  1. config add vlan 100
  2. config vlan member add -u 100 Ethernet0
  3. config subinterface add Ethernet0.5 5

Describe the results you received:

You will receive an error "Ethernet0 is configured as a member of vlan. Cannot configure subinterface"

Describe the results you expected:

I would expected subinterface to be created. This is allowed behavior on some platforms, as example, Cumulus Linux.

Output of show version:

202405 branch

I did some testing and managed to achieve what I want (add subinterface on a interface that is member of vlan) and everything is working as expected. This is really useful feature.

To workaround this issue:

  1. Create the subinterface first
  2. Only then assign interface to vlan
bingwang-ms commented 1 month ago

This is by design. Adding subinterface in a vlan member is not allowed. Please let me know for any other questions.

johndexter1 commented 1 month ago

@bingwang-ms The only thing preventing from this configuration is https://github.com/sonic-net/sonic-utilities/blob/master/config/main.py#L7745-L7748 as soon as you remove it - everything works as expected. Traffic is forwarded through subinterface and the access vlan as well.

So my question would be, if it's supported by ASIC - what's the point of not allowing it?