Automatic failover of two internet connections Mac OS X

3

Is there any way to set up an automatic failover for internet connections within Mac OSX? Basically the main connection would be ethernet or wifi and if the main connection goes does, it would switch to a 3G mobile phone or another Wifi connection.

Ruben

Posted 2011-04-19T00:14:16.987

Reputation: 31

You can do this with a router. Research pfSense . It can be a challenge. – Joe – 2011-05-19T04:08:03.943

Answers

3

If one interface goes down physically (cable unplugged, no wifi signal) or has no DHCP information, Mac OS X will automatically fail over to the next active interface in the list in the Network preferences. You can change the priority using the “Set Service Order…” option in the action menu.

However, this does not care about failures which are lack of packets getting through. If that it your problem, maybe you could find or create a tool to automatically shut down the interface that is failing for a moment (such as by ifconfig en0 down); when it is brought up again it would fail to acquire a DHCP lease and so remain inactive until it is working again.

Kevin Reid

Posted 2011-04-19T00:14:16.987

Reputation: 2 854

0

Wonder if there is a way to chose which internet connection to utilise from the command line?

That way you could re-check previously broken connections without just 'down' the interface rendering it uncheckable.

E.g. Then you could use a script like this but instead of echoing success or fail you'd choose which connection the mac should use/share to other computers etc:

#!/bin/sh
# Ping a standard website with output suppressed, if ping completes then display success else failure

echo "Checking internet connectivity..."
ping -c 5 www.google.com>>/dev/null

if [ $? -eq  0 ]
then
echo "Able to reach internet, yay!"
else
echo " Not able to check internet connectivity!"
fi

Ben

Posted 2011-04-19T00:14:16.987

Reputation: 9