Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to convert code I made on ubuntu work with osx. I do not know how to convert the iptables commands to ipfw commands. Any help would be appreciated.

Ubuntu Code:

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 Code:

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
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

At the end of this page you'll find examples for NAT with ipfw. I hope this helps.

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls-ipfw.html
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.