Avoid ARP flux with multiple ports connected to same network

Hi!

I thought this information might be useful to anyone who is connecting multiple of the Ethernet ports to the same network. By default, Linux treats an IP address as being “owned” by the host and hence will respond to ARP replies for that IP address on any interface it sees requests on. For something like the Ten64, you really want IP addresses to be per-interface and Linux to only respond to ARP requests per on the interface the IP address is configured on.

To fix this you need to run;

sysctl -w net.ipv4.conf.all.arp_announce=1
sysctl -w net.ipv4.conf.all.arp_ignore=2

To make the config permanent you want to create a file at sysctl -w net.ipv4.conf.all.arp_ignore=2 with the contents of;

net.ipv4.conf.all.arp_ignore=1
net.ipv4.conf.all.arp_announce=2

You can find out more at https://netbeez.net/blog/avoiding-arp-flux-in-multi-interface-linux-hosts/, Why does Linux answer to ARP on incorrect interfaces? - Server Fault and Harping on ARP [LWN.net]

Hope this is helpful to someone!

Tim ‘mithro’ Ansell