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.
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'
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.
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.