]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/initscripts/init.d/firewall
Added a new chain for guardian blocks.
[ipfire-2.x.git] / src / initscripts / init.d / firewall
index bc511832dfcf13ae0a2b15072f37adddabd31666..c38cce5c27c3ef9e6d0b8bd208f376be6132bc64 100644 (file)
@@ -101,8 +101,7 @@ iptables_red() {
                # This rule enables a host on ORANGE network to connect to the outside
                # (only if we have a red connection)
                if [ "$IFACE" != "" ]; then
-                       /sbin/iptables -A REDFORWARD -i $ORANGE_DEV -p tcp -o $IFACE -j ACCEPT
-                       /sbin/iptables -A REDFORWARD -i $ORANGE_DEV -p udp -o $IFACE -j ACCEPT
+                       /sbin/iptables -A REDFORWARD -i $ORANGE_DEV -o $IFACE -j ACCEPT
                fi
        fi
 
@@ -117,7 +116,8 @@ iptables_red() {
                        /sbin/iptables -A REDINPUT -p udp --source-port 67 --destination-port 68 -i $IFACE -j ACCEPT
                fi
 
-               # Outgoing masquerading
+               # Outgoing masquerading (don't masqerade IPSEC (mark 50))
+               /sbin/iptables -t nat -A REDNAT -m mark --mark 50 -o $IFACE -j RETURN
                /sbin/iptables -t nat -A REDNAT -o $IFACE -j MASQUERADE
 
        fi
@@ -140,6 +140,8 @@ case "$1" in
        # CUSTOM chains, can be used by the users themselves
        /sbin/iptables -N CUSTOMINPUT
        /sbin/iptables -A INPUT -j CUSTOMINPUT
+       /sbin/iptables -N GUARDIANINPUT
+       /sbin/iptables -A INPUT -j GUARDIANINPUT
        /sbin/iptables -N CUSTOMFORWARD
        /sbin/iptables -A FORWARD -j CUSTOMFORWARD
        /sbin/iptables -N CUSTOMOUTPUT
@@ -167,12 +169,15 @@ case "$1" in
        /sbin/iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
        
        # trafic from ipsecX/TUN/TAP interfaces, before "-i GREEN_DEV" accept everything
-       /sbin/iptables -N IPSECVIRTUAL
+       /sbin/iptables -N IPSECINPUT
+       /sbin/iptables -N IPSECFORWARD
+       /sbin/iptables -N IPSECOUTPUT
        /sbin/iptables -N OPENSSLVIRTUAL
-       /sbin/iptables -A INPUT -j IPSECVIRTUAL -m comment --comment "IPSECVIRTUAL INPUT"
+       /sbin/iptables -A INPUT -j IPSECINPUT
        /sbin/iptables -A INPUT -j OPENSSLVIRTUAL -m comment --comment "OPENSSLVIRTUAL INPUT"
-       /sbin/iptables -A FORWARD -j IPSECVIRTUAL -m comment --comment "IPSECVIRTUAL FORWARD"
+       /sbin/iptables -A FORWARD -j IPSECFORWARD
        /sbin/iptables -A FORWARD -j OPENSSLVIRTUAL -m comment --comment "OPENSSLVIRTUAL FORWARD"
+       /sbin/iptables -A OUTPUT -j IPSECOUTPUT
        /sbin/iptables -t nat -N IPSECNAT
        /sbin/iptables -t nat -A POSTROUTING -j IPSECNAT
 
@@ -198,10 +203,6 @@ case "$1" in
        /sbin/iptables -N DHCPBLUEINPUT 
        /sbin/iptables -A INPUT -j DHCPBLUEINPUT
 
-       # IPSec
-       /sbin/iptables -N IPSECPHYSICAL
-       /sbin/iptables -A INPUT -j IPSECPHYSICAL
-
        # OPenSSL
        /sbin/iptables -N OPENSSLPHYSICAL
        /sbin/iptables -A INPUT -j OPENSSLPHYSICAL