FAILOVER - 2 Links - 1 Server (Redundant Internet)
After reading lots of forums I decided to create my own script to do that.
It has done the job for some hour, but dont know why after 5, 6 or a bit more hours the internet simply stops
The ideia is:
one via DHCP(Cable modem) (eth2) (Dynamic IP)
one via PPPOE(Fiber modem) (eth1/ppp0) (Static IP)
When linux boots up automatically starts with eth2 working as I do not run the command: pon dsl-provider
Alright, so far, the fiber modem keeps in standby.
My script runs ping command and when it returns (0) it means the internet is OK, it sleeps for 25 seconds and then tests again.
Any other result the script runs the following:
which means the DHCP Cable Modem (Dynamic IP) is disable and the Fiber modem (Static IP) is enable
After that the script loops itself and runs ping tests again.
Once it gets a result other than 0, it runs:
Which means, disconnect PPPOE and enable eth2 through DHCP
I will print my script below
Does any one see any problem with it?