Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm using RH8.0, have recently installed a second network card to my desktop. The network works great except that when the card connected to my local network is turned on i can't make internet work on the server, it's like the first network card gets screwed up.
eth0:192.168.0.100->internet
eth1:192.168.1.1->gateway to local network
Do you have any idea?
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
You probably defined a default route in the setup file for the second NIC, and if you did, that's wrong. You can only have one default route, and it should be pointing to the first NIC (i.e. the one connected to the Internet). The value of the default route, or default gateway should be the IP that your ISP gave you for their gateway.
Also, make sure that the subnet mask for each NIC is 255.255.255.0 (i.e. /24), because if you define the netmask too big it will overlap the other IP on your box.
well i actually did that but it doesn't solve anything. So you're saying that both NIC should have the save default gateway? The thing is that if i boot the first NIC i get internet, then i boot the second NIC the network works but the internet doesn't. To get it back i have to deactivate both cards and reactivate the first one. Does that make sense to you?
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
It's exactly like I told you: You may only have one default gateway, and it must point to the Internet. Don't set a default gateway for the second NIC at all. I don't know if you're using some graphical configuration tool, or directly writing a config file, but you need to not specify a gateway for the 2nd NIC.
Allowing LAN clients to access the Internet through this box is an entirely different matter. You need to turn on IP forwarding and setup a firewall with NAT. There are plenty of descriptions on this board, the Security forum, and many tutorials that are indexed by Google that can tell you how to do this. www.netfilter.org would be a good first step.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.