QinQ stripping tags
On Debian box with Kernel 4.9.110, I have a NIC configured for QinQ with 802.1AD as the outer tag and 802.1Q as the inner tag:
root@pgen:/home/jlixfeld# ip -d link show eth4.10.11
3: eth4.10.11@eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 link/ether 00:0c:bd:08:80:9a brd ff:ff:ff:ff:ff:ff promiscuity 0 vlan protocol 802.1Q id 11 <REORDER_HDR> addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
root@pgen:/home/jlixfeld# ip -d link show eth4.10
2: eth4.10@eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 link/ether 00:0c:bd:08:80:9a brd ff:ff:ff:ff:ff:ff promiscuity 0 vlan protocol 802.1ad id 10 <REORDER_HDR> addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
root@pgen:/home/jlixfeld#
root@pgen:/home/jlixfeld# ip -d a show eth4.10
2: eth4.10@eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 00:0c:bd:08:80:9a brd ff:ff:ff:ff:ff:ff promiscuity 0 vlan protocol 802.1ad id 10 <REORDER_HDR> numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 inet 1.0.10.4/24 scope global eth4.10 valid_lft forever preferred_lft forever inet6 fe80::20c:bdff:fe08:809a/64 scope link valid_lft forever preferred_lft forever
root@pgen:/home/jlixfeld# ip -d a show eth4.10.11
3: eth4.10.11@eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 00:0c:bd:08:80:9a brd ff:ff:ff:ff:ff:ff promiscuity 0 vlan protocol 802.1Q id 11 <REORDER_HDR> numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 inet 1.10.11.4/24 scope global eth4.10.11 valid_lft forever preferred_lft forever inet6 fe80::20c:bdff:fe08:809a/64 scope link valid_lft forever preferred_lft forever
root@pgen:/home/jlixfeld#Looking at the traffic coming out of eth4, I'm not seeing the tag stacks that I would expect to see.
If I generate traffic from 1.10.11.4, I would expect to see the frame double tagged, but I only see a single tag.
root@pgen:/home/jlixfeld# ip netns exec eth4 tcpdump -vvvlnei eth4
tcpdump: listening on eth4, link-type EN10MB (Ethernet), capture size 262144 bytes
16:26:41.789907 00:0c:bd:08:80:9a > 00:0c:bd:08:80:9b, ethertype 802.1Q (0x8100), length 102: vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 11681, offset 0, flags [DF], proto ICMP (1), length 84) 1.10.11.4 > 1.10.11.5: ICMP echo request, id 12947, seq 1, length 64If I generate traffic from 1.0.11.4, I see one tag, and it's 802.1AD tag. This is just fine.
I originally ran this particular test to see if there was an issue forwarding 802.1AD, but there's not.
root@pgen:/home/jlixfeld# ip netns exec eth4 tcpdump -vvvlnei eth4
16:29:59.033928 00:0c:bd:08:80:9a > 00:0c:bd:08:80:9b, ethertype 802.1Q-QinQ (0x88a8), length 102: vlan 10, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 14413, offset 0, flags [DF], proto ICMP (1), length 84) 1.0.10.4 > 1.0.10.5: ICMP echo request, id 12957, seq 1, length 64So it seems as though it can forward 802.1AD and it can forward 802.1Q, but not a stack.
Am I perhaps missing some glue somewhere?
41 Answer
Master interface definition was incorrect for eth4.10.11.
Original:
ip netns exec eth4 ip link add link eth4 name eth4.10 type vlan proto 802.1ad id 10
ip netns exec eth4 ip link add link eth4 name eth4.10.11 type vlan proto 802.1q id 11Fixed:
ip netns exec eth4 ip link add link eth4 name eth4.10 type vlan proto 802.1ad id 10
ip netns exec eth4 ip link add link eth4.10 name eth4.10.11 type vlan proto 802.1q id 11root@pgen:/home/jlixfeld# ip netns exec eth4 ip -d link show
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
2: eth4.10@eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 link/ether 00:0c:bd:08:80:9a brd ff:ff:ff:ff:ff:ff promiscuity 0 vlan protocol 802.1ad id 10 <REORDER_HDR> addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
3: eth4.10.11@eth4.10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 link/ether 00:0c:bd:08:80:9a brd ff:ff:ff:ff:ff:ff promiscuity 0 vlan protocol 802.1Q id 11 <REORDER_HDR> addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
6: eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether 00:0c:bd:08:80:9a brd ff:ff:ff:ff:ff:ff promiscuity 1 addrgenmode eui64 numtxqueues 64 numrxqueues 64 gso_max_size 65536 gso_max_segs 65535
root@pgen:/home/jlixfeld#tcpdump now shows the correct tag stack:
05:30:21.169830 00:0c:bd:08:80:9a > 00:0c:bd:08:80:9b, ethertype 802.1Q-QinQ (0x88a8), length 106: vlan 10, p 0, ethertype 802.1Q, vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 32347, offset 0, flags [DF], proto ICMP (1), length 84) 1.10.11.4 > 1.10.11.5: ICMP echo request, id 6827, seq 1, length 64