Multiple ifaces with the same IP

MN-only

Configuration: 2 hosts, 2 ethernet ifaces on each

Commands:

[guest1:2]# tcpdump -i eth0 -nn -v -e
[guest1:1]# nc -l 192.168.0.1 10000

[guest2:2]# tcpdump -i eth0 -nn -v -e
[guest2:1]# nc 192.168.0.1 10000

Then type something to nc on both guests. Tcpdumps would show traffic in both directions on vlan1 (where both eth0 are connected).

[guest1:2]# ^C
[guest1:2]# ifconfig eth0 down
[guest1:2]# tcpdump -i eth1 -nn -v -e

And type something now on both consoles. See that tcpdump on guest2 show endless ACK to 0:0:0:0:0:1 and after a while -- ARP requests for 192.168.0.1.
Guest1 shows packet retransmissions (and no ACKs from guest2).

There's no connection after a while.

MN and SN

Configuration: 2 hosts, 2 ethernet interfaces on each, ppp over serial line

What's done: TCP server started on guest1, TCP client connects to it from guest2 and starts traffic. Initially eth0 is up on both guests. Then eth0 is brought down and eth1 is brought up on both guests. Then the same transition to ppp0. Then back to eth0.

Commands:

[guest1:1]# tcpdump -i any -nn -w any.pcap
[guest1:2]# ifconfig eth0 up ; ifconfig eth1 down ; ifconfig ppp0 down
[guest1:2]# iperf -s
[guest1:3]# sleep 5 ; ifconfig eth0 down ; ifconfig eth1 up ; sleep 5 ; ifconfig eth1 down ; ifconfig ppp0 up ; sleep 5 ; ifconfig ppp0 down ; ifconfig eth0 up

[guest2:2]# ifconfig eth0 up ; ifconfig eth1 down ; ifconfig ppp0 down
[guest2:2]# iperf -t 20 -i 2 -c 192.168.1.1
[guest2:3]# route -n ; sleep 5 ; ifconfig eth0 down ; ifconfig eth1 up
[guest2:3]# route -n ; sleep 5 ; ifconfig eth1 down ; ifconfig ppp0 up
[guest2:3]# route -n ; sleep 5 ; ifconfig ppp0 down ; ifconfig eth0 up
[guest2:3]# route -n

Here's routing tables printed at the point of interface switch on guest1 (where the pcap is taken)

bash-4.0# ./test2-run 1 2
+ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.10.0    0.0.0.0         255.255.255.0   U     0      0        0 eth2
+ go_with_gap eth0 eth1
+ sleep 5
+ ifconfig eth0 down
+ ifconfig eth1 up
+ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.10.0    0.0.0.0         255.255.255.0   U     0      0        0 eth2
+ go_with_gap eth1 ppp0
+ sleep 5
+ ifconfig eth1 down
+ ifconfig ppp0 up
+ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.2     0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.10.0    0.0.0.0         255.255.255.0   U     0      0        0 eth2
+ go_with_gap ppp0 eth0
+ sleep 5
+ ifconfig ppp0 down
+ ifconfig eth0 up
+ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.10.0    0.0.0.0         255.255.255.0   U     0      0        0 eth2

TCP connection survive roundtrip eth0 -> eth1 -> ppp0 -> eth0 on both sides. There are even moments when no interface is up.

pcap dump from guest1 is attached: any.pcap

guest1-1.pcap - guest1 eth0 pcap (1 kB) Max Filippov, 03/03/2010 12:31 am

guest1-2.pcap - guest1 eth1 pcap (2.4 kB) Max Filippov, 03/03/2010 12:31 am

guest2.pcap - guest2 eth0 pcap (5.6 kB) Max Filippov, 03/03/2010 12:32 am

any.pcap - guest1 'any' pcap (1.7 MB) Max Filippov, 03/07/2010 02:06 am