ITeye博客

config ufw for router purpose

mathgl · 2014-01-03 11:22 · Linux/ubuntu · 非技术 · Markdown

sometimes we need to share our internect connection without losing any protection, here ufw can help us.

 

1:

open /etc/default/ufw

change DEFAULT_FORWARD_POLICY = "ACCEPT"

             DEFAULT_INCOMING_POLICY = "ACCEPT"

 

2: open /etc/ufw/sysctl.conf and uncomment

   net/ipv4/ip_forward=1

  for ipv6 net/ipv6/conf/default/forwarding=1

 

3: add rules to the /etc/ufw/before.rules

right beneath *filter rules

add

*nat

:POSTROUTING ACCEPT [0:0]

-A POSTROUTING -s 192.168.2.0/24 -o ppp0 -j MASQUERADE

 

sudo ufw disable & enable

 

done.

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。