需要有关桥接分接接口运行 stp 流量的建议。
- 创建了 Tap 接口和 Bridge
- 曾经遇到过stp BPDU被网桥消耗的情况。
- 我在主机上运行 scapy,但是当我运行 tcppdump 时,我没有在网桥上或 tapB 接口上看到 stp BPDU,请提供意见4。
- 我的目的是通过 tapA 发送/注入 stp BPDU,并应在 tapB 或该桥上的任何 tap 接口上接收。
- 我在 tapA 上使用 tcpdump 看到了数据包,但它们没有传递到网桥或 tapB 接口。
斯卡皮
已发送1包。
send(Ether(dst="01:80:c2:00:00:00")/LLC()/STP(), iface="tapA")
警告:未找到到达目的地的 Mac 地址。使用广播
sendp(Dot3(dst="01:80:c2:00:00:00",src="08:17:35:51:29:2e")/LLC(dsap=0xaa,ssap=0xaa)/SNAP(OUI=0x0c,code=0x010b)/STP(),iface="tapA1", count=1)
已发送1包。
我正在运行 tap 监听器,打开 scokets 并接收/读取 tapA 和 tapB 的 tap 接口上的数据
配置:
root@santosh-virtualbox:/home/santosh#sudo brctl addbr testbridge
root@santosh-virtualbox:/home/santosh#sudo ip tuntap add mode tap tapA
oot@santosh-virtualbox:/home/santosh#sudo ip tuntap add mode tap tapB
root@santosh-virtualbox:/home/santosh#sudo brctl addif testbridge tapA
root@santosh-virtualbox:/home/santosh#sudo brctl addif testbridge tapB
root@santosh-virtualbox:/home/santosh#sudo brctl show
bridge name bridge id STP enabled interfaces
testbridge 8000.8207f065cdfb no tapA
tapB
root@santosh-virtualbox:/home/santosh#sudo ip addr add 192.168.67.1/24 dev tapA
root@santosh-virtualbox:/home/santosh#sudo ip addr add 192.168.67.2/24 dev tapB
ip link set dev tapA up
ip link set dev tapB up
ip link set dev testbridge up
ifconfig 输出。
santosh@santosh-virtualbox:~/linux_source$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:26:cd:de brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute enp0s3
valid_lft 85637sec preferred_lft 85637sec
inet6 fe80::f7db:f963:8e15:157e/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:60:7a:a6 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.6/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s8
valid_lft 234879sec preferred_lft 234879sec
inet6 2401:4900:1f26:12bd:ba44:a1f5:3a20:8b18/64 scope global dynamic noprefixroute
valid_lft 86317sec preferred_lft 86317sec
inet6 fe80::1475:613b:ad77:89ee/64 scope link noprefixroute
valid_lft forever preferred_lft forever
4: testbridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether c2:26:1a:8b:d9:d0 brd ff:ff:ff:ff:ff:ff
inet6 fe80::c026:1aff:fe8b:d9d0/64 scope link
valid_lft forever preferred_lft forever
5: tapA: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master testaux state UP group default qlen 1000
link/ether 72:1c:e2:96:9d:d4 brd ff:ff:ff:ff:ff:ff
inet 192.168.67.1/24 scope global tapA
valid_lft forever preferred_lft forever
inet6 fe80::701c:e2ff:fe96:9dd4/64 scope link
valid_lft forever preferred_lft forever
6: tapB: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master testaux state UP group default qlen 1000
link/ether ca:07:2e:eb:c5:12 brd ff:ff:ff:ff:ff:ff
inet 192.168.67.2/24 scope global tapB
valid_lft forever preferred_lft forever
inet6 fe80::c807:2eff:feeb:c512/64 scope link
valid_lft forever preferred_lft forever
问候,Santosh