LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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-08-2004, 08:33 PM   #1
codegomer
LQ Newbie
 
Registered: Aug 2003
Location: Arizona, USA
Distribution: Red Hat 9, Mandrake 9.2, SuSE 8.1
Posts: 29

Rep: Reputation: 15
Question 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 192.168.1.1 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?

codegomer
 
Old 02-08-2004, 11:10 PM   #2
ashamril
Member
 
Registered: Jan 2003
Location: cyberjaya
Distribution: rh mdk deb fed suse
Posts: 99

Rep: Reputation: 15
i never use SuSE b4, but try this

in /etc/sysconfig/network

NETWORKING=yes
FORWARD_IPV4=yes
HOSTNAME=hostname.domain.com
GATEWAY=192.168.1.1
GATEWAYDEV=eth1
 
Old 02-10-2004, 08:00 PM   #3
codegomer
LQ Newbie
 
Registered: Aug 2003
Location: Arizona, USA
Distribution: Red Hat 9, Mandrake 9.2, SuSE 8.1
Posts: 29

Original Poster
Rep: Reputation: 15
ashamril,

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.

codegomer
 
Old 02-10-2004, 09:24 PM   #4
charon79m
Member
 
Registered: Oct 2003
Distribution: Just about anything... so long as it is Debain based.
Posts: 297

Rep: Reputation: 30
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: 66.218.71.198 (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.)
 
Old 02-10-2004, 09:49 PM   #5
Half_Elf
Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 45
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
 
Old 02-11-2004, 10:17 PM   #6
codegomer
LQ Newbie
 
Registered: Aug 2003
Location: Arizona, USA
Distribution: Red Hat 9, Mandrake 9.2, SuSE 8.1
Posts: 29

Original Poster
Rep: Reputation: 15
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
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 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
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1

Perhaps Half_Elf or anothe guru can assist.

codegomer
 
Old 02-11-2004, 10:32 PM   #7
andzerger
Member
 
Registered: Feb 2004
Location: denver
Distribution: slackware && freeBSD && rh9
Posts: 92

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

peac,e
andrew

Last edited by andzerger; 02-11-2004 at 10:46 PM.
 
Old 02-12-2004, 06:23 AM   #8
Half_Elf
Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 45
ok, so this :
Code:
0.0.0.0 192.168.1.1 0.0.0.0 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 :
Code:
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 :
Code:
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 (192.168.1.1).
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
 
Old 02-12-2004, 06:21 PM   #9
codegomer
LQ Newbie
 
Registered: Aug 2003
Location: Arizona, USA
Distribution: Red Hat 9, Mandrake 9.2, SuSE 8.1
Posts: 29

Original Poster
Rep: Reputation: 15
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 192.168.1.0 dev eth1
and got another error SIOCADDRT: Network is unreachable

Rolled the dice again
route add default gw 192.168.1.1 dev eth1
and...got 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.

codegomer
 
Old 02-12-2004, 10:51 PM   #10
andzerger
Member
 
Registered: Feb 2004
Location: denver
Distribution: slackware && freeBSD && rh9
Posts: 92

Rep: Reputation: 15
hmmmmmmmmm

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
0.0.0.0 [eth0 ip] 0.0.0.0 eth1

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

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

the 0.0.0.0 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 192.168.0.0 gw 192.168.2.1 255.255.255.0 eth0"
didnt, neither did
"route add 192.168.0.0 gw 192.168.2.1/255.255.255.0 eth0"
or
"route add 192.168.0.0 gw 192.168.2.1 nm 255.255.255.0 eth0"
or any of the other permutations i pulled out of route --help or man route

hmmmmmmm

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 169.154.0.0 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

peace,andrew
 
Old 02-13-2004, 12:39 AM   #11
andzerger
Member
 
Registered: Feb 2004
Location: denver
Distribution: slackware && freeBSD && rh9
Posts: 92

Rep: Reputation: 15
status:

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 gamercrackheadcafe.com
(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>


woohoo!!!

pax, gracias,
andrew
 
Old 02-13-2004, 12:28 PM   #12
Half_Elf
Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 45
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 :
INTERNET(Whatever)
|
|
(eth0):1.1.1.1
LIINUXROUTER
(eth1)192.168.0.1
|
|
|
(192.168.0.2)
MACHINE1(10.0.0.1)----------------->MACHINE2(10.0.0.2)

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 "192.168.0.0", it takes a look at ROUTE and send it to trought eth1. Easy!

But what if the ROUTER need to send a packet to 10.0.0.2? Since it has no idea where 10.0.0.2 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 "10.0.0.0" network to eth1. This will tell ROUTER's kernel to send any packet wanting to reach "10.0.0.0" trought eth1. This can be done with a command like "route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.0.0.2" dev eth1 (send every trafic trying to reach 10.0.0.0 with mask 255.255.255.0 to 10.0.0.2 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 0.0.0.0... that mean everything, it is not a wildcard, it just mean "any" so a route like "route add net 0.0.0.0 netmask 0.0.0.0 gw 1.1.1.1 dev eth0" will send ANY undetermined trafic to 1.1.1.1 trought eth0

I hope all this is a little more clear now
 
Old 04-20-2004, 10:04 PM   #13
codegomer
LQ Newbie
 
Registered: Aug 2003
Location: Arizona, USA
Distribution: Red Hat 9, Mandrake 9.2, SuSE 8.1
Posts: 29

Original Poster
Rep: Reputation: 15
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.

codegomer
 
  


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
Mandrake is switching the eth1 and eth0 interfaces... how can I switch them back? LaptopLinux Mandriva 3 03-28-2005 09:23 PM
Suse 9.2 - How is determined which network cards becomes eth0 and which eth1 doublemax Linux - Networking 5 02-04-2005 10:25 AM
SLow Speeds ETH1 > ETH0 > Local network - Help!!! Tekel Linux - Networking 2 09-29-2004 05:12 PM
Wireless network on eth1 diabled Ethernet eth0 and eth0 never comes back tadatoshi Linux - Wireless Networking 4 09-23-2004 05:57 PM
multiple network interfaces -> getting card vendor for eth0... linen0ise Slackware 9 12-07-2003 08:16 PM


All times are GMT -5. The time now is 03:30 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration