How to adjust routing of external packets to one NIC instead of another NIC?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
How to adjust routing of external packets to one NIC instead of another NIC?
Hello,
I'm running Ubuntu 9.10 server at home on VMware Workstation 7. I have two NIC's configured, one NIC is setup to have a direct connection to the network "Bridged", another NIC is setup to have a private network connection on VMnet1.
So when I try to access the Internet, I can not go out on the NIC 1. If I try to ping google.com I get a return from 10.1.1.1 "no reply". But I know that NIC 2 is working, because I can ping 192.168.1.160 from the workstation I'm running on.
So I think that my routing is sending traffic out to the wrong NIC, but not sure if this is a metric in the iptables or another place?
The reason for two NICS is to simulate a DMZ where the server will be running Squid, to test proxy from another workstation on the 10.1.1.X subnet.
hi2arun is quite right - a route -n will show your default gateway and hence the default route for getting out.
What strikes me as strange is that your NIC 1 has an IP of 192.168.1.160 - which from my networking knowledge should be unroutable and hence unable to get to the internet (unless its part of a private network with another device that CAN connect to the internet and your machine is sharing the network on that box).
Lastly, you should check what DNS you have configured (more /etc/resolv.conf) - since this will be critical for doing something like # ping www.google.com
hi2arun is quite right - a route -n will show your default gateway and hence the default route for getting out.
What strikes me as strange is that your NIC 1 has an IP of 192.168.1.160 - which from my networking knowledge should be unroutable and hence unable to get to the internet (unless its part of a private network with another device that CAN connect to the internet and your machine is sharing the network on that box).
Lastly, you should check what DNS you have configured (more /etc/resolv.conf) - since this will be critical for doing something like # ping www.google.com
Sorry I should have pointed that out. My VMware Workstation is running on my desktop machine which is on my home network. The 192.168.1.X subnet is the home lan but has access to the Internet. It's not perfect but it's emulating what it would be like on a DMZ where the home network is the Internet.
I'm not sure it's a DNS problem, I have my DNS pointed to OpenDNS which is also used on my network. The problem is as soon as I up the second NIC, I can ping to the interfaces, but nothing can get out. As soon as I down the NIC, everything works.
I built the same environment at work, this time planning to deploy it with two subnets, similar to the same thing but instead of the DMZ I'm going to place it on the internal network but the second NIC will just have an allow rule for Internet access.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.