]> git.ipfire.org Git - people/pmueller/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>
Fri, 22 Sep 2017 17:54:03 +0000 (18:54 +0100)
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/system/firewall

index 7bdb292f7ddb8a2160377a45180fe58de40b93dc..c4d2fefe41d3308823b4250d15e26c998db56db3 100644 (file)
@@ -224,6 +224,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
@@ -337,6 +344,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