]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
Captive-Portal: add captive chains to firewall initscript
authorAlexander Marx <alexander.marx@ipfire.org>
Thu, 28 Jan 2016 15:08:32 +0000 (16:08 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 Feb 2016 14:46:59 +0000 (14:46 +0000)
When loading the initscript of the firewall the neccessary chains for
the captive portalneed to be created.

Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
src/initscripts/init.d/firewall

index cb52670d6a5e42c5dbf7fd809fd1350d66a8a00d..18da870ef12a35a7c19ae2e848d78948f37862c8 100644 (file)
@@ -217,6 +217,13 @@ iptables_init() {
                iptables -A ${i} -j LOOPBACK
        done
 
+       # Captive portal
+       iptables -N CAPTIVE_PORTAL
+       iptables -N CAPTIVE_PORTAL_CLIENTS
+       for i in INPUT FORWARD; do
+               iptables -A ${i} -j CAPTIVE_PORTAL
+       done
+
        # Accept everything connected
        for i in INPUT FORWARD OUTPUT; do
                iptables -A ${i} -j CONNTRACK
@@ -330,6 +337,10 @@ iptables_init() {
        iptables -N UPNPFW
        iptables -A FORWARD -m conntrack --ctstate NEW -j UPNPFW
 
+       # Captive Portal
+       iptables -t nat -N CAPTIVE_PORTAL
+       iptables -t nat -A PREROUTING -j CAPTIVE_PORTAL
+
        # RED chain, used for the red interface
        iptables -N REDINPUT
        iptables -A INPUT -j REDINPUT