LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 10-18-2010, 04:23 AM   #1
zaeem
Member
 
Registered: Jan 2010
Posts: 125

Rep: Reputation: 15
default gateway and traffic out issue


Dear All,

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.
 
Old 10-18-2010, 04:45 AM   #2
hornet1
LQ Newbie
 
Registered: May 2006
Posts: 9

Rep: Reputation: 0
can we have details on IPs and subnet used ...
 
Old 10-18-2010, 08:34 AM   #3
zaeem
Member
 
Registered: Jan 2010
Posts: 125

Original Poster
Rep: Reputation: 15
Eth2:
IP Address: 192.168.1.183
Mask: 255.255.255.224
default gateway: 192.168.1.161

Eth3
IP Address: 192.168.1.151
Mask: 255.255.255.224
default gateway: 192.168.1.129
 
Old 10-18-2010, 10:36 AM   #4
johnshen64
LQ Newbie
 
Registered: Jun 2010
Posts: 29

Rep: Reputation: 5
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.
 
1 members found this post helpful.
Old 10-19-2010, 03:05 AM   #5
hornet1
LQ Newbie
 
Registered: May 2006
Posts: 9

Rep: Reputation: 0
eth2 , eth3 ???!!!! <--- where is eth0 and eth1 !!!!

using /31 networks is really complex.

try using 255.255.255.252
 
Old 10-19-2010, 03:10 AM   #6
zaeem
Member
 
Registered: Jan 2010
Posts: 125

Original Poster
Rep: Reputation: 15
Dear johnshen64,

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.
 
Old 10-19-2010, 03:10 AM   #7
zaeem
Member
 
Registered: Jan 2010
Posts: 125

Original Poster
Rep: Reputation: 15
Dear hornet1,

That is not under my control
 
Old 10-19-2010, 04:14 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 10-19-2010, 09:39 AM   #9
zaeem
Member
 
Registered: Jan 2010
Posts: 125

Original Poster
Rep: Reputation: 15
Dear jschiwal,

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.

Thanks for your support. Much appreciated.
 
Old 10-19-2010, 11:09 PM   #10
johnshen64
LQ Newbie
 
Registered: Jun 2010
Posts: 29

Rep: Reputation: 5
Hmm, what you want is nic bonding then.

man ifenslave
 
Old 10-20-2010, 03:19 PM   #11
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
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.
 
Old 10-23-2010, 06:10 AM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
http://lartc.org/lartc.html

Look at Section 4.2.1 Split Access, which uses two interfaces & two default gateways.

Look at the files supplied by the iproute2 package.

Look into using bonding as well. It would add redundancy for your interfaces, and switches as well.

Another resource:
http://linux-ip.net/linux-ip.pdf

And a similar example routing to alternate wan connections for redundancy:
http://nerdboys.com/2006/05/05/conni...-and-iproute2/

Last edited by jschiwal; 10-23-2010 at 06:27 AM.
 
  


Reply



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
normal default gateway reapperas with openvpn redirect-gateway jonnytabpni Linux - Networking 2 04-23-2009 02:11 PM
Linux gateway traffic monitoring saifurab Linux - Server 3 05-23-2007 12:06 AM
installing snort on high traffic gateway bog it down? kcorupe Linux - Server 2 04-06-2007 08:02 AM
route traffic onto the net from a lan gateway ulto Linux - Networking 1 04-13-2004 08:54 PM
Wireless traffic stomps isdn traffic on gateway machine Radix999 Linux - Wireless Networking 0 11-14-2003 12:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:20 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration