2010-08-29 12:58:20 -06:00
|
|
|
#!/bin/bash
|
2010-08-21 20:19:28 -06:00
|
|
|
# By Brielle Bruns <bruns@2mbit.com>
|
|
|
|
# URL: http://www.sosdg.org/freestuff/firewall
|
|
|
|
# License: GPLv3
|
|
|
|
#
|
|
|
|
# Copyright (C) 2009 - 2010 Brielle Bruns
|
|
|
|
# Copyright (C) 2009 - 2010 The Summit Open Source Development Group
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# This file defines static variables that we will be using. Normally, you
|
|
|
|
# should not be needing to edit these.
|
|
|
|
|
2010-08-25 12:00:48 -06:00
|
|
|
# These defines are here to help pre-1.0 users easily upgrade, defines critical defaults
|
|
|
|
# that would otherwise require remaking their options file. I leave this on by default,
|
|
|
|
# but if you want to make sure you have a current options file, define this to 0.
|
2010-11-15 23:07:31 -07:00
|
|
|
|
2010-10-06 12:54:05 -06:00
|
|
|
if [[ "$COMPAT_CONFIG" == "1" ]]; then
|
2010-08-25 12:00:48 -06:00
|
|
|
MODPROBE=`which modprobe`
|
2010-11-15 23:07:31 -07:00
|
|
|
PRERUN="$BASEDIR/prerun"
|
|
|
|
POSTRUN="$BASEDIR/postrun"
|
2010-08-25 12:00:48 -06:00
|
|
|
fi
|
|
|
|
|
2010-08-29 17:33:54 -06:00
|
|
|
|
2010-08-21 20:19:28 -06:00
|
|
|
# ANSI color sequences
|
|
|
|
BLUE="\E[34m"
|
|
|
|
GREEN="\E[32m"
|
|
|
|
RED="\E[31m"
|
|
|
|
YELLOW="\E[33m"
|
|
|
|
PURPLE="\E[35m"
|
|
|
|
AQUA="\E[36m"
|
|
|
|
WHITE="\E[1m"
|
|
|
|
GREY="\E[37m"
|
2010-08-25 11:43:57 -06:00
|
|
|
DEFAULT_COLOR="\E[39m"
|
|
|
|
|
|
|
|
# Module names that we may need to load
|
2010-09-24 20:49:43 -06:00
|
|
|
MOD_U32="xt_u32"
|
|
|
|
|
|
|
|
# Location of the ipv4 network conf in proc
|
2010-09-26 13:45:51 -06:00
|
|
|
PROC_NET_IPV4="/proc/sys/net/ipv4/conf"
|
|
|
|
|
2010-09-26 15:13:54 -06:00
|
|
|
# Multiport options - override in options
|
|
|
|
NF_MULTIPORT="xt_multiport"
|
2010-09-29 17:04:48 -06:00
|
|
|
NF_MULTIPORT_MAX_PORTS="7"
|
|
|
|
|
|
|
|
# RFC 1918 Space
|
2010-11-15 23:07:31 -07:00
|
|
|
RFC1918_SPACE="192.168.0.0/16 172.16.0.0/12 10.0.0.0/8"
|
2010-11-25 11:11:12 -07:00
|
|
|
|
|
|
|
# By default, use conntrack instead of state
|
|
|
|
STATE_TYPE="conntrack"
|
2010-11-25 11:50:55 -07:00
|
|
|
|
2010-11-25 20:13:46 -07:00
|
|
|
# Auto detect multiport
|
|
|
|
IPTABLES_MULTIPORT=auto
|
|
|
|
|
2010-11-25 11:50:55 -07:00
|
|
|
# Where we store output of cached rules
|
|
|
|
RULE_CACHE=$BASEDIR/cache/ipt-rules
|
2010-11-25 11:58:30 -07:00
|
|
|
RULE_CACHE_V6=$BASEDIR/cache/ipt6-rules
|
2010-12-18 14:15:57 -07:00
|
|
|
|
2010-12-18 14:33:50 -07:00
|
|
|
EXTIP="auto"
|
2010-12-18 14:15:57 -07:00
|
|
|
EXTIF="auto"
|
2010-12-18 14:53:35 -07:00
|
|
|
EXTIF_FIND="$BASEDIR/bin/get_default_if"
|
|
|
|
EXTIP_FIND="$BASEDIR/bin/get_default_ip"
|