-   Linux - Networking (
-   -   eth0 and eth1 with 2 network interfaces (

codegomer 02-08-2004 08:33 PM

eth0 and eth1 with 2 network interfaces
I've got a Dell Inspiron 4000 in a docking station with a network connection for use at home. The computer also has an internal network card for connecting to a network when I travel. I'm running SuSE 8.1 Professional

My problem is that I cannot access the Internet when the laptop is docked in the docking station. I do have network access as I can browse my router's settings with so I know the network interface is working when docked.

I have a partial resolution in that I can browse the Internet when I plug a cat-5 cable into the internal NIC plug so that the internal NIC is connected at the same time as the docking station NIC.

The Internal NIC is identified in Control Center | Network Interfaces as eth0. The docking station NIC is identified in Control Center | Network Interfaces as eth1.

Given that I can plug a cat-5 cable into eth0 and I can browse the Internet, I'm leaning toward some setting that prioritizes eth0 over eth1 for Internet connection. Remembering from above eth1 (docking station NIC) does work by letting me call my router's setup web page.

SuSE 8.1 doesn't seem to want to browse the Internet through eth1 even though eth1 is connected to my network. I can't browse the Internet until I connect eth0 with a cat-5 cable.

Can anyone offer guidance?


ashamril 02-08-2004 11:10 PM

i never use SuSE b4, but try this

in /etc/sysconfig/network


codegomer 02-10-2004 08:00 PM


Thanks for the reply. SuSE doesn't have a file in /etc/sysconfig/network that I can modify per your instructions. SuSE must be a little different.

I found several articles on the internet that offer similar guidance to your advice. In fact, I found plenty of materials that show Linux having difficulty with two or more NIC's. I'm sure the old Linux veterans cans solve the problem, but I'm relatively new to Linux.


charon79m 02-10-2004 09:24 PM

Start with the basics....
You said you are able to brouse your router settings... and I assume you do that by typing in an IP address into your browser's address line.

Are you able to ping a website? If not, what error do you get?

Can you ping this IP: (It's one of Yahoo's)

What is your internal IP addressing scheme, and is it being handed out via DHCP by your router?

When you dock this machine, is it already turned on?

Can you post the output of ifconfig , route , cat /etc/resolv.conf ?

Lastly, why is it an issue.... why not just use the impedded NIC? I mean, why fix something that isn't a real issue? (Hey, I'm lazy... I'll admit it.)

Half_Elf 02-10-2004 09:49 PM

this is obliviously a route problem
when eth1 is connected, type "route -n" and check if the default (aka flag UGH) route still related to eth0. If it is the case, you might want to delete this route (route del default) and add a new one (route add gw default dev eth1).

This won't be done automatically with default configuration, you'll need to mess up with your startup script if you want to see it goes auto. (Create a script looking at avialable interface and adding the correct route).
Btw, I'm not sure of my syntax there, take a look at "man route" before breaking something ;)

codegomer 02-11-2004 10:17 PM

We're getting somewhere!

Easy answer to charon79m's comments: I'm new but I'm also a geek. I've got a second Linux box in addition to the laptop. Both have Samba running. Shortly after posting this thread, I learned how to browse shared directories between the two Linux boxes with Konqueror.

With the laptop docked - I can browse to the shared folders on the desktop. I can browse files on the docked laptop from the desktop. I've got connectivity in my network so that means eth1 (NIC in the docking station) is hooked up and works.

I dock the laptop then boot up. I could use the internal NIC but that would mean an unnecessary cat-5 cable that is redundant to the cat-5 plugged into the docking station. Neatness counts in my office. But seriously, I could take the easy way out but I wouldn't improve my Linux understanding and skills.

Half_Elf most likely has the problem identified and I'm still too new to see the solution. I've done the man route and the route -n maneuvers. From route -n I have an interesting observation that Half_Elf could probably review and provide more guidance.

route -n (from the desktop that works just fine - has one NIC)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use IFace U 0 0 0 eth0 UG 0 0 0 eth0

route -n (from the laptop with two NICs, no cat-5 connected to internal NIC, connected to
network verified by browsing files on another Linux box via NIC in docking station)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use IFace U 0 0 0 eth1

Perhaps Half_Elf or anothe guru can assist.


andzerger 02-11-2004 10:32 PM

sorta the same problem
i thought this mightave helped with the problem im having (see post above)
but it didnt, so i wanted to delete this message, but i couldnt, darn. someone spam me i deserve it.


Half_Elf 02-12-2004 06:23 AM

ok, so this :
Code: UG 0 0 0 eth0
mean that your kernel will send to eth0 any trafic or communication attempt that doesn't match other ROUTE ways to eth0. This is called the "default route"
That probably not what you want When eth1 is connected.

To delete this default Route, just type the following :

route del default
Now you won't have any default route so trafic trying to reach internet will be dumped. Just add a new default route for eth1 typing the following :

route add default gw 192.168.X.X dev eth1
Note that 192.168.X.X is the ip adress of the router on the other side, mean the machine where your network cable is pluged in. If you dunno the adress, .1 is probably the good choice (
If this ip fail, you could try without any ip (just remove the "gw 192.168.X.X" part but I dunno how good it will does.

Of course, if you unplug eth1 and plug back eth0, you'll have to change route again... and in any case a reboot will cancel change (if you mess it up badly lol).

Give a try and gimme news 'bout it :)

codegomer 02-12-2004 06:21 PM

Half_Elf is the Guru. Problem solved!

The problem is solved but I don't know fully how. I received an error when I entered "route del default"

The error was: SIOCDELRT: No such process

So...I rolled the dice.

I entered
route add default gw dev eth1
and got another error SIOCADDRT: Network is unreachable

Rolled the dice again
route add default gw dev eth1 the command prompt - no error.

Launched a browser and started surfing with NIC eth1 from the docking station. I'm happy it works. Give me a few more weeks and I'll understand why.


andzerger 02-12-2004 10:51 PM

I just tried it, i didnt get to spend a few minutes on it though because were still open for buisness and when my ping google failed i plugged the cables back into the belkin before my bosses online card game noticed it was timed out, im pretty sure i did it right though.

im pretty sure that im learning something, please correct me

"route add default gw [IP of eth0] eth1" routes all network traffic from eth1 to eth0, correct? it generates the output (on "route") of [eth0 ip] eth1

"route add gw eth0" would route traffic from the internet through eth1 to my local network? then id get: eth0

im just making assumptions here, cause i still cant get it to work, so i must not understand it right ..

the is a string of wildcards for networking? im picking up on that somehow, i dont know if its accurate or not

how do i define a netmask in the route string?
"route add gw eth0"
didnt, neither did
"route add gw eth0"
"route add gw nm eth0"
or any of the other permutations i pulled out of route --help or man route


i look forward to some more advice, yeah, and the same question as codegomer too, why cant i delete routes that dont have any apparant porpuse, like the seemingly obligatory route .. i have no idea where that comes from and to what it refers..
sometimes i wonder about people who publish a free operating system ;) yeah on that note, how come sunrpc has a port open on whatever iteration of RH9 ive got running?

blahblah thanks for your interest! helpful people rule


andzerger 02-13-2004 12:39 AM


i cannot describe the elation i feel as i come to the realization that the only thing ive been beating my head against this whole time is

my own firewall
the whole reason i was doing this

finnally i conconted another test: ping my isps gateway from a computer beyond the switch..
holy cow it works.
now i need to fix my nameserver so that the webssurfers here at
(RT technobabbleon 2004) can surf to google without knowing the IP address.. or maybe it would be easier to configure all those computers to use the IPS of the nameserver this one does ... any thoughts.. plz follow me over to the DNS forum <g>


pax, gracias,

Half_Elf 02-13-2004 12:28 PM

LOL andzerger you are really funny (and a bit lost ;) )
ok, so ROUTE is not to forward trafic trought several interface... the only purpose is to tell the kernel wich interface to choose to send trafic when more then one is available (on a machine with only 1 ip, you'll probably never need to change the route).

Let's do some drawing :

Route are only to tell the kernel what network can be reach trought a certain interface. Most of time, every interface has a route leading to his network plus a default route (packet that don't match are send this ways)
Ok, so if the ROUTER have to send a packet to the network "", it takes a look at ROUTE and send it to trought eth1. Easy!

But what if the ROUTER need to send a packet to Since it has no idea where can be, it will send it to the default route. If the default route is eth0 and leading to internet, we are in trouble, this packet will never reach anything at all :)
So the network admin of ROUTER have 2 choices :
1-Change the default route to eth1 (dumb, since we probably want most trafic that want to reach an unknow destination to be send trought eth0 to reach internet).
2-Add a route to ROUTER that lead any packet that want to reach "" network to eth1. This will tell ROUTER's kernel to send any packet wanting to reach "" trought eth1. This can be done with a command like "route add -net netmask gw" dev eth1 (send every trafic trying to reach with mask to trought eth1 interface).

About codegomer problem. Since his default route was on eth0 (or wasn't having default route?) his kernel was sending most trafic to eth0 since it wasn't able to determine a correct ways (and since eth0 wasn't pluged to internet, it was a total failure).

Oh and about that mean everything, it is not a wildcard, it just mean "any" so a route like "route add net netmask gw dev eth0" will send ANY undetermined trafic to trought eth0

I hope all this is a little more clear now :D

codegomer 04-20-2004 10:04 PM

Just an update for anyone reading. I've installed Red Hat 9 on the laptop and the problems disappeared. I went to RH because I couldn't find SuSE ISO files for their latest distribution. RH 9 was easy to find and I may be switching my brand loyalty to RH away from SuSE.

Lesson learned. Get the latest software to solve a lot of your problems. There are plenty of outstanding distributions out there for free. It's a good learning experience.


All times are GMT -5. The time now is 10:51 AM.