嵌入式linux中文站在线图书

Previous Page
Next Page

28.4. Responding from Multiple Interfaces

Linux has a rather unusual design: it considers an IP address as belonging to a host rather than an interface, even though administrators always assign IP addresses to particular interfaces.[*] This has impacts that some administrators complain about:

[*] Using the options described in the section "Tunable ARP Options," you can make Linux behave as if IP addresses belonged to the interfaces. For an interesting discussion of this design, including its advantages and disadvantages, you can refer to the (pretty long) thread "ARP responds on all devices" on the netdev mailing list, which is archived at http://oss.sgi.com/archives/netdev.

  • A Linux host replies to any ARP solicitation requests that specify a target IP address configured on any of its interfaces, even if the request was received on this host by a different interface. To make Linux behave as if addresses belong to interfaces, administrators can use the ARP_IGNORE feature described later in the section "/proc Options."

  • Hosts can experience the ARP flux problem, in which the wrong interface becomes associated with an L3 address. This problem is described in the text that follows.

Imagine you have a host with two NICs on the same LAN, and that another host sends an ARP request for one of the addresses. The request is received by both interfaces, as shown in Figure 28-5, and both interfaces reply.

Figure 28-5. The ARP flux problem


The host sending the solicitation therefore receives two replies to its request. One comes from the NIC with the correct L2 address (eth0) but the other bears the other NIC's address (eth1). Which address is entered by the correspondent in its ARP cache depends on the order in which the requests happen to be received and the host's way of handing duplicate repliesin short, it's nondeterministic.

The ARP flux problem can be solved with the features described in the section "Tunable ARP Options."


Previous Page
Next Page