web-dev-qa-db-ja.com

arp who-hasリクエストビューVLAN分離された異なるアドレス(単一NIC)

5つの異なるVLANのトランクポートを介して接続されているDebianホストがあります。ただし、このホストは、すべての異なるIPのarp「who-has」要求に応答します。理由を理解したい...

ここにネットワーク/インターフェースファイル(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ブロードキャストドメインでのさまざまなarpwho-hasリクエストの出力です。

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は中継されていませんが、とにかくこれを修正したいです...誰かが私を助けてくれますか?

3
jjumper

それは大丈夫です、私は修正を見つけました:

それはarp_ignoreの問題でした:echo 1 > /proc/sys/net/ipv4/conf/eth0.1/arp_ignore(vlan1からwho-hasリクエストを受け取ったため)

私見、これはデフォルトの動作である必要があります...

再度、感謝します。

1
jjumper

デフォルトでは、Linuxインストールは "weak end Host" model と呼ばれるものを実装し、任意のインターフェース上のすべてのアドレスへのパケットを受け入れます。 ARPだけが気になる場合は、を使用してARPフィルタリングを有効にする必要があります。

net.ipv4.conf.<interface>.arp_filter

調整可能。他のタイプのIPトラフィックについては、イングレスフィルタリング用の適切なnetfilterルールを設定するか、net.ipv4.conf.<interface>.rp_filterを有効にすることを検討してください(Debianがデフォルトでこれを行っていないかどうかはわかりません)

さらに読む: http://linux-ip.net/html/ether-arp.html#ether-arp-flux-arpfilter

5
the-wabbit