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 have a 64 bit server with centos 64 bit installed. The server has two NICs and both NICs have different IP addresses and default gateways. Now problem I am facing is that whenever I ping or execute traceroute command then traffic always goes out from Eth1 default gateway.
I have two servers with the same issue and when I execute command "ip route list table main" it is showing two default GW entries of both the NICs and on other server it is only showing default GW entry of 2nd NICs.
Now I want to make configuration that Eth0 traffic goes out from its own default gateway and Eth1 traffic should use its default gateway to go out. Please assist me in this regard.
the standard definition of default gateway is to route all packets with no explicit routes through this gateway. therefore you cannot have more than 1 default gateway.
depending on what you need to accomplish, you can add specific static routes for other nics to specific networks/hosts, however.
Can you please give me a hint about how to define static routing for other NICs? I don't have any linux networking experience so any help is greatly be appreciated.
If you enter /sbin/route, or /sbin/ip route you should see two static routes already.
One to the 192.168.1.160/27 network. The other to the 193.168.1.128/27 network. The default gateway is for traffic not in these two networks.
If there is a 192.168.1.192/27 network, for example, you would want to determine which gateway device can connect to this network and add a route for it.
You should indicate which distro you have on your server. Sometimes you can add routes in the distro's interface configuration tool. For other distro's you would add an entry to a certain configuration file in /etc/ or /etc/sysconfig/network. For another distro you might add a command to a script in /etc/.
Also indicate what target network or host you are trying to reach.
Indicating what this server does and what the two gateways are for might help as well. We aren't sure what your concern is if you can reach the two subnets and other addresses.
I am running CentOS 5.5 64 bit. Actually my server as two IP addresses and gateways two. A very critical application is running on the server and I just want to make sure redundancy, for example one NICs or associated router port goes off then other NICs can pick the traffic and there will be no outage. But right now redundancy can't be achieved because server itself decides default gateway to send out traffic and if that NICs goes down then server will be down (it can't entertain any traffic). So basically I want to make configuration so that both NICs are working as active so that if anyone goes down then traffic can be diverted to other NIcs.
The server does not decide. The RULES of tcp/ip define how packets are routed. You either need to fix your subnets or use other means to route packets.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.