LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 09-20-2011, 02:31 AM   #1
felipe1982
LQ Newbie
 
Registered: Dec 2007
Posts: 23

Rep: Reputation: 0
Default Route Failover


I have a server that uses default gw .253 for ISP "A"
My network has a backup internet connection (ISP "B") on gateway .254

I want all traffic to enter/exit via .253 when it is operational, and use .254 when first one is not working. It should switch back automatically to .253 when it is operational once again.

Setting .254 with 'metric > 0' does not seem to function correctly. The packets keep hitting .253 instead.

To simulate ISP "A" going down, I blocked MAC address of .253 gateway using 'iptables -A INPUT -m --mac-source AA:BB:CC:DD:EE:FF -j DROP'

These are my sysctl settings:
Code:
/proc/sys/net/ipv4/route/error_burst                              = 5000
/proc/sys/net/ipv4/route/error_cost                               = 1000
/proc/sys/net/ipv4/route/flush                                    =
/proc/sys/net/ipv4/route/gc_elasticity                            = 8
/proc/sys/net/ipv4/route/gc_interval                              = 60
/proc/sys/net/ipv4/route/gc_min_interval                          = 0
/proc/sys/net/ipv4/route/gc_min_interval_ms                       = 500
/proc/sys/net/ipv4/route/gc_thresh                                = 32768
/proc/sys/net/ipv4/route/gc_timeout                               = 10 #default 300
/proc/sys/net/ipv4/route/max_delay                                = 10
/proc/sys/net/ipv4/route/max_size                                 = 524288
/proc/sys/net/ipv4/route/min_adv_mss                              = 256
/proc/sys/net/ipv4/route/min_delay                                = 2
/proc/sys/net/ipv4/route/min_pmtu                                 = 552
/proc/sys/net/ipv4/route/mtu_expires                              = 600
/proc/sys/net/ipv4/route/redirect_load                            = 20
/proc/sys/net/ipv4/route/redirect_number                          = 9
/proc/sys/net/ipv4/route/redirect_silence                         = 20480
/proc/sys/net/ipv4/route/rt_cache_rebuild_count                   = 4
/proc/sys/net/ipv4/route/secret_interval                          = 600
 
Old 10-03-2011, 09:40 PM   #2
felipe1982
LQ Newbie
 
Registered: Dec 2007
Posts: 23

Original Poster
Rep: Reputation: 0
3 week bump
 
Old 10-08-2011, 04:49 PM   #3
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 876

Rep: Reputation: 184Reputation: 184
VRRP on the router? Thats what its for, why reinvent the wheel?
 
Old 10-09-2011, 03:10 PM   #4
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by baldy3105 View Post
VRRP on the router? Thats what its for, why reinvent the wheel?
Why use something that's overkill? And it may not even be implemented on the OP's router (for example those generic DSL/Cable routers). There's nothing in the OP's requirement that needs anything more out of the router than detecting if the router is responding.

The specific solution depends on some things the OP did not say. In particular, is the fallback router/ISP on a different network subnet? If it is the same ISP with 2 separate links, they could do that (but some ISPs are too clueless to know how). If it is different ISPs, then it is almost certain it cannot be done without doing automated static renumbering, or dual numbering. The optimal would be with BGP, but a business with an AS that can do BGP wouldn't be asking what the OP asked.
 
Old 10-09-2011, 04:34 PM   #5
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 876

Rep: Reputation: 184Reputation: 184
He just told you that he's got two gateways .253 and .254. And how exactly is VRRP overkill? What he's talking about is no more or no less than the very job it was designed for. It's a simple standard method of next-hop redundancy. And if VRRP is overkill , BGP? WTF?
 
Old 10-09-2011, 07:30 PM   #6
felipe1982
LQ Newbie
 
Registered: Dec 2007
Posts: 23

Original Poster
Rep: Reputation: 0
Thanks for your replies. I looked into VRRP for my router (SnapGear) and it doesn't seem like a supported feature. Can this or something similar, be implemented on the linux host, instead of on the router? Setting the routes manually, and specifying a higher, and lower, metric for the routes doesn't do or change anything when the primary route goes down. Packets just fail to send, and this can continue for hours.

We have two routers inside the same subnet. 192.168.0.0/24 subnet with 192.168.0.253 for ISP A and 192.168.0.254 for ISP B. If one gateway (link) goes down, I'd like the host to use the other. When the downed route returns, host should switch back. BGP might be overkill, and we don't have big bad C*isco routers.
 
Old 10-10-2011, 02:30 PM   #7
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 876

Rep: Reputation: 184Reputation: 184
They do support RIP. I would use RIP2 between the snapgears and the linux host so you can learn about the default routes they have rather than statically configuring them. When the primary link goes down the RIP learned route should be withdrawn leaving you with the secondary one remaining.
 
  


Reply

Tags
default route, failover, gateway


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Reversing Default gateway failover slacky Linux - Networking 2 11-11-2010 02:05 PM
non-default route to static host through gateway for ppp failover testing jrscandora Linux - Networking 3 04-21-2009 02:20 AM
Quagga default route not showing in kernel default route (netstat -nr) Valkyr1e Linux - Networking 3 08-03-2008 09:20 PM
iproute2 (ip route), pppoe and default route lorddoskias Linux - Networking 0 05-09-2007 11:04 AM
Default route took 20s to display with 'route' command Akhran Linux - Newbie 3 11-04-2006 04:59 AM


All times are GMT -5. The time now is 04:44 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration