We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Howto failover to alternate default gateway on pppoe failure

Medium Priority
1,407 Views
Last Modified: 2012-06-22
Hi,

CentOS server has 2 ethernet ports(eth0 and eth1).
eth0: connected to switch and then to internet
eth1:connected to adsl modem and running rp pppoe through it and creates ppp0

I want default gateway to be through ppp0  when ppp0 is up (this happens - as the setting for gateway in rp pppoe is enabled).
However when ppp0 goes down then default gateway to revert to eth0. This does not happen.

Please help.
Comment
Watch Question

Top Expert 2009

Commented:
have a look this one

http://www.linux.com/feature/113988

it should help you

look at enabling failover routing

Author

Commented:
Tx. However.
My setup is different.
Once route is vial pppoe.

Also see: Which indicates that this will do load balancing and not failover.

 Re:true failover?
Posted by: Anonymous Coward on April 17, 2005 01:16 AM
I'm afraid that's not how it works. In the setup you describe, until the Linux box detects one of these Ethernet interfaces are down, at the Ethernet level, it will continue to send packets out that interface. The Linux box you describe has ethernet connections to routers "upstream" of it. Typically that router is customer premise equipment provided by the ISP. You have an Ethernet connection to it. It then has a connection to the ISP, via DSL, another Ethernet interface, etc. If if looses its link layer connection (DSL, Ethernet, wireless, etc.) on its WAN, you are still going to have an Ethernet connection between the Linux box and the CPE. The Linux box does not know there is a problem and continues to route out that inteface, as the previous poster said it would.

The previous poster also noticed something about your setup but only impied it, when he said you would lose half your packets. The setup you describe will not send traffic out one connection, and fail over to the second. All have you done is create to equal weight default routes. The Linux box will route out both interfaces, not one or the other, unless it detects one of the Ethernet inerfaces down, as discussed above.

You've started on the right track, but you have a a ways to go.
Top Expert 2009
Commented:

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
I've been looking at it...

Commented:
Hello I hope that this thread is alive:

Here is my solution about the problem:

1. Configure pppoe connection
1.1. Do not UP it on boot

2. On boot load script with following settings
2.1. Configure eth0 and eth1 IP addresses and MAC addresses
2.2. Start pppoe connection
2.3. Firewall connection as you wish
2.4. Start monitor script to switch between internet lines if one of them fail

3. Monitor script:
3.1. Each X seconds check with ping -I interface IP if connection on this interface is alive
3.2. If connection is not alive then change default route with:
ip route change default via ALIVEGATEWWAYIP dev ALIVEGATEWAYINTERFACE

thats it.

I have server that work this way perfectly and can help with setup and monitor script instalation

Author

Commented:
Tx. This looks usefull. Would appreciate help with the script.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.