User Tools

Site Tools


Sidebar

Writing /opt/bitnami/dokuwiki/data/meta/git/delete-tag.meta failed
Unable to save metadata file. Hint: disk full; file permissions; safe_mode setting.

Go Back

Contact
Recent Changes
Sitemap
macos:setup_nat

Setup NAT on macOS

Enable IP forwarding on OSX

sudo sysctl -w net.inet.ip.forwarding=1

Edit /etc/pf.conf file. Forward packets from 192.168.1.0/24 to en0

scrub on en0 reassemble tcp no-df random-id
nat on en0 from 192.168.1.0/24 to any -> en0

Load PF config

# Disable PF if it was enabled before
sudo pfctl -d
# Enable PF and load the config
sudo pfctl -e -f /etc/pf.conf

Setup IP and gateway on client ( Linux )

sudo ip addr add 192.168.1.1 dev eth0
sudo ip route add default via 192.168.1.2
macos/setup_nat.txt · Last modified: 2020/05/19 06:54 by whtsky