]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - config/forwardfw/firewall-policy
Forward Firewall: added "default-rules-table" at the end of forward ruletable
[people/teissler/ipfire-2.x.git] / config / forwardfw / firewall-policy
index 55287dd074518f3185c8f31241adcb13d12f2bf9..e142f2d3f44fc998aeca9eb50fb627b382f2ab81 100755 (executable)
@@ -2,11 +2,15 @@
 
 eval $(/usr/local/bin/readhash /var/ipfire/forward/settings)
 eval $(/usr/local/bin/readhash /var/ipfire/optionsfw/settings)
+eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
 
 iptables -F POLICYFWD
 iptables -F POLICYOUT
 iptables -F POLICYIN
-IFACE=`cat /var/ipfire/red/iface`
+
+if [ -f "/var/ipfire/red/iface" ]; then
+       IFACE=`cat /var/ipfire/red/iface`
+fi
 
 #FORWARDFW
 if [ "$POLICY" == "MODE1" ]; then
@@ -23,8 +27,12 @@ if [ "$POLICY" == "MODE1" ]; then
                        /sbin/iptables -A POLICYFWD -j DROP -m comment --comment "DROP_FORWARD"
                fi
 else
-       /sbin/iptables -A POLICYFWD -i blue0 ! -o $IFACE -j DROP -m comment --comment "DROP_FORWARD_BLUE"
-       /sbin/iptables -A POLICYFWD -j ACCEPT -m comment --comment "DROP_FORWARD"
+       if [  "$BLUE_DEV" ] && [ "$IFACE" ]; then
+               /sbin/iptables -A POLICYFWD -i blue0 ! -o $IFACE -j DROP 
+       fi
+       /sbin/iptables -A POLICYFWD -i orange0 ! -o $IFACE -j DROP
+       /sbin/iptables -A POLICYFWD -j ACCEPT 
+       /sbin/iptables -A POLICYFWD -m comment --comment "DROP_FORWARD" -j DROP
 fi
 
 #OUTGOINGFW
@@ -42,7 +50,8 @@ if [ "$POLICY1" == "MODE1" ]; then
                        /sbin/iptables -A POLICYOUT -j DROP -m comment --comment "DROP_OUTPUT"
        fi
 else
-       /sbin/iptables -A POLICYOUT -j ACCEPT -m comment --comment "DROP_OUTPUT"
+       /sbin/iptables -A POLICYOUT -j ACCEPT 
+       /sbin/iptables -A POLICYOUT -m comment --comment "DROP_OUTPUT" -j DROP
 fi
 #INPUT
 if [ "$FWPOLICY2" == "REJECT" ]; then
@@ -57,3 +66,5 @@ if [ "$FWPOLICY2" == "DROP" ]; then
        fi
        /sbin/iptables -A POLICYIN -j DROP -m comment --comment "DROP_INPUT"
 fi
+
+exit 0