fender.m4: Reformat the ebtables hacking a bit.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 8 Mar 2014 14:54:07 +0000 (14:54 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 8 Mar 2014 14:54:07 +0000 (14:54 +0000)
fender.m4

index dda96f8..e8e766a 100644 (file)
--- a/fender.m4
+++ b/fender.m4
@@ -39,15 +39,18 @@ run ip6tables -I INPUT -d 2001:ba8:0:1d9::ffff -j DROP
 
 ## Ethernet bridge-level filtering for source addresses.
 run ebtables -F
+for i in log limit ip ip6; do run modprobe ebt-$i; done
+
 for c in bad-source-addr check-eth0; do
   run ebtables -X $c >/dev/null 2>&1 || :
 done
-for i in log limit ip ip6; do run modprobe ebt-$i; done
+
 run ebtables -N bad-source-addr
 run ebtables -A bad-source-addr \
        --limit 20/second --limit-burst 100 \
        --log-prefix "fw: bad-source-addr(br) " --log-ip --log-ip6
 run ebtables -A bad-source-addr -j DROP
+
 run ebtables -N check-eth0
 run ebtables -A check-eth0 -j RETURN -p ip --ip-source ! 212.13.198.64/28
 run ebtables -A check-eth0 -j RETURN -p ip6 --ip6-source 2001:ba8:0:1d9::1