IPFW – Simple NAT

Some example to configure NAT using IPFW.

Don’t forget to enable forwarding.

 

[code language=”shell”]
ipfw nat 1 config if em0

ipfw add 2001 nat 1 ip from any to any in via em0
ipfw add 4001 nat 1 ip from any to any out via em0
ipfw add 65535 allow ip from any to any

[/code]

# vi /etc/sysctl.conf

[code language=”shell”]
net.inet.ip.forwarding=1
net.inet6.ip6.forwarding=1

[/code]

 

[code language=”shell”]
sysctl net.inet.ip.forwarding=1
sysctl net.inet6.ip6.forwarding=1
[/code]

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *