I'm not sure there's anything out there that could do this for you... However, you could, with a bit of scripting, a bit of Googling, cobble together a script that:
- Every 10 minutes, pings google with a timeout of 2 seconds and only from your "fixed" connection (not the 3G one) (use the
- If the ping succeeds, and you're on the fixed connection, do nothing.
- If you're on 3G and the ping over the fixed connection works, take the 3G adapter down.
- If it fails, bring up the 3G adaptor.
Here's my quick attempt:
if ping -q -c 1 -w 1 -I eth0 google.com > /dev/null ; then
echo "Connection is ok!"
if [ $CONNECTION -eq 0 ] ; then
# take the 3g connection down
ifconfig 3GADAPTERNAME down
echo "Connection is dead! Long live the connection!"
if [ $CONNECTION -eq 1 ] ; then
# turn the 3g connection on
ifconfig 3GADAPTERNAME up
3GADAPTERNAME with your adapter's name. switch out
eth0 if your main connection is different. Make sure it is set to automatically connect (so when it's allowed to, it does). The script will need to run as root.