Skip to content

Instantly share code, notes, and snippets.

@dmitryd
Last active August 29, 2015 14:23
Show Gist options
  • Save dmitryd/031d9b8eb6b96dc034ed to your computer and use it in GitHub Desktop.
Save dmitryd/031d9b8eb6b96dc034ed to your computer and use it in GitHub Desktop.
Prevent access to local Apache on OS X with ipfw
add 1000 deny tcp from any to any dst-port 80 recv en0
add 2000 deny tcp from any to any dst-port 80 recv en1
add 3000 deny tcp from any to any dst-port 80 recv en3
# The next one works only if you have tun/tap driver installed for VPN apps. If you do not have it, comment it.
add 4000 deny tcp from any to any dst-port 80 recv tun0
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://
www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>ipfw</string>
<key>Program</key>
<string>/sbin/ipfw</string>
<key>ProgramArguments</key>
<array>
<string>/sbin/ipfw</string>
<string>/etc/ipfw.conf</string>
</array>
<key>RunAtLoad</key>
<true />
</dict>
</plist>
sudo launchctl load -w /Library/LaunchDaemons/ipfw.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment