我有5个不同的vlan上通过中继端口连接的debian主机。 但是这个主机响应arp“谁有”所有他们不同的ip请求。 我希望明白为什么…
这里的networking/接口文件(eth0.1句柄172.16.1.145/16)
auto lo iface lo inet loopback allow-hotplug eth0 iface eth0 inet manual auto eth0.1 iface eth0.1 inet dhcp auto eth0.10 iface eth0.10 inet static address 192.168.10.254 netmask 255.255.255.0 auto eth0.6 iface eth0.6 inet static address 192.168.6.254 netmask 255.255.255.0 auto eth0.7 iface eth0.7 inet static address 192.168.7.254 netmask 255.255.255.0 auto eth0.2 iface eth0.2 inet static address 0.0.0.0 netmask 0.0.0.0
这是由ldc(172.16.1.50/16)在vlan1广播域上请求的不同arp的输出,
ldc:~# arping 172.16.1.145 ARPING 172.16.1.145 60 bytes from ab:cd:ef:01:23:45 (172.16.1.145): index=0 time=193.119 usec ^C --- 172.16.1.145 statistics --- 1 packets transmitted, 1 packets received, 0% unanswered (0 extra) ldc:~# arping 192.168.10.254 ARPING 192.168.10.254 60 bytes from ab:cd:ef:01:23:45 (192.168.10.254): index=0 time=221.014 usec ^C --- 192.168.10.254 statistics --- 1 packets transmitted, 1 packets received, 0% unanswered (0 extra) ldc:~# arping 192.168.6.254 ARPING 192.168.6.254 60 bytes from ab:cd:ef:01:23:45 (192.168.6.254): index=0 time=256.062 usec ^C --- 192.168.6.254 statistics --- 1 packets transmitted, 1 packets received, 0% unanswered (0 extra) ldc:~# arping 192.168.7.254 ARPING 192.168.7.254 60 bytes from ab:cd:ef:01:23:45 (192.168.7.254): index=0 time=211.954 usec ^C --- 192.168.7.254 statistics --- 1 packets transmitted, 1 packets received, 0% unanswered (0 extra)
肯定l3没有被中继,但我想解决这个问题呢…有人可以帮助我吗?
默认情况下,Linux安装会实现一种称为“弱端主机”的模式 ,在任何接口上接受所有地址的数据包。 如果只是ARP打扰你,你应该启用ARP过滤使用
net.ipv4.conf.<interface>.arp_filter
可调。 对于其他types的IPstream量,考虑为入口过滤和/或启用net.ipv4.conf.<interface>.rp_filter设置合适的netfilter规则net.ipv4.conf.<interface>.rp_filter (如果Debian没有默认这样做,不知道)
进一步阅读: http : //linux-ip.net/html/ether-arp.html#ether-arp-flux-arpfilter
没关系,我find了解决办法:
这是一个arp_ignore的问题: echo 1 > /proc/sys/net/ipv4/conf/eth0.1/arp_ignore (因为我收到来自vlan1的请求)
恕我直言,这应该是默认行为…
再次感谢。
您应该在每个vlan接口条目中写入vlan-raw-device eth0 。 请参阅man vlan-interfaces 。 如果您命名接口eth0.1,eth0.2,… – 它只是添加额外的地址到同一个物理接口。 使用其他名称,例如eth0_vlan1,…
试试这个:
auto eth0 iface eth0 inet manual auto vlan6 iface vlan6 inet static address 192.168.6.254 netmask 255.255.255.0 ...
如果有效的话写