Preventing incorrect ARP entries

The correct setting of a multi-homed IPoIB host is achieved by using a different PKEY for each IP subnet. In some cases a host could have multiple interfaces on the same IP subnet, and you need to prevent a peer from building an incorrect ARP entry, or neighbor.

Procedure

  1. Set the net.ipv4.conf.X.arp_ignore value to 1 or 2, where X is the IPoIB (non-child) interfaces (for example, ib0, ib1.). This causes the network stack to send ARP replies only on the interface with the IP address specified in the ARP request.
    sysctl -w net.ipv4.conf.ib0.arp_ignore=1 
    sysctl -w net.ipv4.conf.ib1.arp_ignore=1 
  2. Optional: For a global setting, run the following command:
    sysctl -w net.ipv4.conf.all.arp_ignore=1 
  3. Optional: You can also set the arp_filter parameter as shown in the following command:
    sysctl -w net.ipv4.conf.default.arp_filter = 1