Created
September 3, 2014 05:32
-
-
Save esperia/b14fb67a726f6034a686 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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