LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-30-2008, 12:05 AM   #1
kentcui
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Rep: Reputation: 0
I want to configure multi defaultway in the linux kernel 2.6.16,is it OK?


So I can type the command in the CLI ;

route add default gw1
route add default gw2

and also I can see the routing table of multi gateway
with the command route -an;

but I want to make it sure that this kernel can support
the multi default gateway settings;

and the problem is how can I edit the /etc/sysconfig/network file
to make the multi default gateway settings will work after reboot
the system?

Thanks for your replies,and advices.
 
Old 07-30-2008, 12:17 AM   #2
uncle_philip
Member
 
Registered: Apr 2008
Location: sydney
Distribution: centos5.2
Posts: 50

Rep: Reputation: 15
sorry, if I'm wrong.
your computer can have multi-network cards to act as the gatway for different subnets. But your computer can only have single default gateway. Eg., when you type "yahoo.com" the computer will know how to get there, otherwise, the computer doesn't know where to go, from gw1 or gw2.
 
Old 07-30-2008, 12:23 AM   #3
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Why are you trying to do this - is it because you think you need to (you don't) or are you trying to set up load sharing or something else?

Last edited by billymayday; 07-30-2008 at 12:25 AM.
 
Old 07-30-2008, 12:40 AM   #4
kentcui
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Original Poster
Rep: Reputation: 0
yeah, because I will have 2 ISP leasedlines,

and I want to configure the current linux gateway server with multi default gateways,

So It can running as a loardbalancing devices,,,I think,

and I tried in test environment,,the result is if just use the

route add default gw1
route add default gw2

the traffic can only go throuh the first gateway,,,
 
Old 07-30-2008, 12:42 AM   #5
kentcui
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Original Poster
Rep: Reputation: 0
The second question is how to balance traffic going out over the twoproviders.
This is actually not hard if you already have set up split accessas above.
Instead of choosing one of the two providers as your default route, you nowset up the default route to be a multipath route. In the default kernel thiswill balance routes over the two providers.
It is done as follows (once morebuilding on the example in the section on split-access):

ip route add default scope global nexthop via $P1 dev $IF1 weight 1 \
nexthop via $P2 dev $IF2 weight 1

This will balance the routes over both providers.
The weight parameters canbe tweaked to favor one provider over the other.
Note that balancing will not be perfect, as it is route based, and routes are cached.
This means that routes to often-used sites will always be over the same provider.
Furthermore, if you really want to do this, you probably also want to look at Julian Anastasov's patches at http://www.ssi.bg/~ja/#routes , Julian's route patch page. They will make things nicer to work with

I find a webpage with the words above...
Is it will be OK....
 
Old 07-30-2008, 09:23 PM   #6
kentcui
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Original Poster
Rep: Reputation: 0
more informations about the multi default gateways;

Kernel Configuration

Linux kernels 2.2 and above support advanced routing techniques that are required to provide load balancing and multiple default routes on a Linux host. The following kernel networking options must be compiled into the kernel to support multiple connections to the Internet:


CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_MULTIPATH=y

To access the advanced routing features of the new kernel, the iproute toolset must be installed. (It is now distributed with Red Hat 7.1) The iproute toolset is available from:

ftp://ftp.inr.ac.ru/ip-routing/
 
  


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
ICP-MULTI Linux driver for kernel 2.6. or later brownflamigo1 Programming 2 06-10-2007 05:12 PM
LXer: Linux powers multi-protocol, multi-frequency wireless switch LXer Syndicated Linux News 0 11-03-2006 09:54 AM
LXer: Linux powers multi-protocol, multi-frequency WAP LXer Syndicated Linux News 0 11-03-2006 09:33 AM
how to configure multi-nic routing meping Linux - Networking 20 10-24-2005 01:29 PM
Building multi-kernel compatible (Linux RHAS) apps ? cbrockwell Linux - Newbie 0 02-25-2005 11:52 AM

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

All times are GMT -5. The time now is 11:38 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