LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-23-2007, 04:24 PM   #1
powah
Member
 
Registered: Mar 2005
Distribution: FC, Gentoo
Posts: 276

Rep: Reputation: 30
both eth0 and eth1 ping fail when one ethernet cable is unplugged


My computer has two ethernet interfaces eth0 and eth1.
The setup are:

# ifconfig
eth0 Link encap:Ethernet HWaddr 00:00:50:98:38:AE
inet addr:172.20.11.200 Bcast:172.20.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:171 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:24983 (24.3 Kb) TX bytes:458 (458.0 b)
Interrupt:11 Base address:0x7000

eth1 Link encap:Ethernet HWaddr 00:00:50:98:38:AF
inet addr:172.20.11.199 Bcast:172.20.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:229 errors:0 dropped:0 overruns:0 frame:0
TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:31971 (31.2 Kb) TX bytes:8351 (8.1 Kb)
Interrupt:9 Base address:0x9000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)

# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.20.0.0 * 255.255.0.0 U 0 0 0 eth1
172.20.0.0 * 255.255.0.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 172.20.11.10 0.0.0.0 UG 0 0 0 eth0

# uname -a
Linux rose 2.4.18 #22 Mon Nov 20 13:34:04 EST 2006 i686 unknown

I can ping both eth0 and eth1 from another computer.
If I do "ifdown eth1", then eth0 can be pinged and only eth1 cannot be pinged - which is expected.
If both eth0 and eth1 are up (enabled), and if one ethernet cable is unplugged, both eth0 and eth1 cannot be pinged, why and how to fix it?
 
Old 02-23-2007, 05:35 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
I am guessing you set a gateway on both interfaces. Even though the same it is in conflict as to which is right. You should have one set with an IP, netmask, gateway and the other as IP, natmask, and no gateway.

Brian
 
Old 02-23-2007, 05:47 PM   #3
dxqcanada
Member
 
Registered: Sep 2006
Location: Canada
Distribution: Gentoo
Posts: 702

Rep: Reputation: 43
Hmm, could have something to do with ARP and MAC address's.

If you pull the plug on your interfaces does the interface go down ?

You may need an app to drop the interface if the physical link goes down ... such as ifplugd.

or look into using ifenslave to manage both interfaces ?
 
Old 02-23-2007, 06:12 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Are you using bonding or acting as a gateway between two physically disconnected network segments? Both NICs are on the same subnet.
 
Old 02-23-2007, 07:20 PM   #5
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
As far as the network going down on disconnect then it may depend on if NetwaorkManager is running. Also NetworkManager does not work well sometimes and in constiant confusion as to what is real and not. That has been my experience with it.

Brian
 
Old 02-26-2007, 10:34 AM   #6
powah
Member
 
Registered: Mar 2005
Distribution: FC, Gentoo
Posts: 276

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Brian1
I am guessing you set a gateway on both interfaces. Even though the same it is in conflict as to which is right. You should have one set with an IP, netmask, gateway and the other as IP, natmask, and no gateway.

Brian
Only eth0 has "GATEWAY" defined.
# cd /etc/sysconfig/network-scripts/
# cat ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=172.20.11.200
NETMASK=255.255.0.0
GATEWAY=172.20.11.10

# cat ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=static
IPADDR=172.20.11.199
NETMASK=255.255.0.0
 
Old 02-26-2007, 10:35 AM   #7
powah
Member
 
Registered: Mar 2005
Distribution: FC, Gentoo
Posts: 276

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by jschiwal
Are you using bonding or acting as a gateway between two physically disconnected network segments? Both NICs are on the same subnet.
How to find out whether I am using bonding or acting as a gateway between two physically disconnected network segments?
 
Old 02-26-2007, 10:43 AM   #8
powah
Member
 
Registered: Mar 2005
Distribution: FC, Gentoo
Posts: 276

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by dxqcanada
Hmm, could have something to do with ARP and MAC address's.

If you pull the plug on your interfaces does the interface go down ?

You may need an app to drop the interface if the physical link goes down ... such as ifplugd.

or look into using ifenslave to manage both interfaces ?
Connecting to my computer through the serial port, after pulling the ethernet cable from eth1, "ifconfig" show that both eth0 and eth1 are still up.
However, I cannot use ssh, i.e. no character can be typed, but ssh is not disconnected. If the ethernet cable is reinserted, then ssh can be used right away, no need to login again.

Last edited by powah; 02-26-2007 at 10:47 AM.
 
Old 02-26-2007, 11:11 AM   #9
fur
Member
 
Registered: Dec 2003
Distribution: Debian, FreeBSD
Posts: 310

Rep: Reputation: 35
You will have problems with both interfaces being on the same subnet with no additional configuration.

There are solutions for this, but it depends on what you are trying to accomplish by having them on the same subnet.
 
Old 02-26-2007, 01:41 PM   #10
powah
Member
 
Registered: Mar 2005
Distribution: FC, Gentoo
Posts: 276

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by fur
You will have problems with both interfaces being on the same subnet with no additional configuration.

There are solutions for this, but it depends on what you are trying to accomplish by having them on the same subnet.
We have no specific reason having them on the same subnet other than that it can be done. We want to allow both ethernet interface addresses to be any addresses (if possible).
What is the easiest solution?
 
Old 02-26-2007, 02:03 PM   #11
fur
Member
 
Registered: Dec 2003
Distribution: Debian, FreeBSD
Posts: 310

Rep: Reputation: 35
Easiest solution is to put them on separate subnets.


When multiple interfaces share the same subnet it is usually for a reason.

Like bridging the interfaces.

http://www.linux.org/docs/ldp/howto/...irewall-3.html



You can use iproute2, and configure the interfaces to send data out on the same interface it is received on.

http://www.policyrouting.org/iproute2-toc.html
http://www.linuxjournal.com/article/7291
 
Old 02-26-2007, 04:26 PM   #12
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
No idea as to what it will take to get it to work. Bonding is not going on here. If it was there would be a bond0 and the ifcfg-eth* would look different.

Brian
 
Old 04-10-2007, 02:54 PM   #13
powah
Member
 
Registered: Mar 2005
Distribution: FC, Gentoo
Posts: 276

Original Poster
Rep: Reputation: 30
RTNETLINK answers: Network is unreachable

Quote:
Originally Posted by fur
Easiest solution is to put them on separate subnets.


When multiple interfaces share the same subnet it is usually for a reason.

Like bridging the interfaces.

http://www.linux.org/docs/ldp/howto/...irewall-3.html



You can use iproute2, and configure the interfaces to send data out on the same interface it is received on.

http://www.policyrouting.org/iproute2-toc.html
http://www.linuxjournal.com/article/7291
After reading the linuxjournal article, I want to set up source based routing.
Why there is "Network is unreachable" error?

# ifconfig
eth0 Link encap:Ethernet HWaddr 00:00:50:1A:CE:8D
inet addr:172.20.11.242 Bcast:172.20.11.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1916 errors:0 dropped:0 overruns:0 frame:1
TX packets:381 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:220079 (214.9 Kb) TX bytes:52506 (51.2 Kb)
Interrupt:16 Base address:0x6000

eth1 Link encap:Ethernet HWaddr 00:00:50:1A:CE:8E
inet addr:172.20.11.199 Bcast:172.20.11.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1066 errors:0 dropped:0 overruns:0 frame:1
TX packets:504 errors:0 dropped:0 overruns:0 carrier:0
collisions:2 txqueuelen:100
RX bytes:117390 (114.6 Kb) TX bytes:66184 (64.6 Kb)
Interrupt:17 Base address:0x8000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

# ip route show
172.20.11.0/24 dev eth1 scope link
127.0.0.0/8 dev lo scope link
default via 172.20.11.10 dev eth0

# ip route add default via 172.20.11.10 dev eth0 tab 1
RTNETLINK answers: Network is unreachable

# ping 172.20.11.10
PING 172.20.11.10 (172.20.11.10) from 172.20.11.199 : 56(84) bytes of data.
64 bytes from 172.20.11.10: icmp_seq=0 ttl=255 time=1.005 msec
64 bytes from 172.20.11.10: icmp_seq=1 ttl=255 time=466 usec
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
eth0 and eth1 fail c0c0deuz Linux - Networking 3 06-18-2008 12:35 PM
Ping does not work between eth0 and eth1 Colin123 Linux - Networking 1 09-28-2005 01:10 PM
x86 board PCM 6892 with dual ethernet port.eth1 doesnt ping if eth0 cable removed rani_162 Linux - Newbie 0 07-23-2005 12:29 PM
Wireless network on eth1 diabled Ethernet eth0 and eth0 never comes back tadatoshi Linux - Wireless Networking 4 09-23-2004 05:57 PM
ethernet bridge (wlan0 eth1) - canīt ping magicien Linux - Wireless Networking 0 07-05-2004 03:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:45 AM.

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