LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 06-23-2008, 06:13 AM   #1
gettons1980
LQ Newbie
 
Registered: Jun 2008
Posts: 21

Rep: Reputation: 0
automatic switching route


Hi all,

I have a debian installed as firewall with 2 nic and 2 ISP ( and 2 modems of course ) :

10.0.0.0/24 LAN eth0
and
195.*.*.*/252 WAN eth1


Note * for privacy.

I am setting up a failover router so if the first route doesn't work ( power down, connectivity issues on first modem ) it could automatically switch on the other route.


All clients are behind eth0 and masquerading is set up as well on eth0 and eth1.
Actually the default route is 195.*.*.* via eth1.
The second route I want to add is 10.0.0.250 via eth0.

I set up like that:



195.*.*.0 0.0.0.0 255.255.255.192 U 0 0 0 eth1
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 195.*.*.* 0.0.0.0 UG 0 0 0 eth1
0.0.0.0 10.0.0.250 0.0.0.0 UG 0 0 0 eth0
As you can see the first default gw is my preferred route and my second one is 10.0.0.250



I echoed 5 as seconds for timeout on the first route.

echo 5 > /proc/sys/net/ipv4/route/gc_timeout
and
sysctl -p

If I try to power down my first gw ( my first route ) it doesn't switch automatically.
BUT if I remove the default gw via "route del" it works, maybe because it takes the second route in order, and not because it switches successfully.



Thanks in advance.



Tommaso

Last edited by gettons1980; 06-23-2008 at 06:34 AM.
 
Old 06-24-2008, 01:15 PM   #2
fatzeus
Member
 
Registered: Nov 2004
Location: Venice, Italy
Distribution: Gentoo
Posts: 44

Rep: Reputation: 15
Please post the output of the route command.
You should have the tow routes as DEFAULT to get it work.
 
  


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
Automatic switching of squid to a second internet link? dsids Linux - General 2 07-05-2007 12:55 AM
Default route took 20s to display with 'route' command Akhran Linux - Newbie 3 11-04-2006 04:59 AM
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 04:34 AM
Automatic switching between LAN and WLAN chrismic Linux - Wireless Networking 0 12-19-2004 07:38 PM
Working with 'route' and unwanted route entries pioniere Linux - Networking 6 02-05-2003 12:14 PM

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

All times are GMT -5. The time now is 10:41 PM.

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