Skip to content

Instantly share code, notes, and snippets.

@esperia
Created September 3, 2014 05:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esperia/b14fb67a726f6034a686 to your computer and use it in GitHub Desktop.
Save esperia/b14fb67a726f6034a686 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
CMDNAME=`basename $0`
if [ $# -ne 1 ]; then
echo "Usage: $CMDNAME [on|off]" 1>&2
exit 1
fi
if [ $1 = "on" ]; then
sudo sysctl -w net.inet.ip.forwarding=1
sudo pfctl -f /private/etc/pf.conf
sudo pfctl -e
else
sudo sysctl -w net.inet.ip.forwarding=0
fi
echo "see also: http://mitmproxy.org/doc/transparent/osx.html"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment