X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/b61fd707efdbe0622db6ab525a900378a48113f9..8480b3568e9ac76ef5dfc8e084395a56573f4b43:/target/default/target_skeleton/etc/init.d/S45firewall?ds=sidebyside diff --git a/target/default/target_skeleton/etc/init.d/S45firewall b/target/default/target_skeleton/etc/init.d/S45firewall index bdb485936..8f9b9404e 100755 --- a/target/default/target_skeleton/etc/init.d/S45firewall +++ b/target/default/target_skeleton/etc/init.d/S45firewall @@ -16,18 +16,6 @@ iptables -N forwarding_rule iptables -t nat -N prerouting_rule iptables -t nat -N postrouting_rule -### Allow SSH from WAN -# iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 22 -j ACCEPT -# iptables -A input_rule -i $WAN -p tcp --dport 22 -j ACCEPT - -### Port forwarding -# iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 22 -j DNAT --to 192.168.1.2 -# iptables -A forwarding_rule -i $WAN -p tcp --dport 22 -d 192.168.1.2 -j ACCEPT - -### DMZ (should be placed after port forwarding / accept rules) -# iptables -t nat -A prerouting_rule -i $WAN -j DNAT --to 192.168.1.2 -# iptables -A forwarding_rule -i $WAN -d 192.168.1.2 -j ACCEPT - ### INPUT ### (connections with the router as destination) @@ -75,8 +63,8 @@ iptables -t nat -N postrouting_rule # base case iptables -P FORWARD DROP iptables -A FORWARD -m state --state INVALID -j DROP - iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu + iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT # allow iptables -A FORWARD -i br0 -o br0 -j ACCEPT @@ -93,3 +81,6 @@ iptables -t nat -N postrouting_rule iptables -t nat -A PREROUTING -j prerouting_rule iptables -t nat -A POSTROUTING -j postrouting_rule iptables -t nat -A POSTROUTING -o $WAN -j MASQUERADE + +## USER RULES +. /etc/firewall.user