Skip to content

Instantly share code, notes, and snippets.

@alekstrust
Created July 8, 2017 20:55
Show Gist options
  • Save alekstrust/0295647aff44ae864e6792a39064361f to your computer and use it in GitHub Desktop.
Save alekstrust/0295647aff44ae864e6792a39064361f to your computer and use it in GitHub Desktop.
sudo sysctl -w net.inet.ip.forwarding=1
sudo sysctl -w net.inet.ip.fw.enable=1
sudo pfctl -d
sudo pfctl -F all
sudo pfctl -f /etc/pf.conf -e
# Add the following lines to /etc/pf.conf immediately after rdr-anchor "com.apple/*":
# Bridge network
lan="{192.168.2.0/24}"
# Bridge interface
ext_if=bridge100
# VPN interface
vpn_if="utun0"
nat on $ext_if from $lan to any -> ($ext_if)
nat on $vpn_if from $lan to any -> ($vpn_if)
@foilandwater
Copy link

Actually, i've just realised that this code does not always start bridge100. I did a restart and now when i run the code it is not working? Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment