Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.
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.
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
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
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 (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).
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"
"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
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 22.214.171.124 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
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>
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 "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 126.96.36.199 dev eth0" will send ANY undetermined trafic to 188.8.131.52 trought eth0
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.