web-dev-qa-db-ja.com

QinQストリッピングタグ

カーネル4.9.110を搭載したDebianボックスでは、外部タグとして802.1AD、内部タグとして802.1Qを使用してQinQ用にNICを構成しています。

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#

Eth4からのトラフィックを見ると、期待するタグスタックが表示されていません。

1.10.11.4からトラフィックを生成すると、フレームに二重タグが付けられると思いますが、タグは1つしか表示されません。

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 64

1.0.11.4からトラフィックを生成すると、1つのタグが表示され、それは802.1ADタグです。これは問題ありません。

私はもともとこの特定のテストを実行して、802.1ADの転送に問題があったかどうかを確認しましたが、問題はありません。

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 64

したがって、802.1ADを転送でき、802.1Qを転送できるように見えますが、スタックは転送できません。

私はおそらくどこかに接着剤が欠けていますか?

2
Jason

マスターインターフェイスの定義がeth4.10.11に対して正しくありませんでした。

元の:

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 11

修繕:

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 11
root@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: [email protected]: <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に正しいタグスタックが表示されるようになりました。

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
1
Jason