LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Both eth0 and eth1 with the same ip? (https://www.linuxquestions.org/questions/linux-newbie-8/both-eth0-and-eth1-with-the-same-ip-4175437399/)

sluge 11-16-2012 03:02 AM

Both eth0 and eth1 with the same ip?
 
Hello!
Just for fun I set to eth0 and eth1 the same IP. Wondering that it works! How is it possible? As i know, it is prohibited to use some IP twise in IPv4 subnet.

My output:
Code:

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
GATEWAY="192.168.207.1"
IPADDR="192.168.207.250"
NETMASK="255.255.255.0"
ONBOOT="yes"

# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE="eth1"
BOOTPROTO="static"
GATEWAY="192.168.207.1"
IPADDR="192.168.207.250"
NETMASK="255.255.255.0"
ONBOOT="yes"
TYPE="Ethernet"

eth0      Link encap:Ethernet  HWaddr 01:1C:22:6C:A1:32
          inet addr:192.168.207.250  Bcast:192.168.207.255  Mask:255.255.255.0
          inet6 addr: 2000:192:168:207:20c:29ff:fe6c:e13c/64 Scope:Global
          inet6 addr: fe80::20c:29ff:fe6c:e13c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2627 errors:0 dropped:0 overruns:0 frame:0
          TX packets:407 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:181446 (177.1 KiB)  TX bytes:38866 (37.9 KiB)

eth1      Link encap:Ethernet  HWaddr 11:AC:Z9:62:54:43
          inet addr:192.168.207.250  Bcast:192.168.207.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe6c:e146/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:721 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:113478 (110.8 KiB)  TX bytes:4159 (4.0 KiB)

]# route -n
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
192.168.207.0  0.0.0.0        255.255.255.0  U    0      0        0 eth0
192.168.207.0  0.0.0.0        255.255.255.0  U    0      0        0 eth1
169.254.0.0    0.0.0.0        255.255.0.0    U    1002  0        0 eth0
169.254.0.0    0.0.0.0        255.255.0.0    U    1003  0        0 eth1
0.0.0.0        192.168.207.1  0.0.0.0        UG    0      0        0 eth0


mandyapenguin 11-16-2012 03:22 AM

Ah, amazing!!! Don't know how?
Are these both interface connected simultaneously?
Code:

mii-tool
And also can you check whether there is no packet loss from both interface?
Code:

ping -I eth0 google.com

ping -I eth1 google.com


jefro 11-16-2012 05:54 PM

It is possible to do what you did. The underlying rules would eventually select which one the system would use. I forget them all but in all tcp/ip there are many not normally known rules for these issues.


All times are GMT -5. The time now is 03:13 PM.