LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-16-2012, 03:02 AM   #1
sluge
Member
 
Registered: Dec 2006
Location: Russia,52
Posts: 128

Rep: Reputation: 6
Question 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
 
Old 11-16-2012, 03:22 AM   #2
mandyapenguin
Member
 
Registered: Nov 2011
Location: India
Distribution: RedHat, Cent OS, Fedora, Debian, Ubuntu
Posts: 106

Rep: Reputation: Disabled
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
 
Old 11-16-2012, 05:54 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,979

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Production server with static IPs on eth0 and eth0:1 - need private LAN on eth1 stardotstar Linux - Networking 8 07-03-2010 12:27 AM
howto acess intrnet thru eth1(wireless card)in winXP via briging in linux(eth0-eth1) labhesh_popli Linux - Wireless Networking 1 09-21-2006 01:11 AM
Wireless network on eth1 diabled Ethernet eth0 and eth0 never comes back tadatoshi Linux - Wireless Networking 4 09-23-2004 05:57 PM
eth1 added, mysql connections FROM this machine are from eth1. Need bound to eth0??? kreese Linux - Networking 9 03-31-2004 12:12 PM
Kernel 2.4.22 finds eth0 and eth1 but 2.6.0 does not find eth1 coollink Linux - Networking 3 01-13-2004 07:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration