Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I configure Mac OS X such that it can only allow an internet connection (both downloads and uploads) through a given VPN connection?

If the VPN connection disconnects, the internet should stop working.

I need to do this due to security reasons. Sometimes I use ISPs that I have no reason to trust. Especially on wifi hotspots.

How do I do this? I'm sure there is nothing I can do through the Mac OS X GUI, but is there any hack I can do via the Terminal?

share|improve this question

migrated from stackoverflow.com Aug 9 '11 at 6:48

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

If you are making a VPN connection, isn't the default route for all traffic to use that connection?

Anyway, set a default route to the VPN. Traffic should stop when the link dies.

It's late and I might not be interpreting your question clearly :D

share|improve this answer
    
That's all well and fine while the VPN connection is active. However, if the VPN connection prematurely disconnects (and while I'm away from my computer and thus don't notice it), the internet connection will fall back to my insecure default non-VPN connection. That's what I want to avoid. –  Enchilada Aug 13 '11 at 13:37
add comment
up vote 0 down vote accepted

I doubt this is possible with the VPN stuff in OS X. Correct me if I'm wrong.

However, I was able to solve this by using OpenVPN and Tunnelblick.app. Tunnelblick has capabilities for running scripts when the VPN connection dies. So I just run a script that turns off the Ethernet/AirPort when the VPN dies. Seems to be working.

share|improve this answer
    
I've found a way using pf.conf that may interest you. Details are here. –  Nick Sep 8 '12 at 11:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.