Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
You can do this with a router. Research pfSense . It can be a challenge. – Joe May 19 '11 at 4:08

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.

share|improve this answer

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:

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

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

if [ $? -eq  0 ]
echo "Able to reach internet, yay!"
echo " Not able to check internet connectivity!"
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .