]>
git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - config/forwardfw/firewall-policy
f6c88e4afafe171745b5c53e34a17e31d2926b82
3 ###############################################################################
5 # IPFire.org - A linux based firewall #
8 # This program is free software: you can redistribute it and/or modify #
9 # it under the terms of the GNU General Public License as published by #
10 # the Free Software Foundation, either version 3 of the License, or #
11 # (at your option) any later version. #
13 # This program is distributed in the hope that it will be useful, #
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16 # GNU General Public License for more details. #
18 # You should have received a copy of the GNU General Public License #
19 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
21 ###############################################################################
22 # Author: Alexander Marx (amarx@ipfire.org) #
23 ###############################################################################
26 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/forward
/settings
)
27 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/optionsfw
/settings
)
28 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/ethernet
/settings
)
34 if [ -f "/var/ipfire/red/iface" ]; then
35 IFACE
=`cat /var/ipfire/red/iface`
39 if [ "$POLICY" == "MODE1" ]; then
40 if [ "$FWPOLICY" == "REJECT" ]; then
41 if [ "$DROPFORWARD" == "on" ]; then
42 /sbin
/iptables
-A POLICYFWD
-m limit
--limit 10/minute
-j LOG
--log-prefix "REJECT_FORWARD"
44 /sbin
/iptables
-A POLICYFWD
-j REJECT
--reject-with icmp-host-unreachable
-m comment
--comment "DROP_FORWARD"
46 if [ "$FWPOLICY" == "DROP" ]; then
47 if [ "$DROPFORWARD" == "on" ]; then
48 /sbin
/iptables
-A POLICYFWD
-m limit
--limit 10/minute
-j LOG
--log-prefix "DROP_FORWARD"
50 /sbin
/iptables
-A POLICYFWD
-j DROP
-m comment
--comment "DROP_FORWARD"
53 if [ "$BLUE_DEV" ] && [ "$IFACE" ]; then
54 /sbin
/iptables
-A POLICYFWD
-i blue0
! -o $IFACE -j DROP
56 /sbin
/iptables
-A POLICYFWD
-i orange0
! -o $IFACE -j DROP
57 /sbin
/iptables
-A POLICYFWD
-j ACCEPT
58 /sbin
/iptables
-A POLICYFWD
-m comment
--comment "DROP_FORWARD" -j DROP
62 if [ "$POLICY1" == "MODE1" ]; then
63 if [ "$FWPOLICY1" == "REJECT" ]; then
64 if [ "$DROPOUTGOING" == "on" ]; then
65 /sbin
/iptables
-A POLICYOUT
-m limit
--limit 10/minute
-j LOG
--log-prefix "REJECT_OUTPUT"
67 /sbin
/iptables
-A POLICYOUT
-j REJECT
--reject-with icmp-host-unreachable
-m comment
--comment "DROP_OUTPUT"
69 if [ "$FWPOLICY1" == "DROP" ]; then
70 if [ "$DROPOUTGOING" == "on" ]; then
71 /sbin
/iptables
-A POLICYOUT
-m limit
--limit 10/minute
-j LOG
--log-prefix "DROP_OUTPUT"
73 /sbin
/iptables
-A POLICYOUT
-j DROP
-m comment
--comment "DROP_OUTPUT"
76 /sbin
/iptables
-A POLICYOUT
-j ACCEPT
77 /sbin
/iptables
-A POLICYOUT
-m comment
--comment "DROP_OUTPUT" -j DROP
80 if [ "$FWPOLICY2" == "REJECT" ]; then
81 if [ "$DROPINPUT" == "on" ]; then
82 /sbin
/iptables
-A POLICYIN
-m limit
--limit 10/minute
-j LOG
--log-prefix "REJECT_INPUT"
84 /sbin
/iptables
-A POLICYIN
-j REJECT
--reject-with icmp-host-unreachable
-m comment
--comment "DROP_INPUT"
86 if [ "$FWPOLICY2" == "DROP" ]; then
87 if [ "$DROPINPUT" == "on" ]; then
88 /sbin
/iptables
-A POLICYIN
-m limit
--limit 10/minute
-j LOG
--log-prefix "DROP_INPUT"
90 /sbin
/iptables
-A POLICYIN
-j DROP
-m comment
--comment "DROP_INPUT"