Re: Can several interfaces in one computer actually have a unique IP address?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In article <015501c17b8c$f89903e0$ce7e63d5@venuswin98> you wrote:
> The Linux NET-3-HOWTO states at section 5.1.4 that it is legal to use the
> same IP address on each interface of a single machine in some circumstances.
> I don't understand how that could be.

because you have to forget everything you learend about ip stack
restrictions. You do not have to specify a local ip address as the gateway
for local network routes to tell the kernel which interface to use. this is
an (former) Windows or SysV restriction and even some BSD engines had this.
Nowaday you can tell the kernel (with route) to use the interface by name.

> 1) If two interfaces are attached to the same physical network they would
> compete for the same connections from other hosts: Both interfaces would
> answer the ARP requests with a different MAC and, correct me if I am
> making mistake, the host initiating the connection would use the MAC of the
> last ARP response, making impractical the other interface.

This is indeed a problem. In this case you have to use eighter 2 different
IPs or switch ARP off for one. But this is no reason to forbid the same ip
address for two interfaces.

> In the case that the host having two interfaces starts the communication it
> would send its datagrams to the network and interface that first matches the
> destination address in the routing table. Again, the rest of the interfaces
> have no practical use.

nope, it will send the packet to the interface which is specified in the
route for the destination. if you list the routing table, you will see for
each entry the device name. the first one which matches your destination is
used.

> 2) If each of two interfaces are attached to different physical networks
> among which the host would function as a gateway, the gateway wouldn't
> be able to forward datagrams correctly.

why not? it is basing the decision on how to route packets entirely on the
target ip address, which has nothing to do with the local interface's
address.

> No matter what netmask is used
> for the gateway interfaces the network portion of the destination IP
> address would always match both routes in the routing table

Hm? The packet is not aimed to the local address, otherwise it wont be
forwarded in the first place. You can have networks behind both interfaces
which are totally different.

> If two physical interfaces are used for the purpouse of doubling bandwidth,
> they should be used under an only OS network interface or with two
> different IP addresses.

Nope, for doubling bandwith you must use a bonding driver and a Switch to
support this. Dump "equal cost multipath" is not very reliable.

> I suspect the NET-3-HOWTO assesment is in error.

I suspect you have too much BSD and SysV experience.

Greetings
Bernd
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux