aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2007-10-29 10:31:16 +0000
committerFlorian Fainelli <florian@openwrt.org>2007-10-29 10:31:16 +0000
commit304d5c8845273000cd84ee4a25ec6542a5ee94d8 (patch)
tree5a69ae858a27bcf74cede15a18a7ea4af77e3a23 /package
parente8d61c7aaa29068ca61c3f0480ca0cad3c27b799 (diff)
downloadupstream-304d5c8845273000cd84ee4a25ec6542a5ee94d8.tar.gz
upstream-304d5c8845273000cd84ee4a25ec6542a5ee94d8.tar.bz2
upstream-304d5c8845273000cd84ee4a25ec6542a5ee94d8.zip
Only masquerade non routable addresses (#2535)
SVN-Revision: 9460
Diffstat (limited to 'package')
-rwxr-xr-xpackage/iptables/files/firewall.init5
1 files changed, 4 insertions, 1 deletions
diff --git a/package/iptables/files/firewall.init b/package/iptables/files/firewall.init
index 388c5b4f91..9d8a405ab0 100755
--- a/package/iptables/files/firewall.init
+++ b/package/iptables/files/firewall.init
@@ -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