我正在试图build立一个静音的桥梁监测目的。 我的电脑运行linux 2.6,brctl 1.4,并且有3个网卡:
eth0,分配有IP,用于SSH维护
eth1和eth2,桥br0的2个端口
全部设置在etc / network / interfaces中:
auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.1.120 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.254 auto br0 iface br0 inet manual bridge_ports eth1 eth2 bridge_maxwait 0 bridge_stp off
这样,eth0和eth1都连接到我的本地networking(eth2连接到我的网关)但只有eth0有一个IP地址。
这个网桥工作得很好,我可以使用tcpdump -i br0或其他工具来监视stream量。
由于网桥没有IP地址,因此不应该发送任何stream量。 但是,它有时会回答arp请求,而不是eth0。
假设eth0为00:01:02:ab:00:00,eth1为00:01:02:ab:00:01(mac地址):这就是我在运行wireshark的本地站上得到的结果:
packet no time source dest protocol info 4303 1063.539943 00:01:02:ab:00:01 Giga-Byt_46:d9:fe ARP 192.168.1.120 is at 00:01:02:ab:00:01 4305 1063.539958 00:01:02:ab:00:00 Giga-Byt_46:d9:fe ARP 192.168.1.120 is at 00:01:02:ab:00:00
由于我的“真正的”IP接口在几毫秒后才会响应,但情况并非如此……我该如何解决这个问题?
除了使用/ proc / * / arp_ignore之外的另一个选项是摆脱eth0接口并将IP地址放在网桥上:
auto br0 iface br0 inet manual bridge_ports eth1 eth2 bridge_maxwait 0 bridge_stp off address 192.168.1.120 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.254
就我个人而言,我认为这是因为界面直接在桥上而简化了一些概念。