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

In unix (ubuntu) we have iptables command, using which we can block Internet connection for one user. I want to know if there is any cocoa, carbon API using which a user can block his Internet connection for some time and later can re-connect it.

Note: I don't have administrative privileges.

share|improve this question

migrated from Dec 31 '12 at 3:12

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

Do you want to disable WiFi or Ethernet connection via a script? – Black Frog Dec 26 '12 at 20:58
If you can share would love to go through it :-) – Devarshi Dec 27 '12 at 6:07
I have got one useful answer, not sure why I have been down voted :-( – Devarshi Dec 28 '12 at 6:22
hi to people who are voting to close this question. I have found a similar question, related to .net, in SO…, which has got some useful answer to, and is not closed, so I am not sure why this question is voted to be closed. Please clarify. Again I think that it can bring some more useful answer if not closed. – Devarshi Dec 28 '12 at 12:41
Because that example is running on Windows 7 which every user is also guarantee to be admin. On a Unix system, if you user wants to block internet, just disable the Wi-Fi or unplug the Ethernet cable. Simply. – Black Frog Dec 28 '12 at 16:00

Mac OS X 10.7 and later supports PF, an OpenBSD packet filter, which is almost certainly the right way to go about this.

The command-line interface to manage rules is pfctl. Likely you'll need to invoke it as root, using Authorization Services. Here's an answer which describes an NSTask-like wrapper which may help you.

PF does appear to support rules based on UIDs (look for the user parameter on the man page). If you need help configuring PF to do what you want, post at or

share|improve this answer
thanx a lot for your useful answer.. will surely try it :-) – Devarshi Dec 27 '12 at 6:08
I have one more question.. suppose a user is not having administrative privileges, and still he wants to block Internet Connection, only for his account then how can he do it? – Devarshi Dec 27 '12 at 14:15
I think a helper program with admin privileges is the only way that would work. – noa Dec 27 '12 at 14:33
ok...once again thanx :-) – Devarshi Dec 28 '12 at 5:32

You must log in to answer this question.

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