1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-24 22:35:11 +02:00

Only masquerade non routable addresses (#2535)

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@9460 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2007-10-29 10:31:16 +00:00
parent d97939c2d9
commit 6880ed0d32

View File

@ -105,7 +105,10 @@ start() {
iptables -t nat -A PREROUTING -j prerouting_rule
[ -z "$WAN" ] || iptables -t nat -A PREROUTING -i "$WAN" -j prerouting_wan
iptables -t nat -A POSTROUTING -j postrouting_rule
[ -z "$WAN" ] || iptables -t nat -A POSTROUTING -o $WAN -j MASQUERADE
### Only RFC1918 addresses
[ -z "$WAN" ] || iptables -t nat -A POSTROUTING --src 192.168.0.0/16 -o $WAN -j MASQUERADE
[ -z "$WAN" ] || iptables -t nat -A POSTROUTING --src 172.16.0.0/12 -o $WAN -j MASQUERADE
[ -z "$WAN" ] || iptables -t nat -A POSTROUTING --src 10.0.0.0/8 -o $WAN -j MASQUERADE
iptables -t nat -A NEW -m limit --limit 50 --limit-burst 100 -j RETURN && \
iptables -t nat -A NEW -j DROP