Setting NAT use ufw in Ubuntu

"ufw" command doesn't support MASQUARDE parameter. There are two ways to achieve this object. One is use "iptables" commant like other Linux distribution. Another is edit /etc/ufw/before.rules manual. It can refer to this official document(for 10.04). It should be like below:

*filter
...
...
COMMIT
# nat Table rules
*nat
:POSTROUTING ACCEPT [0:0]

# Forward traffic from eth1 through eth0.
-A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

# don't delete the 'COMMIT' line or these nat table rules won't be processed
COMMIT

留言

熱門文章