Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set 0x88a8 (802.1ad) service tag for QinQ interface? #5893

Closed
ccy opened this issue Jul 20, 2022 · 8 comments
Closed

How to set 0x88a8 (802.1ad) service tag for QinQ interface? #5893

ccy opened this issue Jul 20, 2022 · 8 comments
Assignees
Labels
bug Production bug
Milestone

Comments

@ccy
Copy link

ccy commented Jul 20, 2022

#5560 mention double tagged QinQ vlan is ready.

In 22.7 RC1, I create a QinQ interface:

vlan02: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80000<LINKSTATE>
        ether 52:54:00:81:af:7f
        groups: vlan
        vlan: 222 vlanproto: 802.1q vlanpcp: 0 parent interface: vtnet0
        media: Ethernet autoselect (10Gbase-T <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
qinq01: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1496
        description: OPT2
        options=80000<LINKSTATE>
        ether 52:54:00:81:af:7f
        inet 192.168.111.13 netmask 0xffffff00 broadcast 192.168.111.255
        groups: vlan
        vlan: 111 vlanproto: 802.1q vlanpcp: 0 parent interface: vlan02
        media: Ethernet autoselect (10Gbase-T <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

In above setting, the double tagged packets use EtherType of 0x8100 (802.1Q) for both outer and inner tag.

The standard 802.1ad should use 0x88a8 as outer tag and 0x8100 as inner tag.

I couldn't find in OPNsense UI to specify to utilize 802.1ad protocol or 0x88a8 as outer tag.

@ccy ccy added the support Community support label Jul 20, 2022
@fichtner fichtner added upstream Third party issue and removed support Community support labels Jul 20, 2022
@fichtner
Copy link
Member

This is a kernel limitation of the QinQ implementation.

@AdSchellevis AdSchellevis added bug Production bug and removed upstream Third party issue labels Jul 20, 2022
@AdSchellevis
Copy link
Member

something looks off here, manually I seem to be able to create the right protocol:

root@OPNsense:~/core # ifconfig vlan create vlandev le2_vlan4 vlan 5 vlanproto 802.1ad
vlan13
root@OPNsense:~/core # ifconfig vlan13
vlan13: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1496
	ether 00:0c:29:50:76:45
	groups: vlan
	vlan: 5 vlanproto: 802.1ad vlanpcp: 0 parent interface: le2_vlan4
	media: Ethernet autoselect
	status: active
	nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

We probably have to set vlanproto explicitly

@AdSchellevis AdSchellevis self-assigned this Jul 20, 2022
@AdSchellevis
Copy link
Member

Ok, I don't think I can fix this instantly as there is a limitation in how to handle vlanproto in the kernel. When we create the parent interface, we're not sure if there are (future) children and changing the proto doesn't seem to work.

ifconfig le2_vlan4 vlanproto 802.1ad

results in :

le2_vlan4: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
	description: OPT2
	ether 00:0c:29:50:76:45
	vlan: 4 vlanproto: 802.1q vlanpcp: 0 parent interface: le2
	media: Ethernet autoselect
	status: active
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

@ccy
Copy link
Author

ccy commented Jul 20, 2022

There is a command in VyOS to modify the the vlan protocol:

set interfaces ethernet eth0 vif-s 222 protocol '802.1ad'

@fichtner
Copy link
Member

More upstream context here, maybe move this to src.git for now?

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264014

@fichtner
Copy link
Member

@AdSchellevis shouldn't we put the upstream label back?

AdSchellevis added a commit that referenced this issue Sep 3, 2022
…d (QinQ) interface types.

Currently this doesn't work (yet), likely needs https://reviews.freebsd.org/D35848 so vlanproto can be set after the interface creation phase (now it's only possible to set proto there).
If `ifconfig XXXX vlanproto 802.1ad` sets the property, we do need this code to make sure we set these on QinQ parent vlan tags. As a workaround we could pass proto in legacy_interface_create() as well to make this (only) work on boot, but looking at the upstream fix, this might be something easy to pull in the near future.

for #5893
@AdSchellevis
Copy link
Member

@fichtner reading the commit message of freebsd/freebsd-src@b82b805 , I think we can fix core (change the parents proto to 802.1ad when there are children involved) with this e1d8b47 after the ifconfig code lands in our base.

@fichtner fichtner added this to the 23.1 milestone Jan 20, 2023
@fichtner
Copy link
Member

outer vlan "ad", inner vlan "q"

fichtner pushed a commit that referenced this issue Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Production bug
Development

No branches or pull requests

3 participants