radius.m4: Handy ipset hook for ad-hoc safe/unstrusted exceptions.
[firewall] / 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 || :