• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1184
  • Last Modified:

Howto failover to alternate default gateway on pppoe failure


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.
  • 3
  • 2
1 Solution
have a look this one


it should help you

look at enabling failover routing
shaunwinginAuthor 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.

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

shaunwinginAuthor Commented:
I've been looking at it...
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:

thats it.

I have server that work this way perfectly and can help with setup and monitor script instalation
shaunwinginAuthor Commented:
Tx. This looks usefull. Would appreciate help with the script.

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now