~mdw
/
firewall
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Makefile, base.m4: Inject the target hostname into the generated script.
[firewall]
/
classify.m4
diff --git
a/classify.m4
b/classify.m4
index
fcb008d
..
6ad069c
100644
(file)
--- a/
classify.m4
+++ b/
classify.m4
@@
-69,11
+69,14
@@
clearchain mangle:local-source
## of weird stuff happens on lo, and it's best not to second-guess it.
run ip46tables -t mangle -A in-classify -i lo -j ACCEPT
## of weird stuff happens on lo, and it's best not to second-guess it.
run ip46tables -t mangle -A in-classify -i lo -j ACCEPT
-## Local b
ootp packets have bizarre addresses. Don't block them just becaus
e
-## of this.
+## Local b
roadcast and link-local multicast packets sometimes have bizarr
e
+##
addresses. Don't block them just because
of this.
run iptables -t mangle -A in-classify -j RETURN \
-s 0.0.0.0 -d 255.255.255.255 \
run iptables -t mangle -A in-classify -j RETURN \
-s 0.0.0.0 -d 255.255.255.255 \
- -p udp --source-port $port_bootpc --destination-port $port_bootps
+ -p udp
+run iptables -t mangle -A in-classify -j RETURN \
+ -s 0.0.0.0 -d 224.0.0.0/24 \
+ -p udp
## Since packets with source and destination addresses both local will go
## over the loopback interface, I shouldn't see a packet from me over any
## Since packets with source and destination addresses both local will go
## over the loopback interface, I shouldn't see a packet from me over any
@@
-116,22
+119,30
@@
m4_divert(46)m4_dnl
## default interface.
trace "nets = $allnets $allnets6"
for net in $allnets; do
## default interface.
trace "nets = $allnets $allnets6"
for net in $allnets; do
- case $net in
- "$defaultiface":*)
- ;;
- *)
- run iptables -t mangle -A in-$defaultiface \
+ defaultp=nil
+ for iface in $defaultifaces; do
+ case $net in $iface:*) defaultp=t ;; esac
+ done
+ case $defaultp in
+ nil)
+ for iface in $defaultifaces; do
+ run iptables -t mangle -A in-$iface \
-s ${net#*:} -g bad-source-address
-s ${net#*:} -g bad-source-address
+ done
;;
esac
done
for net in $allnets6; do
;;
esac
done
for net in $allnets6; do
- case $net in
- "$defaultiface":*)
- ;;
- *)
- run ip6tables -t mangle -A in-$defaultiface \
+ defaultp=nil
+ for iface in $defaultifaces; do
+ case $net in $iface:*) defaultp=t ;; esac
+ done
+ case $defaultp in
+ nil)
+ for iface in $defaultifaces; do
+ run ip6tables -t mangle -A in-$iface \
-s ${net#*:} -g bad-source-address
-s ${net#*:} -g bad-source-address
+ done
;;
esac
done
;;
esac
done
@@
-153,7
+164,10
@@
done
m4_divert(92)m4_dnl
## Put the final default decision on the in-default chain, and attach the
## classification chains to the PREROUTING hook.
m4_divert(92)m4_dnl
## Put the final default decision on the in-default chain, and attach the
## classification chains to the PREROUTING hook.
-run ip46tables -t mangle -A in-$defaultiface -g mark-from-$defaultclass
+for iface in $defaultifaces; do
+ run ip46tables -t mangle -A in-$iface -g mark-from-$defaultclass
+done
+run ip46tables -t mangle -A out-classify -g mark-to-$defaultclass
run ip46tables -t mangle -A PREROUTING -j in-classify
run ip46tables -t mangle -A PREROUTING -j out-classify
run ip46tables -t mangle -A PREROUTING -j in-classify
run ip46tables -t mangle -A PREROUTING -j out-classify