Skip to content

Instantly share code, notes, and snippets.

@uranio-235
Last active March 23, 2017 01:06
Show Gist options
  • Save uranio-235/ac545af82bfd4c1338eb9d75df82674d to your computer and use it in GitHub Desktop.
Save uranio-235/ac545af82bfd4c1338eb9d75df82674d to your computer and use it in GitHub Desktop.
========= /etc/rc.conf
firewall_enable="YES"
firewall_script="/usr/local/etc/ipfw.rules"
gateway_enable="YES"
natd_enable="YES"
natd_interface="xn2"
natd_flags="-dynamic -m"
======== ipfw.rules
ipfw -q add divert natd all from 169.254.0.0/16 to any via xn2 out
ipfw -q add allow all from any to any
sysctl -w net.inet.ip.forwarding=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment