X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=firewall.sh;h=f880eafad6986950ea39bb344663ab4d74fbd70a;hb=9ec8b91463d0c625e2e561fa476abe9c0e9c84ca;hp=eab2cb3404574a08d4f8b914022ee7c3d7ef9786;hpb=26febd7376e8c1679d5d088d71d73bc64585ec1e;p=firewall-squeep diff --git a/firewall.sh b/firewall.sh index eab2cb3..f880eaf 100755 --- a/firewall.sh +++ b/firewall.sh @@ -74,21 +74,26 @@ done create_set allowed_udp bitmap:port range 0-65535 create_set allowed_tcp bitmap:port range 0-65535 -# common services -allow_services ssh smtp submission domain ntp - -# per-host services -srv_file="services.$(hostname -s)" -if [ -e "${srv_file}" ] -then - . "${srv_file}" -fi +for sfx in '' ".$(hostname -s)" +do + if [ -e "services${sfx}" ] + then + + for l in $(decommentcat "services${sfx}") + do + allow_services "${l}" + done + fi +done $IPTABLES -A INPUT -i "${EXT_IF}" -p tcp -m set --match-set allowed_tcp dst -j ACCEPT $IPTABLES -A INPUT -i "${EXT_IF}" -p udp -m set --match-set allowed_udp dst -j ACCEPT $IP6TABLES -A INPUT -i "${EXT_IF}" -p tcp -m set --match-set allowed_tcp dst -j ACCEPT $IP6TABLES -A INPUT -i "${EXT_IF}" -p udp -m set --match-set allowed_udp dst -j ACCEPT +# insert asia blocker +./sinokorea.sh + # insert persistent-pest-blocker ./xenophobe.sh