将iptables命令转换为ipfw

我正试图将我在Ubuntu上做的代码转换成osx。 我不知道如何将iptables命令转换为ipfw命令。 任何帮助,将不胜感激。

Ubuntu代码:

echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE ssh server -l root -w0:0 ifconfig tun0 10.0.0.1 netmask 255.0.0.0 route add -net 1.2.3.4 dev tun0 iptables -t nat -A OUTPUT -p all -d 15.0.0.5 -o tun0 -j DNAT --to-destination 10.0.0.5 route add -host 15.0.0.5 dev tun0 

Mac OS X代码:

 sysctl -w net.inet.ip.forwarding=1 HELP HERE PLEASE! ssh server -l root -w0:0 ifconfig tun0 10.0.0.1 netmask 255.0.0.0 route add -net 1.2.3.4 dev tun0 HERE TOO HERE! route add -host 15.0.0.5 dev tun0 

在这个页面的最后,你会发现NAT与ipfw的例子。 我希望这有帮助。

 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls-ipfw.html