radius.m4: Handy ipset hook for ad-hoc safe/unstrusted exceptions.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 8 Jun 2012 00:28:45 +0000 (01:28 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 8 Jun 2012 00:28:45 +0000 (01:28 +0100)
radius.m4

index 4bf4cea..ecf64b7 100644 (file)
--- a/radius.m4
+++ b/radius.m4
@@ -53,6 +53,18 @@ dnsresolver inbound
 run iptables -A inbound -j ACCEPT \
        -p $proto_ipv6 -s 216.66.80.26
 
+## Permitted special forwarding.
+makeset fwd-allow-http nethash || :
+iptables -A fwd-spec-nofrag -j ACCEPT \
+       -m set --match-set fwd-allow-http dst \
+       -p tcp --destination-port $port_http \
+       -m mark --mark $to_untrusted/$MASK_TO
+iptables -A fwd-spec-nofrag -j ACCEPT \
+       -m set --match-set fwd-allow-http src \
+       -p tcp --destination-port $port_http \
+       -m mark --mark $from_untrusted/$MASK_FROM \
+       -m state --state ESTABLISHED
+
 ## NAT for RFC1918 addresses.
 for i in PREROUTING OUTPUT POSTROUTING; do
   run iptables -t nat -P $i ACCEPT 2>/dev/null || :