4 export WAN
=$
(nvram get wan_ifname
)
5 export IPT
=/usr
/sbin
/iptables
7 for T
in filter nat mangle
; do
13 $IPT -t filter
-A INPUT
-m state
--state INVALID
-j DROP
14 $IPT -t filter
-A INPUT
-m state
--state RELATED
,ESTABLISHED
-j ACCEPT
15 $IPT -t filter
-A FORWARD
-m state
--state INVALID
-j DROP
16 $IPT -t filter
-A FORWARD
-m state
--state RELATED
,ESTABLISHED
-j ACCEPT
18 if [ -d /etc
/firewall.d
]; then
19 for fw
in /etc
/firewall.d
/??
*; do
26 $IPT -t filter
-A INPUT
-p icmp
-j ACCEPT
27 $IPT -t filter
-A INPUT
-p 47 -j ACCEPT
28 $IPT -t filter
-A INPUT
-i $WAN -p tcp
-j REJECT
--reject-with tcp-reset
29 $IPT -t filter
-A INPUT
-i $WAN -j REJECT
--reject-with icmp-port-unreachable
31 $IPT -t filter
-A FORWARD
-i $WAN -m state
--state NEW
,INVALID
-j DROP
32 $IPT -t filter
-A FORWARD
-o $WAN -p tcp
--tcp-flags SYN
,RST SYN
-j TCPMSS
--clamp-mss-to-pmtu
34 $IPT -t nat
-A POSTROUTING
-o $WAN -j MASQUERADE
This page took 0.042312 seconds and 5 git commands to generate.