]>
git.ipfire.org Git - ipfire-2.x.git/blob - config/firewall/firewall-policy
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2013 Alexander Marx <amarx@ipfire.org> #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
22 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/ethernet
/settings
)
23 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/firewall
/settings
)
24 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/optionsfw
/settings
)
30 if [ -f "/var/ipfire/red/iface" ]; then
31 IFACE
="$(</var/ipfire/red/iface)"
34 # Figure out what devices are configured.
38 case "${CONFIG_TYPE}" in
52 case "${FWPOLICY2}" in
54 if [ "${DROPINPUT}" = "on" ]; then
55 /sbin
/iptables
-A POLICYIN
-m limit
--limit 10/minute
-j LOG
--log-prefix "REJECT_INPUT"
57 /sbin
/iptables
-A POLICYIN
-j REJECT
--reject-with icmp-host-unreachable
-m comment
--comment "DROP_INPUT"
60 if [ "${DROPINPUT}" = "on" ]; then
61 /sbin
/iptables
-A POLICYIN
-m limit
--limit 10/minute
-j LOG
--log-prefix "DROP_INPUT"
63 /sbin
/iptables
-A POLICYIN
-j DROP
-m comment
--comment "DROP_INPUT"
72 if [ "${DROPFORWARD}" = "on" ]; then
73 /sbin
/iptables
-A POLICYFWD
-m limit
--limit 10/minute
-j LOG
--log-prefix "REJECT_FORWARD"
75 /sbin
/iptables
-A POLICYFWD
-j REJECT
--reject-with icmp-host-unreachable
-m comment
--comment "DROP_FORWARD"
78 if [ "${DROPFORWARD}" = "on" ]; then
79 /sbin
/iptables
-A POLICYFWD
-m limit
--limit 10/minute
-j LOG
--log-prefix "DROP_FORWARD"
81 /sbin
/iptables
-A POLICYFWD
-j DROP
-m comment
--comment "DROP_FORWARD"
87 if [ -n "${IFACE}" ]; then
88 if [ "${HAVE_BLUE}" = "true" ] && [ -n "${BLUE_DEV}" ]; then
89 /sbin
/iptables
-A POLICYFWD
-i "${BLUE_DEV}" ! -o "${IFACE}" -j DROP
91 if [ "${HAVE_ORANGE}" = "true" ] && [ -n "${ORANGE_DEV}" ]; then
92 /sbin
/iptables
-A POLICYFWD
-i "${ORANGE_DEV}" ! -o "${IFACE}" -j DROP
95 /sbin
/iptables
-A POLICYFWD
-j ACCEPT
96 /sbin
/iptables
-A POLICYFWD
-m comment
--comment "DROP_FORWARD" -j DROP
103 case "${FWPOLICY1}" in
105 if [ "${DROPOUTGOING}" = "on" ]; then
106 /sbin
/iptables
-A POLICYOUT
-m limit
--limit 10/minute
-j LOG
--log-prefix "REJECT_OUTPUT"
108 /sbin
/iptables
-A POLICYOUT
-j REJECT
--reject-with icmp-host-unreachable
-m comment
--comment "DROP_OUTPUT"
111 if [ "${DROPOUTGOING}" == "on" ]; then
112 /sbin
/iptables
-A POLICYOUT
-m limit
--limit 10/minute
-j LOG
--log-prefix "DROP_OUTPUT"
114 /sbin
/iptables
-A POLICYOUT
-j DROP
-m comment
--comment "DROP_OUTPUT"
119 /sbin
/iptables
-A POLICYOUT
-j ACCEPT
120 /sbin
/iptables
-A POLICYOUT
-m comment
--comment "DROP_OUTPUT" -j DROP