Skip to content

Instantly share code, notes, and snippets.

@retspen
Created March 2, 2018 18:27
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save retspen/4e6ec73271594399c050f6f8027a9880 to your computer and use it in GitHub Desktop.
Save retspen/4e6ec73271594399c050f6f8027a9880 to your computer and use it in GitHub Desktop.
Enable NAT on macOS
#!/bin/bash
cat > /usr/local/etc/pf-nat.conf << EOF
nat on en0 from vnic1:network to any -> (en0)
EOF
sudo pfctl -d
sudo sysctl -w net.inet.ip.forwarding=1
sudo pfctl -f /usr/local/etc/pf-nat.conf -e
@chexov
Copy link

chexov commented Sep 24, 2020

thank you, Sir

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