forked from extern/shorewall_code
Compare commits
78 Commits
4.5.0-RC2
...
4.5.1-base
Author | SHA1 | Date | |
---|---|---|---|
|
f7a2cd4ef1 | ||
|
95e4f8dd91 | ||
|
aa503e7211 | ||
|
7e14777b8f | ||
|
c1d0681e17 | ||
|
98f8edbde5 | ||
|
1dd6a8b291 | ||
|
e839648b8e | ||
|
4ffcd80b02 | ||
|
48570227ba | ||
|
fd5b7b20cf | ||
|
c112f20e17 | ||
|
05f025e422 | ||
|
3ee9150deb | ||
|
b2842ae8d4 | ||
|
dff5136134 | ||
|
1d249567ed | ||
|
a84e131115 | ||
|
4b74fe2823 | ||
|
9493bda0cc | ||
|
36d4fff7b2 | ||
|
67a1438a41 | ||
|
aab6e67e70 | ||
|
2397449fa4 | ||
|
fc12125223 | ||
|
61bf2d5bfd | ||
|
bd9a3e5a3e | ||
|
90b33af3bd | ||
|
016fe4bcf1 | ||
|
87381a0f65 | ||
|
47453a20f7 | ||
|
b78d4ca41f | ||
|
7273f4d8d4 | ||
|
37a3dbb6f6 | ||
|
c252005e25 | ||
|
09ad6bba1a | ||
|
c975cddfda | ||
|
a6afac0f3c | ||
|
ef850e4537 | ||
|
2624005fa8 | ||
|
20f990f2eb | ||
|
7de961ebfe | ||
|
f6cc44eb6b | ||
|
3acd01a44d | ||
|
d5af9c360d | ||
|
2137840fec | ||
|
ed9e03b095 | ||
|
3180e13719 | ||
|
c751a0ada3 | ||
|
9869b4c068 | ||
|
8c981e0464 | ||
|
76f8a9e171 | ||
|
a1ec1dc178 | ||
|
e2f4af6e48 | ||
|
b1272e8835 | ||
|
75d5957020 | ||
|
1896e56894 | ||
|
7cd7f1ebbe | ||
|
7fef97d92d | ||
|
cd3a9854f8 | ||
|
f8057fed88 | ||
|
59950a7242 | ||
|
6d13069ffb | ||
|
59fea1a05d | ||
|
1c7476fe61 | ||
|
58f0425d4a | ||
|
ee7ea4adb9 | ||
|
8a3f1f7111 | ||
|
33b0821f8d | ||
|
7bf6419a7b | ||
|
29fcb9b08f | ||
|
30cf344be0 | ||
|
460efbac77 | ||
|
1b6c4e3fc4 | ||
|
09078cf6ad | ||
|
f5c09a9e2e | ||
|
f4be778b86 | ||
|
bd959884cc |
@@ -30,8 +30,6 @@ usage() # $1 = exit status
|
||||
echo "usage: $ME"
|
||||
echo " $ME -v"
|
||||
echo " $ME -h"
|
||||
echo " $ME -s"
|
||||
echo " $ME -f"
|
||||
exit $1
|
||||
}
|
||||
|
||||
@@ -87,6 +85,13 @@ install_file() # $1 = source $2 = target $3 = mode
|
||||
run_install $T $OWNERSHIP -m $3 $1 ${2}
|
||||
}
|
||||
|
||||
cd "$(dirname $0)"
|
||||
|
||||
#
|
||||
# Load packager's settings if any
|
||||
#
|
||||
[ -f ../shorewall-pkg.config ] && . ../shorewall-pkg.config
|
||||
|
||||
[ -n "$DESTDIR" ] || DESTDIR="$PREFIX"
|
||||
|
||||
#
|
||||
@@ -98,13 +103,13 @@ T="-T"
|
||||
|
||||
[ -n "${LIBEXEC:=/usr/share}" ]
|
||||
[ -n "${PERLLIB:=/usr/share/shorewall}" ]
|
||||
MACHOST=
|
||||
|
||||
case "$LIBEXEC" in
|
||||
/*)
|
||||
;;
|
||||
*)
|
||||
LIBEXEC=/usr/${LIBEXEC}
|
||||
echo "The LIBEXEC setting must be an absolute path name" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -112,14 +117,41 @@ case "$PERLLIB" in
|
||||
/*)
|
||||
;;
|
||||
*)
|
||||
PERLLIB=/usr/${PERLLIB}
|
||||
echo "The PERLLIB setting must be an absolute path name" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
INSTALLD='-D'
|
||||
|
||||
case $(uname) in
|
||||
CYGWIN*)
|
||||
if [ -z "$BUILD" ]; then
|
||||
case $(uname) in
|
||||
cygwin*)
|
||||
BUILD=cygwin
|
||||
;;
|
||||
Darwin)
|
||||
BUILD=apple
|
||||
;;
|
||||
*)
|
||||
if [ -f /etc/debian_version ]; then
|
||||
BUILD=debian
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
BUILD=redhat
|
||||
elif [ -f /etc/slackware-version ] ; then
|
||||
BUILD=slackware
|
||||
elif [ -f /etc/SuSE-release ]; then
|
||||
BUILD=suse
|
||||
elif [ -f /etc/arch-release ] ; then
|
||||
BUILD=archlinux
|
||||
else
|
||||
BUILD=linux
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
case $BUILD in
|
||||
cygwin*)
|
||||
if [ -z "$DESTDIR" ]; then
|
||||
DEST=
|
||||
INIT=
|
||||
@@ -127,18 +159,16 @@ case $(uname) in
|
||||
|
||||
OWNER=$(id -un)
|
||||
GROUP=$(id -gn)
|
||||
CYGWIN=Yes
|
||||
;;
|
||||
Darwin)
|
||||
apple)
|
||||
if [ -z "$DESTDIR" ]; then
|
||||
DEST=
|
||||
INIT=
|
||||
SPARSE=Yes
|
||||
fi
|
||||
|
||||
[ -z "$OWNER" ] && OWNER=root
|
||||
[ -z "$GROUP" ] && GROUP=wheel
|
||||
MAC=Yes
|
||||
MACHOST=Yes
|
||||
INSTALLD=
|
||||
T=
|
||||
;;
|
||||
@@ -168,14 +198,6 @@ while [ $finished -eq 0 ]; do
|
||||
echo "Shorewall Firewall Installer Version $VERSION"
|
||||
exit 0
|
||||
;;
|
||||
a*)
|
||||
ANNOTATED=Yes
|
||||
option=${option#a}
|
||||
;;
|
||||
p*)
|
||||
ANNOTATED=
|
||||
option=${option#p}
|
||||
;;
|
||||
*)
|
||||
usage 1
|
||||
;;
|
||||
@@ -197,43 +219,30 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
|
||||
# Determine where to install the firewall script
|
||||
#
|
||||
|
||||
[ -n "$HOST" ] || HOST=$BUILD
|
||||
|
||||
case "$HOST" in
|
||||
cygwin)
|
||||
echo "Installing Cygwin-specific configuration..."
|
||||
;;
|
||||
apple)
|
||||
echo "Installing Mac-specific configuration...";
|
||||
;;
|
||||
debian|redhat|slackware|archlinux|linux|suse)
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: Unknown HOST \"$HOST\"" >&2
|
||||
exit 1;
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "$DESTDIR" ]; then
|
||||
if [ -z "$CYGWIN" ]; then
|
||||
if [ $BUILD != cygwin ]; then
|
||||
if [ `id -u` != 0 ] ; then
|
||||
echo "Not setting file owner/group permissions, not running as root."
|
||||
OWNERSHIP=""
|
||||
fi
|
||||
fi
|
||||
|
||||
install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
|
||||
install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
|
||||
|
||||
CYGWIN=
|
||||
MAC=
|
||||
else
|
||||
if [ -n "$CYGWIN" ]; then
|
||||
echo "Installing Cygwin-specific configuration..."
|
||||
elif [ -n "$MAC" ]; then
|
||||
echo "Installing Mac-specific configuration..."
|
||||
else
|
||||
if [ -f /etc/debian_version ]; then
|
||||
echo "Installing Debian-specific configuration..."
|
||||
DEBIAN=yes
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
echo "Installing Redhat/Fedora-specific configuration..."
|
||||
FEDORA=yes
|
||||
elif [ -f /etc/slackware-version ] ; then
|
||||
echo "Installing Slackware-specific configuration..."
|
||||
DEST="/etc/rc.d"
|
||||
MANDIR="/usr/man"
|
||||
SLACKWARE=yes
|
||||
elif [ -f /etc/arch-release ] ; then
|
||||
echo "Installing ArchLinux-specific configuration..."
|
||||
DEST="/etc/rc.d"
|
||||
INIT="shorewall"
|
||||
ARCHLINUX=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#
|
||||
@@ -247,7 +256,12 @@ echo "Installing Shorewall Core Version $VERSION"
|
||||
# Create /usr/share/shorewall
|
||||
#
|
||||
mkdir -p ${DESTDIR}${LIBEXEC}/shorewall
|
||||
chmod 755 ${DESTDIR}/usr/share/shorewall
|
||||
chmod 755 ${DESTDIR}${LIBEXEC}/shorewall
|
||||
|
||||
if [ $LIBEXEC != /usr/shorewall/ ]; then
|
||||
mkdir -p ${DESTDIR}/usr/share/shorewall
|
||||
chmod 755 ${DESTDIR}/usr/share/shorewall
|
||||
fi
|
||||
#
|
||||
# Install wait4ifup
|
||||
#
|
||||
@@ -263,6 +277,15 @@ for f in lib.* ; do
|
||||
install_file $f ${DESTDIR}/usr/share/shorewall/$f 0644
|
||||
echo "Library ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall/$f"
|
||||
done
|
||||
|
||||
if [ $BUILD != apple ]; then
|
||||
eval sed -i \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/usr/share/shorewall/lib.cli
|
||||
eval sed -i \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/usr/share/shorewall/lib.cli
|
||||
else
|
||||
eval sed -i \'\' -e \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/usr/share/shorewall/lib.cli
|
||||
eval sed -i \'\' -e \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/usr/share/shorewall/lib.cli
|
||||
fi
|
||||
|
||||
#
|
||||
# Symbolically link 'functions' to lib.base
|
||||
#
|
||||
|
@@ -1112,7 +1112,7 @@ do_dump_command() {
|
||||
echo " Shorewall $(cat /usr/share/shorewall/version)"
|
||||
echo
|
||||
fi
|
||||
|
||||
show_status
|
||||
show_reset
|
||||
host=$(echo $g_hostname | sed 's/\..*$//')
|
||||
$g_tool -L $g_ipt_options
|
||||
@@ -1957,6 +1957,8 @@ determine_capabilities() {
|
||||
CT_TARGET=
|
||||
STATISTIC_MATCH=
|
||||
IMQ_TARGET=
|
||||
DSCP_MATCH=
|
||||
DSCP_TARGET=
|
||||
|
||||
chain=fooX$$
|
||||
|
||||
@@ -2081,10 +2083,14 @@ determine_capabilities() {
|
||||
qt $g_tool -t mangle -A $chain -j CLASSIFY --set-class 1:1 && CLASSIFY_TARGET=Yes
|
||||
qt $g_tool -t mangle -A $chain -j IPMARK --addr src && IPMARK_TARGET=Yes
|
||||
qt $g_tool -t mangle -A $chain -p tcp -j TPROXY --on-port 0 --tproxy-mark 1 && TPROXY_TARGET=Yes
|
||||
qt $g_tool -t mangle -A $chain -j IMQ --todev 0 && IMQ_TARGET=Yes
|
||||
qt $g_tool -t mangle -A $chain -m dscp --dscp 0 && DSCP_MATCH=Yes
|
||||
qt $g_tool -t mangle -A $chain -j DSCP --set-dscp 0 && DSCP_TARGET=Yes
|
||||
|
||||
qt $g_tool -t mangle -F $chain
|
||||
qt $g_tool -t mangle -X $chain
|
||||
|
||||
qt $g_tool -t mangle -L FORWARD -n && MANGLE_FORWARD=Yes
|
||||
qt $g_tool -t mangle -A $chain -j IMQ --todev 0 && IMQ_TARGET=Yes
|
||||
fi
|
||||
|
||||
qt $g_tool -t raw -L -n && RAW_TABLE=Yes
|
||||
@@ -2267,6 +2273,8 @@ report_capabilities() {
|
||||
report_capability "Condition Match" $CONDITION_MATCH
|
||||
report_capability "Statistic Match" $STATISTIC_MATCH
|
||||
report_capability "IMQ Target" $IMQ_TARGET
|
||||
report_capability "DSCP Match" $DSCP_MATCH
|
||||
report_capability "DSCP Target" $DSCP_TARGET
|
||||
|
||||
if [ $g_family -eq 4 ]; then
|
||||
report_capability "iptables -S" $IPTABLES_S
|
||||
@@ -2354,14 +2362,14 @@ report_capabilities1() {
|
||||
report_capability1 CT_TARGET
|
||||
report_capability1 STATISTIC_MATCH
|
||||
report_capability1 IMQ_TARGET
|
||||
report_capability1 DSCP_MATCH
|
||||
report_capability1 DSCP_TARGET
|
||||
|
||||
echo CAPVERSION=$SHOREWALL_CAPVERSION
|
||||
echo KERNELVERSION=$KERNELVERSION
|
||||
}
|
||||
|
||||
status_command() {
|
||||
echo "${g_product}-$SHOREWALL_VERSION Status at $g_hostname - $(date)"
|
||||
echo
|
||||
show_status() {
|
||||
if product_is_started ; then
|
||||
echo "$g_product is running"
|
||||
status=0
|
||||
@@ -2381,6 +2389,12 @@ status_command() {
|
||||
state=Unknown
|
||||
fi
|
||||
echo "State:$state"
|
||||
}
|
||||
|
||||
status_command() {
|
||||
echo "${g_product}-$SHOREWALL_VERSION Status at $g_hostname - $(date)"
|
||||
echo
|
||||
show_status
|
||||
echo
|
||||
exit $status
|
||||
}
|
||||
|
@@ -86,21 +86,14 @@ install_file() # $1 = source $2 = target $3 = mode
|
||||
run_install $T $OWNERSHIP -m $3 $1 ${2}
|
||||
}
|
||||
|
||||
[ -n "$DESTDIR" ] || DESTDIR="$PREFIX"
|
||||
cd "$(dirname $0)"
|
||||
|
||||
# DEST is the SysVInit script directory
|
||||
# INIT is the name of the script in the $DEST directory
|
||||
# ARGS is "yes" if we've already parsed an argument
|
||||
#
|
||||
ARGS=""
|
||||
# Load packager's settings if any
|
||||
#
|
||||
[ -f ../shorewall-pkg.config ] && . ../shorewall-pkg.config
|
||||
|
||||
if [ -z "$DEST" ] ; then
|
||||
DEST="/etc/init.d"
|
||||
fi
|
||||
|
||||
if [ -z "$INIT" ] ; then
|
||||
INIT="shorewall-init"
|
||||
fi
|
||||
[ -n "$DESTDIR" ] || DESTDIR="$PREFIX"
|
||||
|
||||
while [ $# -gt 0 ] ; do
|
||||
case "$1" in
|
||||
@@ -116,7 +109,6 @@ while [ $# -gt 0 ] ; do
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
ARGS="yes"
|
||||
done
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
|
||||
@@ -127,75 +119,112 @@ case "$LIBEXEC" in
|
||||
/*)
|
||||
;;
|
||||
*)
|
||||
LIBEXEC=/usr/${LIBEXEC}
|
||||
echo "The LIBEXEC setting must be an absolute path name" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
#
|
||||
# Determine where to install the firewall script
|
||||
#
|
||||
INITFILE="shorewall-init"
|
||||
|
||||
case $(uname) in
|
||||
Darwin)
|
||||
[ -z "$OWNER" ] && OWNER=root
|
||||
[ -z "$GROUP" ] && GROUP=wheel
|
||||
if [ -z "$BUILD" ]; then
|
||||
case $(uname) in
|
||||
cygwin*)
|
||||
BUILD=cygwin
|
||||
;;
|
||||
Darwin)
|
||||
BUILD=apple
|
||||
;;
|
||||
*)
|
||||
if [ -f /etc/debian_version ]; then
|
||||
BUILD=debian
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
BUILD=redhat
|
||||
elif [ -f /etc/SuSE-release ]; then
|
||||
BUILD=suse
|
||||
elif [ -f /etc/slackware-version ] ; then
|
||||
BUILD=slackware
|
||||
elif [ -f /etc/arch-release ] ; then
|
||||
BUILD=archlinux
|
||||
else
|
||||
BUILD=linux
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
[ -n "$OWNER" ] || OWNER=$(id -un)
|
||||
[ -n "$GROUP" ] || GROUP=$(id -gn)
|
||||
|
||||
case $BUILD in
|
||||
apple)
|
||||
T=
|
||||
;;
|
||||
;;
|
||||
debian|redhat|suse|slackware|archlinux)
|
||||
;;
|
||||
*)
|
||||
[ -z "$OWNER" ] && OWNER=root
|
||||
[ -z "$GROUP" ] && GROUP=root
|
||||
[ -n "$BUILD" ] && echo "ERROR: Unknown BUILD environment ($BUILD)" >&2 || echo "ERROR: Unknown BUILD environment"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
OWNERSHIP="-o $OWNER -g $GROUP"
|
||||
|
||||
[ -n "$HOST" ] || HOST=$BUILD
|
||||
|
||||
case "$HOST" in
|
||||
debian)
|
||||
echo "Installing Debian-specific configuration..."
|
||||
SPARSE=yes
|
||||
;;
|
||||
redhat|redhat)
|
||||
echo "Installing Redhat/Fedora-specific configuration..."
|
||||
[ -n "$INITDIR" ] || INITDIR=/etc/rc.d/init.d
|
||||
;;
|
||||
slackware)
|
||||
echo "Shorewall-init is currently not supported on Slackware" >&2
|
||||
exit 1
|
||||
;;
|
||||
archlinux)
|
||||
echo "Shorewall-init is currently not supported on Arch Linux" >&2
|
||||
exit 1
|
||||
;;
|
||||
suse|suse)
|
||||
echo "Installing SuSE-specific configuration..."
|
||||
;;
|
||||
linux)
|
||||
echo "ERROR: Shorewall-init is not supported on this system" >&2
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: Unsupported HOST distribution: \"$HOST\"" >&2
|
||||
exit 1;
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -z "$TARGET" ] && TARGET=$HOST
|
||||
|
||||
if [ -z "$INITDIR" -a -n "$INITFILE" ] ; then
|
||||
INITDIR="/etc/init.d"
|
||||
fi
|
||||
|
||||
if [ -n "$DESTDIR" ]; then
|
||||
if [ `id -u` != 0 ] ; then
|
||||
echo "Not setting file owner/group permissions, not running as root."
|
||||
OWNERSHIP=""
|
||||
fi
|
||||
|
||||
install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
|
||||
elif [ -f /etc/debian_version ]; then
|
||||
DEBIAN=yes
|
||||
elif [ -f /etc/SuSE-release ]; then
|
||||
SUSE=Yes
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
FEDORA=Yes
|
||||
elif [ -f /etc/slackware-version ] ; then
|
||||
echo "Shorewall-init is currently not supported on Slackware" >&2
|
||||
exit 1
|
||||
# DEST="/etc/rc.d"
|
||||
# INIT="rc.firewall"
|
||||
elif [ -f /etc/arch-release ] ; then
|
||||
echo "Shorewall-init is currently not supported on Arch Linux" >&2
|
||||
exit 1
|
||||
# DEST="/etc/rc.d"
|
||||
# INIT="shorewall-init"
|
||||
# ARCHLINUX=yes
|
||||
elif [ -d /etc/sysconfig/network-scripts/ ]; then
|
||||
#
|
||||
# Assume RedHat-based
|
||||
#
|
||||
REDHAT=Yes
|
||||
else
|
||||
echo "Unknown distribution: Shorewall-init support is not available" >&2
|
||||
exit 1
|
||||
install -d $OWNERSHIP -m 755 ${DESTDIR}${INITDIR}
|
||||
fi
|
||||
|
||||
if [ -z "$DESTDIR" ]; then
|
||||
if [ -f /lib/systemd/system ]; then
|
||||
if [ -d /lib/systemd/system ]; then
|
||||
SYSTEMD=Yes
|
||||
INITFILE=
|
||||
fi
|
||||
elif [ -n "$SYSTEMD" ]; then
|
||||
mkdir -p ${DESTDIR}/lib/systemd/system
|
||||
INITFILE=
|
||||
fi
|
||||
|
||||
#
|
||||
# Change to the directory containing this script
|
||||
#
|
||||
cd "$(dirname $0)"
|
||||
|
||||
echo "Installing Shorewall Init Version $VERSION"
|
||||
|
||||
#
|
||||
@@ -207,27 +236,36 @@ else
|
||||
first_install="Yes"
|
||||
fi
|
||||
|
||||
#
|
||||
# Install the Init Script
|
||||
#
|
||||
if [ -n "$DEBIAN" ]; then
|
||||
install_file init.debian.sh ${DESTDIR}/etc/init.d/shorewall-init 0544
|
||||
elif [ -n "$FEDORA" ]; then
|
||||
install_file init.debian.sh ${DESTDIR}/etc/init.d/shorewall-init 0544
|
||||
#elif [ -n "$ARCHLINUX" ]; then
|
||||
# install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544
|
||||
else
|
||||
install_file init.sh ${DESTDIR}${DEST}/$INIT 0544
|
||||
if [ -n "$INITFILE" ]; then
|
||||
#
|
||||
# Install the Init Script
|
||||
#
|
||||
case $TARGET in
|
||||
debian)
|
||||
install_file init.debian.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
||||
;;
|
||||
redhat)
|
||||
install_file init.fedora.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
||||
;;
|
||||
*)
|
||||
install_file init.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Shorewall-init script installed in ${DESTDIR}${INITDIR}/${INITFILE}"
|
||||
fi
|
||||
|
||||
echo "Shorewall Init script installed in ${DESTDIR}${DEST}/$INIT"
|
||||
|
||||
#
|
||||
# Install the .service file
|
||||
#
|
||||
if [ -n "$SYSTEMD" ]; then
|
||||
run_install $OWNERSHIP -m 600 shorewall-init.service ${DESTDIR}/lib/systemd/system/shorewall-init.service
|
||||
echo "Service file installed as ${DESTDIR}/lib/systemd/system/shorewall-init.service"
|
||||
if [ -n "$DESTDIR" ]; then
|
||||
mkdir -p ${DESTDIR}/sbin/
|
||||
chmod 755 ${DESTDIR}/sbin
|
||||
fi
|
||||
run_install $OWNERSHIP -m 700 shorewall-init ${DESTDIR}/sbin/shorewall-init
|
||||
echo "CLI installed as ${DESTDIR}/sbin/shorewall-init"
|
||||
fi
|
||||
|
||||
#
|
||||
@@ -247,10 +285,10 @@ chmod 644 ${DESTDIR}/usr/share/shorewall-init/version
|
||||
#
|
||||
if [ -z "$DESTDIR" ]; then
|
||||
rm -f /usr/share/shorewall-init/init
|
||||
ln -s ${DEST}/${INIT} /usr/share/shorewall-init/init
|
||||
ln -s ${INITDIR}/${INITFILE} /usr/share/shorewall-init/init
|
||||
fi
|
||||
|
||||
if [ -n "$DEBIAN" ]; then
|
||||
if [ $HOST = debian ]; then
|
||||
if [ -n "${DESTDIR}" ]; then
|
||||
mkdir -p ${DESTDIR}/etc/network/if-up.d/
|
||||
mkdir -p ${DESTDIR}/etc/network/if-post-down.d/
|
||||
@@ -268,7 +306,7 @@ else
|
||||
mkdir -p ${DESTDIR}/etc/sysconfig
|
||||
|
||||
if [ -z "$RPM" ]; then
|
||||
if [ -n "$SUSE" ]; then
|
||||
if [ $HOST = suse ]; then
|
||||
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d
|
||||
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-down.d
|
||||
else
|
||||
@@ -294,24 +332,30 @@ if [ -d ${DESTDIR}/etc/NetworkManager ]; then
|
||||
install_file ifupdown.sh ${DESTDIR}/etc/NetworkManager/dispatcher.d/01-shorewall 0544
|
||||
fi
|
||||
|
||||
if [ -n "$DEBIAN" ]; then
|
||||
install_file ifupdown.sh ${DESTDIR}/etc/network/if-up.d/shorewall 0544
|
||||
install_file ifupdown.sh ${DESTDIR}/etc/network/if-post-down.d/shorewall 0544
|
||||
elif [ -n "$SUSE" ]; then
|
||||
install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-up.d/shorewall 0544
|
||||
install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-down.d/shorewall 0544
|
||||
elif [ -n "$REDHAT" ]; then
|
||||
if [ -f ${DESTDIR}/sbin/ifup-local -o -f ${DESTDIR}/sbin/ifdown-local ]; then
|
||||
echo "WARNING: /sbin/ifup-local and/or /sbin/ifdown-local already exist; up/down events will not be handled"
|
||||
else
|
||||
install_file ifupdown.sh ${DESTDIR}/sbin/ifup-local 0544
|
||||
install_file ifupdown.sh ${DESTDIR}/sbin/ifdown-local 0544
|
||||
fi
|
||||
fi
|
||||
case $HOST in
|
||||
debian)
|
||||
install_file ifupdown.sh ${DESTDIR}/etc/network/if-up.d/shorewall 0544
|
||||
install_file ifupdown.sh ${DESTDIR}/etc/network/if-post-down.d/shorewall 0544
|
||||
;;
|
||||
suse)
|
||||
if [ -z "$RPM" ]; then
|
||||
install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-up.d/shorewall 0544
|
||||
install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-down.d/shorewall 0544
|
||||
fi
|
||||
;;
|
||||
redhat)
|
||||
if [ -f ${DESTDIR}/sbin/ifup-local -o -f ${DESTDIR}/sbin/ifdown-local ]; then
|
||||
echo "WARNING: /sbin/ifup-local and/or /sbin/ifdown-local already exist; up/down events will not be handled"
|
||||
elif [ -z "$DESTDIR" ]; then
|
||||
install_file ifupdown.sh ${DESTDIR}/sbin/ifup-local 0544
|
||||
install_file ifupdown.sh ${DESTDIR}/sbin/ifdown-local 0544
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$DESTDIR" ]; then
|
||||
if [ -n "$first_install" ]; then
|
||||
if [ -n "$DEBIAN" ]; then
|
||||
if [ $HOST = debian ]; then
|
||||
|
||||
update-rc.d shorewall-init defaults
|
||||
|
||||
@@ -340,7 +384,7 @@ if [ -z "$DESTDIR" ]; then
|
||||
else
|
||||
cant_autostart
|
||||
fi
|
||||
elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically
|
||||
else
|
||||
cant_autostart
|
||||
fi
|
||||
|
||||
@@ -348,7 +392,7 @@ if [ -z "$DESTDIR" ]; then
|
||||
fi
|
||||
else
|
||||
if [ -n "$first_install" ]; then
|
||||
if [ -n "$DEBIAN" ]; then
|
||||
if [ $HOST = debian ]; then
|
||||
if [ -n "${DESTDIR}" ]; then
|
||||
mkdir -p ${DESTDIR}/etc/rcS.d
|
||||
fi
|
||||
@@ -360,31 +404,33 @@ else
|
||||
fi
|
||||
|
||||
if [ -f ${DESTDIR}/etc/ppp ]; then
|
||||
if [ -n "$DEBIAN" ] -o -n "$SUSE" ]; then
|
||||
for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do
|
||||
mkdir -p ${DESTDIR}/etc/ppp/$directory #SuSE doesn't create the IPv6 directories
|
||||
cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown ${DESTDIR}/etc/ppp/$directory/shorewall
|
||||
done
|
||||
elif [ -n "$REDHAT" ]; then
|
||||
#
|
||||
# Must use the dreaded ip_xxx.local file
|
||||
#
|
||||
for file in ip-up.local ip-down.local; do
|
||||
FILE=${DESTDIR}/etc/ppp/$file
|
||||
if [ -f $FILE ]; then
|
||||
if fgrep -q Shorewall-based $FILE ; then
|
||||
cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown $FILE
|
||||
case $HOST in
|
||||
debian|suse)
|
||||
for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do
|
||||
mkdir -p ${DESTDIR}/etc/ppp/$directory #SuSE doesn't create the IPv6 directories
|
||||
cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown ${DESTDIR}/etc/ppp/$directory/shorewall
|
||||
done
|
||||
;;
|
||||
redhat)
|
||||
#
|
||||
# Must use the dreaded ip_xxx.local file
|
||||
#
|
||||
for file in ip-up.local ip-down.local; do
|
||||
FILE=${DESTDIR}/etc/ppp/$file
|
||||
if [ -f $FILE ]; then
|
||||
if fgrep -q Shorewall-based $FILE ; then
|
||||
cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown $FILE
|
||||
else
|
||||
echo "$FILE already exists -- ppp devices will not be handled"
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo "$FILE already exists -- ppp devices will not be handled"
|
||||
break
|
||||
cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown $FILE
|
||||
fi
|
||||
else
|
||||
cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown $FILE
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
#
|
||||
# Report Success
|
||||
#
|
||||
|
97
Shorewall-init/shorewall-init
Normal file
97
Shorewall-init/shorewall-init
Normal file
@@ -0,0 +1,97 @@
|
||||
#! /bin/bash
|
||||
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V4.5
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2012 - Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# On most distributions, this file should be called /etc/init.d/shorewall.
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
#########################################################################################
|
||||
# check if shorewall-init is configured or not
|
||||
if [ -f "/etc/sysconfig/shorewall-init" ]; then
|
||||
. /etc/sysconfig/shorewall-init
|
||||
if [ -z "$PRODUCTS" ]; then
|
||||
echo "ERROR: No products configured" >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "ERROR: /etc/sysconfig/shorewall-init not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Initialize the firewall
|
||||
shorewall_start () {
|
||||
local PRODUCT
|
||||
local VARDIR
|
||||
|
||||
echo -n "Initializing \"Shorewall-based firewalls\": "
|
||||
for PRODUCT in $PRODUCTS; do
|
||||
VARDIR=/var/lib/$PRODUCT
|
||||
[ -f /etc/$PRODUCT/vardir ] && . /etc/$PRODUCT/vardir
|
||||
if [ -x ${VARDIR}/firewall ]; then
|
||||
if ! /sbin/$PRODUCT status > /dev/null 2>&1; then
|
||||
${VARDIR}/firewall stop || exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$SAVE_IPSETS" -a -f "$SAVE_IPSETS" ]; then
|
||||
ipset -R < "$SAVE_IPSETS"
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# Clear the firewall
|
||||
shorewall_stop () {
|
||||
local PRODUCT
|
||||
local VARDIR
|
||||
|
||||
echo -n "Clearing \"Shorewall-based firewalls\": "
|
||||
for PRODUCT in $PRODUCTS; do
|
||||
VARDIR=/var/lib/$PRODUCT
|
||||
[ -f /etc/$PRODUCT/vardir ] && . /etc/$PRODUCT/vardir
|
||||
if [ -x ${VARDIR}/firewall ]; then
|
||||
${VARDIR}/firewall clear || exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$SAVE_IPSETS" ]; then
|
||||
mkdir -p $(dirname "$SAVE_IPSETS")
|
||||
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
||||
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS"
|
||||
fi
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
shorewall_start
|
||||
;;
|
||||
stop)
|
||||
shorewall_stop
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
@@ -12,7 +12,7 @@ $(VARDIR)/${RESTOREFILE}: $(VARDIR)/firewall
|
||||
then \
|
||||
/sbin/shorewall-lite -q save >/dev/null; \
|
||||
else \
|
||||
/sbin/shorewall-lite -q restart 2>&1 | tail >&2; \
|
||||
/sbin/shorewall-lite -q restart 2>&1 | tail >&2; exit 1; \
|
||||
fi
|
||||
|
||||
# EOF
|
||||
|
@@ -76,10 +76,10 @@ command="$1"
|
||||
|
||||
case "$command" in
|
||||
start)
|
||||
exec /sbin/shorewall-lite $OPTIONS start $STARTOPTIONS $@
|
||||
exec /sbin/shorewall-lite $OPTIONS start $STARTOPTIONS
|
||||
;;
|
||||
restart|reload)
|
||||
exec /sbin/shorewall-lite $OPTIONS restart $RESTARTOPTIONS $@
|
||||
exec /sbin/shorewall-lite $OPTIONS restart $RESTARTOPTIONS
|
||||
;;
|
||||
status|stop)
|
||||
exec /sbin/shorewall-lite $OPTIONS $command $@
|
||||
|
@@ -90,6 +90,11 @@ install_file() # $1 = source $2 = target $3 = mode
|
||||
#
|
||||
cd "$(dirname $0)"
|
||||
|
||||
#
|
||||
# Load packager's settings if any
|
||||
#
|
||||
[ -f ../shorewall-pkg.config ] && . ../shorewall-pkg.config
|
||||
|
||||
if [ -f shorewall-lite ]; then
|
||||
PRODUCT=shorewall-lite
|
||||
Product="Shorewall Lite"
|
||||
@@ -103,17 +108,6 @@ fi
|
||||
#
|
||||
# Parse the run line
|
||||
#
|
||||
# DEST is the SysVInit script directory
|
||||
# INIT is the name of the script in the $DEST directory
|
||||
#
|
||||
if [ -z "$DEST" ] ; then
|
||||
DEST="/etc/init.d"
|
||||
fi
|
||||
|
||||
if [ -z "$INIT" ] ; then
|
||||
INIT="$PRODUCT"
|
||||
fi
|
||||
|
||||
while [ $# -gt 0 ] ; do
|
||||
case "$1" in
|
||||
-h|help|?)
|
||||
@@ -138,31 +132,56 @@ case "$LIBEXEC" in
|
||||
/*)
|
||||
;;
|
||||
*)
|
||||
LIBEXEC=/usr/${LIBEXEC}
|
||||
echo "The LIBEXEC setting must be an absolute path name" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
#
|
||||
# Determine where to install the firewall script
|
||||
#
|
||||
CYGWIN=
|
||||
cygwin=
|
||||
INSTALLD='-D'
|
||||
INITFILE=$PRODUCT
|
||||
T='-T'
|
||||
|
||||
case $(uname) in
|
||||
CYGWIN*)
|
||||
if [ -z "$DESTDIR" ]; then
|
||||
DEST=
|
||||
INIT=
|
||||
fi
|
||||
if [ -z "$BUILD" ]; then
|
||||
case $(uname) in
|
||||
cygwin*)
|
||||
BUILD=cygwin
|
||||
;;
|
||||
Darwin)
|
||||
BUILD=apple
|
||||
;;
|
||||
*)
|
||||
if [ -f /etc/debian_version ]; then
|
||||
BUILD=debian
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
BUILD=redhat
|
||||
elif [ -f /etc/SuSE-release ]; then
|
||||
BUILD=suse
|
||||
elif [ -f /etc/slackware-version ] ; then
|
||||
BUILD=slackware
|
||||
elif [ -f /etc/arch-release ] ; then
|
||||
BUILD=archlinux
|
||||
else
|
||||
BUILD=linux
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
case $BUILD in
|
||||
cygwin*)
|
||||
OWNER=$(id -un)
|
||||
GROUP=$(id -gn)
|
||||
;;
|
||||
Darwin)
|
||||
apple)
|
||||
[ -z "$OWNER" ] && OWNER=root
|
||||
[ -z "$GROUP" ] && GROUP=wheel
|
||||
INSTALLD=
|
||||
T=
|
||||
;;
|
||||
;;
|
||||
*)
|
||||
[ -z "$OWNER" ] && OWNER=root
|
||||
[ -z "$GROUP" ] && GROUP=root
|
||||
@@ -171,6 +190,45 @@ esac
|
||||
|
||||
OWNERSHIP="-o $OWNER -g $GROUP"
|
||||
|
||||
[ -n "$HOST" ] || HOST=$BUILD
|
||||
|
||||
case "$HOST" in
|
||||
cygwin)
|
||||
echo "$PRODUCT is not supported on Cygwin" >&2
|
||||
exit 1
|
||||
;;
|
||||
apple)
|
||||
echo "$PRODUCT is not supported on OS X" >&2
|
||||
exit 1
|
||||
;;
|
||||
debian)
|
||||
echo "Installing Debian-specific configuration..."
|
||||
SPARSE=yes
|
||||
;;
|
||||
redhat)
|
||||
echo "Installing Redhat/Fedora-specific configuration..."
|
||||
[ -n "$INITDIR" ] || INITDIR=/etc/rc.d/init.d
|
||||
;;
|
||||
slackware)
|
||||
echo "Installing Slackware-specific configuration..."
|
||||
[ -n "$INITDIR" ] || INITDIR="/etc/rc.d"
|
||||
[ -n "$INITFILE" ] || INITFILE="rc.firewall"
|
||||
[ -n "$MANDIR=" ] || MANDIR=/usr/man
|
||||
;;
|
||||
archlinux)
|
||||
echo "Installing ArchLinux-specific configuration..."
|
||||
[ -n "$INITDIR" ] || INITDIR="/etc/rc.d"
|
||||
;;
|
||||
linux|suse)
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: Unknown HOST \"$HOST\"" >&2
|
||||
exit 1;
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -z "$INITDIR" ] && INITDIR="/etc/init.d"
|
||||
|
||||
if [ -n "$DESTDIR" ]; then
|
||||
if [ `id -u` != 0 ] ; then
|
||||
echo "Not setting file owner/group permissions, not running as root."
|
||||
@@ -178,21 +236,13 @@ if [ -n "$DESTDIR" ]; then
|
||||
fi
|
||||
|
||||
install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
|
||||
install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
|
||||
elif [ -d /etc/apt -a -e /usr/bin/dpkg ]; then
|
||||
DEBIAN=yes
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
FEDORA=yes
|
||||
elif [ -f /etc/slackware-version ] ; then
|
||||
DEST="/etc/rc.d"
|
||||
INIT="rc.firewall"
|
||||
elif [ -f /etc/arch-release ] ; then
|
||||
DEST="/etc/rc.d"
|
||||
INIT="$PRODUCT"
|
||||
ARCHLINUX=yes
|
||||
fi
|
||||
install -d $OWNERSHIP -m 755 ${DESTDIR}${DESTFILE}
|
||||
|
||||
if [ -z "$DESTDIR" ]; then
|
||||
if [ -n "$SYSTEMD" ]; then
|
||||
mkdir -p ${DESTDIR}/lib/systemd/system
|
||||
INITFILE=
|
||||
fi
|
||||
else
|
||||
if [ ! -f /usr/share/shorewall/coreversion ]; then
|
||||
echo "$PRODUCT $VERSION requires Shorewall Core which does not appear to be installed" >&2
|
||||
exit 1
|
||||
@@ -200,9 +250,8 @@ if [ -z "$DESTDIR" ]; then
|
||||
|
||||
if [ -f /lib/systemd/system ]; then
|
||||
SYSTEMD=Yes
|
||||
INITFILE=
|
||||
fi
|
||||
elif [ -n "$SYSTEMD" ]; then
|
||||
mkdir -p ${DESTDIR}/lib/systemd/system
|
||||
fi
|
||||
|
||||
echo "Installing $Product Version $VERSION"
|
||||
@@ -222,7 +271,7 @@ else
|
||||
rm -rf ${DESTDIR}/etc/$PRODUCT
|
||||
rm -rf ${DESTDIR}/usr/share/$PRODUCT
|
||||
rm -rf ${DESTDIR}/var/lib/$PRODUCT
|
||||
[ "$LIBEXEC" = /usr/share ] || rm -rf /usr/share/$PRODUCT/wait4ifup /usr/share/$PRODUCT/shorecap
|
||||
[ "$LIBEXEC" = /usr/share ] || rm -rf ${DESTDIR}/usr/share/$PRODUCT/wait4ifup ${DESTDIR}/usr/share/$PRODUCT/shorecap
|
||||
fi
|
||||
|
||||
#
|
||||
@@ -238,25 +287,8 @@ delete_file ${DESTDIR}/usr/share/$PRODUCT/xmodules
|
||||
|
||||
install_file $PRODUCT ${DESTDIR}/sbin/$PRODUCT 0544
|
||||
|
||||
eval sed -i \'``s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/sbin/$PRODUCT
|
||||
|
||||
echo "$Product control program installed in ${DESTDIR}/sbin/$PRODUCT"
|
||||
|
||||
#
|
||||
# Install the Firewall Script
|
||||
#
|
||||
if [ -n "$DEBIAN" ]; then
|
||||
install_file init.debian.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544
|
||||
elif [ -n "$FEDORA" ]; then
|
||||
install_file init.fedora.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544
|
||||
elif [ -n "$ARCHLINUX" ]; then
|
||||
install_file init.archlinux.sh ${DESTDIR}/${DEST}/$INIT 0544
|
||||
else
|
||||
install_file init.sh ${DESTDIR}/${DEST}/$INIT 0544
|
||||
fi
|
||||
|
||||
echo "$Product script installed in ${DESTDIR}${DEST}/$INIT"
|
||||
|
||||
#
|
||||
# Create /etc/$PRODUCT, /usr/share/$PRODUCT and /var/lib/$PRODUCT if needed
|
||||
#
|
||||
@@ -271,8 +303,28 @@ chmod 755 ${DESTDIR}/usr/share/$PRODUCT
|
||||
if [ -n "$DESTDIR" ]; then
|
||||
mkdir -p ${DESTDIR}/etc/logrotate.d
|
||||
chmod 755 ${DESTDIR}/etc/logrotate.d
|
||||
mkdir -p ${DESTDIR}${INITDIR}
|
||||
chmod 755 ${DESTDIR}${INITDIR}
|
||||
fi
|
||||
|
||||
if [ -n "$INITFILE" ]; then
|
||||
case $TARGET in
|
||||
debian)
|
||||
install_file init.debian.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
||||
;;
|
||||
redhat)
|
||||
install_file init.fedora.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
||||
;;
|
||||
archlinux)
|
||||
install_file init.archlinux.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
||||
;;
|
||||
*)
|
||||
install_file init.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "$Product init script installed in ${DESTDIR}${INITDIR}/${INITFILE}"
|
||||
fi
|
||||
#
|
||||
# Install the .service file
|
||||
#
|
||||
@@ -289,7 +341,7 @@ if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
|
||||
echo "Config file installed as ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf"
|
||||
fi
|
||||
|
||||
if [ -n "$ARCHLINUX" ] ; then
|
||||
if [ $HOST = archlinux ] ; then
|
||||
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
|
||||
fi
|
||||
|
||||
@@ -389,7 +441,7 @@ chmod 644 ${DESTDIR}/usr/share/$PRODUCT/version
|
||||
|
||||
if [ -z "$DESTDIR" ]; then
|
||||
rm -f /usr/share/$PRODUCT/init
|
||||
ln -s ${DEST}/${INIT} /usr/share/$PRODUCT/init
|
||||
ln -s ${INITDIR}/${INITFILE} /usr/share/$PRODUCT/init
|
||||
fi
|
||||
|
||||
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.common
|
||||
@@ -400,7 +452,7 @@ if [ -z "$DESTDIR" ]; then
|
||||
touch /var/log/$PRODUCT-init.log
|
||||
|
||||
if [ -n "$first_install" ]; then
|
||||
if [ -n "$DEBIAN" ]; then
|
||||
if [ $HOST = debian ]; then
|
||||
run_install $OWNERSHIP -m 0644 default.debian /etc/default/$PRODUCT
|
||||
|
||||
update-rc.d $PRODUCT defaults
|
||||
@@ -436,7 +488,7 @@ if [ -z "$DESTDIR" ]; then
|
||||
else
|
||||
cant_autostart
|
||||
fi
|
||||
elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically
|
||||
elif [ "$INITFILE" != rc.firewall ]; then #Slackware starts this automatically
|
||||
cant_autostart
|
||||
fi
|
||||
fi
|
||||
|
@@ -11,11 +11,27 @@
|
||||
<refnamediv>
|
||||
<refname>shorewall-lite</refname>
|
||||
|
||||
<refpurpose>Administration tool for Shoreline Firewall Lite
|
||||
(Shorewall-lite)</refpurpose>
|
||||
<refpurpose>Administration tool for Shoreline Firewall Lite (Shorewall
|
||||
Lite)</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>shorewall-lite</command>
|
||||
|
||||
<arg
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
|
||||
<arg rep="norepeat">-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>add</option></arg>
|
||||
|
||||
<arg choice="plain"
|
||||
rep="repeat"><replaceable>interface</replaceable>[:<replaceable>host-list</replaceable>]</arg>
|
||||
|
||||
<arg choice="plain"><replaceable>zone</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall-lite</command>
|
||||
|
||||
@@ -37,11 +53,28 @@
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>clear</option></arg>
|
||||
<arg
|
||||
choice="plain"><option>clear</option><arg><option>-f</option></arg></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall</command>
|
||||
<command>shorewall-lite</command>
|
||||
|
||||
<arg
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
|
||||
<arg rep="norepeat">-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>delete</option></arg>
|
||||
|
||||
<arg choice="plain"
|
||||
rep="repeat"><replaceable>interface</replaceable>[:<replaceable>host-list</replaceable>]</arg>
|
||||
|
||||
<arg choice="plain"><replaceable>zone</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall-lite</command>
|
||||
|
||||
<arg
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
@@ -50,7 +83,8 @@
|
||||
|
||||
<arg choice="plain"><option>disable</option></arg>
|
||||
|
||||
<arg choice="plain"><replaceable>interface</replaceable></arg>
|
||||
<arg choice="plain">{ <replaceable>interface</replaceable> |
|
||||
<replaceable>provider</replaceable> }</arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
@@ -63,8 +97,7 @@
|
||||
|
||||
<arg choice="plain"><option>drop</option></arg>
|
||||
|
||||
<arg choice="plain">{ <replaceable>interface</replaceable> |
|
||||
<replaceable>provider</replaceable> }</arg>
|
||||
<arg choice="plain"><replaceable>address</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
@@ -78,11 +111,13 @@
|
||||
|
||||
<arg><option>-x</option></arg>
|
||||
|
||||
<arg><option>-l</option></arg>
|
||||
|
||||
<arg><option>-m</option></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall</command>
|
||||
<command>shorewall-lite</command>
|
||||
|
||||
<arg
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
@@ -98,7 +133,8 @@
|
||||
<cmdsynopsis>
|
||||
<command>shorewall-lite</command>
|
||||
|
||||
<arg choice="opt"><option>trace</option>|<option>debug</option></arg>
|
||||
<arg
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
@@ -124,7 +160,8 @@
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>hits</option></arg>
|
||||
<arg
|
||||
choice="plain"><option>hits</option><arg><option>-t</option></arg></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
@@ -158,6 +195,19 @@
|
||||
choice="plain"><replaceable>address1</replaceable><option>-</option><replaceable>address2</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall-lite</command>
|
||||
|
||||
<arg choice="opt"><option>trace</option>|<option>debug</option></arg>
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>iptrace</option></arg>
|
||||
|
||||
<arg choice="plain"><replaceable>iptables match
|
||||
expression</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall-lite</command>
|
||||
|
||||
@@ -198,6 +248,19 @@
|
||||
<arg choice="plain"><replaceable>address</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall-lite</command>
|
||||
|
||||
<arg choice="opt"><option>trace</option>|<option>debug</option></arg>
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>noiptrace</option></arg>
|
||||
|
||||
<arg choice="plain"><replaceable>iptables match
|
||||
expression</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall-lite</command>
|
||||
|
||||
@@ -219,8 +282,24 @@
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>reset</option></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall-lite</command>
|
||||
|
||||
<arg
|
||||
choice="plain"><option>restart</option><arg><option>-n</option></arg><arg><option>-p</option></arg></arg>
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>restart</option></arg>
|
||||
|
||||
<arg><option>-n</option></arg>
|
||||
|
||||
<arg><option>-p</option></arg>
|
||||
|
||||
<arg><replaceable>directory</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
@@ -260,8 +339,10 @@
|
||||
|
||||
<arg><option>-x</option></arg>
|
||||
|
||||
<arg><option>-l</option></arg>
|
||||
|
||||
<arg><option>-t</option>
|
||||
{<option>filter</option>|<option>mangle</option>|<option>nat</option>|<option>raw</option>}</arg>
|
||||
{<option>filter</option>|<option>mangle</option>|<option>nat</option>|<option>raw|rawpost</option>}</arg>
|
||||
|
||||
<arg><arg><option>chain</option></arg><arg choice="plain"
|
||||
rep="repeat"><replaceable>chain</replaceable></arg></arg>
|
||||
@@ -291,7 +372,7 @@
|
||||
<arg choice="plain"><option>show</option></arg>
|
||||
|
||||
<arg
|
||||
choice="req"><option>actions|classifiers|connections|config|zones</option></arg>
|
||||
choice="req"><option>classifiers|connections|config|filters|ip|ipa|zones|policies|marks</option></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
@@ -305,7 +386,7 @@
|
||||
|
||||
<arg><option>-x</option></arg>
|
||||
|
||||
<arg choice="req"><option>mangle|nat</option></arg>
|
||||
<arg choice="req"><option>mangle|nat|routing|raw|rawpost</option></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
@@ -346,7 +427,7 @@
|
||||
|
||||
<arg><option>-n</option></arg>
|
||||
|
||||
<arg><option>-f</option><arg><option>-p</option></arg></arg>
|
||||
<arg><option>-p</option></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
@@ -377,7 +458,8 @@
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>version</option></arg>
|
||||
<arg
|
||||
choice="plain"><option>version</option><arg><option>-a</option></arg></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
@@ -385,7 +467,7 @@
|
||||
<title>Description</title>
|
||||
|
||||
<para>The shorewall-lite utility is used to control the Shoreline Firewall
|
||||
(Shorewall) Lite.</para>
|
||||
Lite (Shorewall Lite).</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
@@ -393,12 +475,12 @@
|
||||
|
||||
<para>The <option>trace</option> and <option>debug</option> options are
|
||||
used for debugging. See <ulink
|
||||
url="http://www.shorewall.net/starting_and_stopping.htm#Trace">http://www.shorewall.net/starting_and_stopping.htm#Trace</ulink>.</para>
|
||||
url="http://www.shorewall.net/starting_and_stopping_shorewall.htm#Trace">http://www.shorewall.net/starting_and_stopping_shorewall.htm#Trace</ulink>.</para>
|
||||
|
||||
<para>The nolock <option>option</option> prevents the command from
|
||||
attempting to acquire the Shorewall Lite lockfile. It is useful if you
|
||||
need to include <command>shorewall-lite</command> commands in the
|
||||
<filename>started</filename> extension script.</para>
|
||||
attempting to acquire the Shorewall-lite lockfile. It is useful if you
|
||||
need to include <command>shorewall</command> commands in
|
||||
<filename>/etc/shorewall/started</filename>.</para>
|
||||
|
||||
<para>The <emphasis>options</emphasis> control the amount of output that
|
||||
the command produces. They consist of a sequence of the letters <emphasis
|
||||
@@ -435,15 +517,17 @@
|
||||
defined in the <ulink
|
||||
url="shorewall-interfaces.html">shorewall-interfaces</ulink>(5)
|
||||
file. A <emphasis>host-list</emphasis> is comma-separated list whose
|
||||
elements are a host or network address.<caution>
|
||||
<para>The <command>add</command> command is not very robust. If
|
||||
there are errors in the <replaceable>host-list</replaceable>,
|
||||
you may see a large number of error messages yet a subsequent
|
||||
<command>shorewall show zones</command> command will indicate
|
||||
that all hosts were added. If this happens, replace
|
||||
<command>add</command> by <command>delete</command> and run the
|
||||
same command again. Then enter the correct command.</para>
|
||||
</caution></para>
|
||||
elements are host or network addresses.</para>
|
||||
|
||||
<caution>
|
||||
<para>The <command>add</command> command is not very robust. If
|
||||
there are errors in the <replaceable>host-list</replaceable>, you
|
||||
may see a large number of error messages yet a subsequent
|
||||
<command>shorewall-lite show zones</command> command will indicate
|
||||
that all hosts were added. If this happens, replace
|
||||
<command>add</command> by <command>delete</command> and run the
|
||||
same command again. Then enter the correct command.</para>
|
||||
</caution>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -463,10 +547,16 @@
|
||||
<term><emphasis role="bold">clear</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Clear will remove all rules and chains installed by Shorewall
|
||||
Lite. The firewall is then wide open and unprotected. Existing
|
||||
connections are untouched. Clear is often used to see if the
|
||||
firewall is causing connection problems.</para>
|
||||
<para>Clear will remove all rules and chains installed by
|
||||
Shorewall-lite. The firewall is then wide open and unprotected.
|
||||
Existing connections are untouched. Clear is often used to see if
|
||||
the firewall is causing connection problems.</para>
|
||||
|
||||
<para>If <option>-f</option> is given, the command will be processed
|
||||
by the compiled script that executed the last successful <emphasis
|
||||
role="bold">start</emphasis>, <emphasis
|
||||
role="bold">restart</emphasis> or <emphasis
|
||||
role="bold">refresh</emphasis> command if that script exists.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -516,8 +606,11 @@
|
||||
<para>The <emphasis role="bold">-x</emphasis> option causes actual
|
||||
packet and byte counts to be displayed. Without that option, these
|
||||
counts are abbreviated. The <emphasis role="bold">-m</emphasis>
|
||||
option causes any MAC addresses included in Shorewall Lite log
|
||||
option causes any MAC addresses included in Shorewall-lite log
|
||||
messages to be displayed.</para>
|
||||
|
||||
<para>The <emphasis role="bold">-l</emphasis> option causes the rule
|
||||
number for each Netfilter rule to be displayed.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -541,7 +634,7 @@
|
||||
and /var/lib/shorewall-lite/save. If no
|
||||
<emphasis>filename</emphasis> is given then the file specified by
|
||||
RESTOREFILE in <ulink
|
||||
url="shorewall-lite.conf.html">shorewall-lite.conf</ulink>(5) is
|
||||
url="shorewall.conf.html">shorewall.conf</ulink>(5) is
|
||||
assumed.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -558,8 +651,9 @@
|
||||
<term><emphasis role="bold">hits</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Generates several reports from Shorewall Lite log messages in
|
||||
the current log file.</para>
|
||||
<para>Generates several reports from Shorewall-lite log messages in
|
||||
the current log file. If the <option>-t</option> option is included,
|
||||
the reports are restricted to log messages generated today.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -582,12 +676,33 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">iptrace</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>This is a low-level debugging command that causes iptables
|
||||
TRACE log records to be created. See iptables(8) for details.</para>
|
||||
|
||||
<para>The <replaceable>iptables match expression</replaceable> must
|
||||
be one or more matches that may appear in both the raw table OUTPUT
|
||||
and raw table PREROUTING chains.</para>
|
||||
|
||||
<para>The trace records are written to the kernel's log buffer with
|
||||
faciility = kernel and priority = warning, and they are routed from
|
||||
there by your logging daemon (syslogd, rsyslog, syslog-ng, ...) --
|
||||
Shorewall-lite has no control over where the messages go; consult
|
||||
your logging daemon's documentation.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">logdrop</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Causes traffic from the listed <emphasis>address</emphasis>es
|
||||
to be logged then discarded.</para>
|
||||
to be logged then discarded. Logging occurs at the log level
|
||||
specified by the BLACKLIST_LOGLEVEL setting in <ulink
|
||||
url="shorewall.conf.html">shorewall.conf</ulink> (5).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -595,9 +710,9 @@
|
||||
<term><emphasis role="bold">logwatch</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Monitors the log file specified by theLOGFILE option in <ulink
|
||||
url="shorewall-lite.conf.html">shorewall-lite.conf</ulink>(5) and
|
||||
produces an audible alarm when new Shorewall Lite messages are
|
||||
<para>Monitors the log file specified by the LOGFILE option in
|
||||
<ulink url="shorewall.conf.html">shorewall.conf</ulink>(5) and
|
||||
produces an audible alarm when new Shorewall-lite messages are
|
||||
logged. The <emphasis role="bold">-m</emphasis> option causes the
|
||||
MAC address of each packet source to be displayed if that
|
||||
information is available. The
|
||||
@@ -615,7 +730,22 @@
|
||||
|
||||
<listitem>
|
||||
<para>Causes traffic from the listed <emphasis>address</emphasis>es
|
||||
to be logged then rejected.</para>
|
||||
to be logged then rejected. Logging occurs at the log level
|
||||
specified by the BLACKLIST_LOGLEVEL setting in <ulink
|
||||
url="shorewall.conf.html">shorewall.conf</ulink> (5).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">noiptrace</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>This is a low-level debugging command that cancels a trace
|
||||
started by a preceding <command>iptrace</command> command.</para>
|
||||
|
||||
<para>The <replaceable>iptables match expression</replaceable> must
|
||||
be one given in the <command>iptrace</command> command being
|
||||
cancelled.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -633,10 +763,10 @@
|
||||
|
||||
<listitem>
|
||||
<para>Restart is similar to <emphasis role="bold">shorewall-lite
|
||||
start</emphasis> but assumes that the firewall is already started.
|
||||
Existing connections are maintained.</para>
|
||||
start</emphasis> except that it assumes that the firewall is already
|
||||
started. Existing connections are maintained.</para>
|
||||
|
||||
<para>The <option>-n</option> option causes Shorewall to avoid
|
||||
<para>The <option>-n</option> option causes Shorewall-lite to avoid
|
||||
updating the routing table(s).</para>
|
||||
|
||||
<para>The <option>-p</option> option causes the connection tracking
|
||||
@@ -649,14 +779,14 @@
|
||||
<term><emphasis role="bold">restore</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Restore Shorewall Lite to a state saved using the <emphasis
|
||||
<para>Restore Shorewall-lite to a state saved using the <emphasis
|
||||
role="bold">shorewall-lite save</emphasis> command. Existing
|
||||
connections are maintained. The <emphasis>filename</emphasis> names
|
||||
a restore file in /var/lib/shorewall-lite created using <emphasis
|
||||
role="bold">shorewall-lite save</emphasis>; if no
|
||||
<emphasis>filename</emphasis> is given then Shorewall Lite will be
|
||||
<emphasis>filename</emphasis> is given then Shorewall-lite will be
|
||||
restored from the file specified by the RESTOREFILE option in <ulink
|
||||
url="shorewall-lite.conf.html">shorewall-lite.conf</ulink>(5).</para>
|
||||
url="shorewall.conf.html">shorewall.conf</ulink>(5).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -667,11 +797,10 @@
|
||||
<para>The dynamic blacklist is stored in
|
||||
/var/lib/shorewall-lite/save. The state of the firewall is stored in
|
||||
/var/lib/shorewall-lite/<emphasis>filename</emphasis> for use by the
|
||||
<emphasis role="bold">shorewall-lite restore</emphasis> and
|
||||
<emphasis role="bold">shorewall-lite -f start</emphasis> commands.
|
||||
If <emphasis>filename</emphasis> is not given then the state is
|
||||
saved in the file specified by the RESTOREFILE option in <ulink
|
||||
url="shorewall-lite.conf.html">shorewall-lite.conf</ulink>(5).</para>
|
||||
<emphasis role="bold">shorewall-lite restore</emphasis>. If
|
||||
<emphasis>filename</emphasis> is not given then the state is saved
|
||||
in the file specified by the RESTOREFILE option in <ulink
|
||||
url="shorewall.conf.html">shorewall.conf</ulink>(5).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -683,15 +812,6 @@
|
||||
arguments:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">actions</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Produces a report about the available actions (built-in,
|
||||
standard and user-defined).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">capabilities</emphasis></term>
|
||||
|
||||
@@ -704,8 +824,8 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>[ [ <option>chain</option> ] <emphasis>chain</emphasis>
|
||||
... ]</term>
|
||||
<term>[ [ <option>chain</option> ] <emphasis>chain</emphasis>...
|
||||
]</term>
|
||||
|
||||
<listitem>
|
||||
<para>The rules in each <emphasis>chain</emphasis> are
|
||||
@@ -721,20 +841,25 @@
|
||||
Netfilter table to display. The default is <emphasis
|
||||
role="bold">filter</emphasis>.</para>
|
||||
|
||||
<para>The <emphasis role="bold">-l</emphasis> option causes
|
||||
the rule number for each Netfilter rule to be
|
||||
displayed.</para>
|
||||
|
||||
<para>If the <emphasis role="bold">t</emphasis> option and the
|
||||
<option>chain</option> keyword are both omitted and any of the
|
||||
listed <replaceable>chain</replaceable>s do not exist, a usage
|
||||
message will be displayed.</para>
|
||||
message is displayed.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">classifiers</emphasis></term>
|
||||
<term><emphasis
|
||||
role="bold">classifiers|filters</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays information about the packet classifiers
|
||||
defined on the system 10-080213-8397as a result of traffic
|
||||
shaping configuration.</para>
|
||||
defined on the system as a result of traffic shaping
|
||||
configuration.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -756,15 +881,44 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">mangle</emphasis></term>
|
||||
<term><emphasis role="bold">ip</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays the Netfilter mangle table using the command
|
||||
<emphasis role="bold">iptables -t mangle -L -n
|
||||
-v</emphasis>.The <emphasis role="bold">-x</emphasis> option
|
||||
is passed directly through to iptables and causes actual
|
||||
packet and byte counts to be displayed. Without this option,
|
||||
those counts are abbreviated.</para>
|
||||
<para>Displays the system's IPv4 configuration.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">ipa</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.4.17. Displays the per-IP
|
||||
accounting counters (<ulink
|
||||
url="manpages/shorewall-accounting.html">shorewall-accounting</ulink>
|
||||
(5)).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">log</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays the last 20 Shorewall-lite messages from the
|
||||
log file specified by the LOGFILE option in <ulink
|
||||
url="shorewall.conf.html">shorewall.conf</ulink>(5). The
|
||||
<emphasis role="bold">-m</emphasis> option causes the MAC
|
||||
address of each packet source to be displayed if that
|
||||
information is available.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">marks</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.4.26. Displays the various fields
|
||||
in packet marks giving the min and max value (in both decimal
|
||||
and hex) and the applicable mask (in hex).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -781,6 +935,39 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">policies</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.4.4. Displays the applicable policy
|
||||
between each pair of zones. Note that implicit intrazone
|
||||
ACCEPT policies are not displayed for zones associated with a
|
||||
single network where that network doesn't specify
|
||||
<option>routeback</option>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">routing</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays the system's IPv4 routing configuration.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">raw</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays the Netfilter raw table using the command
|
||||
<emphasis role="bold">iptables -t raw -L -n -v</emphasis>.The
|
||||
<emphasis role="bold">-x</emphasis> option is passed directly
|
||||
through to iptables and causes actual packet and byte counts
|
||||
to be displayed. Without this option, those counts are
|
||||
abbreviated.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">tc</emphasis></term>
|
||||
|
||||
@@ -794,8 +981,8 @@
|
||||
<term><emphasis role="bold">zones</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays the current composition of the Shorewall Lite
|
||||
zones on the system.</para>
|
||||
<para>Displays the current composition of the Shorewall zones
|
||||
on the system.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -806,17 +993,10 @@
|
||||
<term><emphasis role="bold">start</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Start shorewall Lite. Existing connections through
|
||||
<para>Start Shorewall Lite. Existing connections through
|
||||
shorewall-lite managed interfaces are untouched. New connections
|
||||
will be allowed only if they are allowed by the firewall rules or
|
||||
policies. If <emphasis role="bold">-f</emphasis> is specified, the
|
||||
saved configuration specified by the RESTOREFILE option in <ulink
|
||||
url="shorewall-lite.conf.html">shorewall-lite.conf</ulink>(5) will
|
||||
be restored if that saved configuration exists and has been modified
|
||||
more recently than the files in /etc/shorewall.</para>
|
||||
|
||||
<para>The <option>-n</option> option causes Shorewall to avoid
|
||||
updating the routing table(s).</para>
|
||||
policies.</para>
|
||||
|
||||
<para>The <option>-p</option> option causes the connection tracking
|
||||
table to be flushed; the <command>conntrack</command> utility must
|
||||
@@ -831,11 +1011,18 @@
|
||||
<para>Stops the firewall. All existing connections, except those
|
||||
listed in <ulink
|
||||
url="shorewall-routestopped.html">shorewall-routestopped</ulink>(5)
|
||||
or permitted by the ADMINISABSENTMINDED option in shorewall.conf(5),
|
||||
are taken down. The only new traffic permitted through the firewall
|
||||
is from systems listed in <ulink
|
||||
or permitted by the ADMINISABSENTMINDED option in <ulink
|
||||
url="shorewall.conf.html">shorewall.conf</ulink>(5), are taken down.
|
||||
The only new traffic permitted through the firewall is from systems
|
||||
listed in <ulink
|
||||
url="shorewall-routestopped.html">shorewall-routestopped</ulink>(5)
|
||||
or by ADMINISABSENTMINDED.</para>
|
||||
|
||||
<para>If <option>-f</option> is given, the command will be processed
|
||||
by the compiled script that executed the last successful <emphasis
|
||||
role="bold">start</emphasis>, <emphasis
|
||||
role="bold">restart</emphasis> or <emphasis
|
||||
role="bold">refresh</emphasis> command if that script exists.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -852,7 +1039,9 @@
|
||||
<term><emphasis role="bold">version</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays Shorewall-lite's version.</para>
|
||||
<para>Displays Shorewall's version. The <option>-a</option> option
|
||||
is included for compatibility with earlier Shorewall releases and is
|
||||
ignored.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -871,13 +1060,13 @@
|
||||
url="http://www.shorewall.net/starting_and_stopping_shorewall.htm">http://www.shorewall.net/starting_and_stopping_shorewall.htm</ulink></para>
|
||||
|
||||
<para>shorewall-accounting(5), shorewall-actions(5),
|
||||
shorewall-blacklist(5), shorewall-hosts(5), shorewall-interfaces(5),
|
||||
shorewall-ipsec(5), shorewall-maclist(5), shorewall-masq(5),
|
||||
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||
shorewall-route_rules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||
shorewall.conf(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||
shorewall-tcrules(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||
shorewall-zones(5)</para>
|
||||
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcclasses(5),
|
||||
shorewall-tcdevices(5), shorewall-tcrules(5), shorewall-tos(5),
|
||||
shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@@ -2,6 +2,7 @@
|
||||
VARDIR=$(shell /sbin/shorewall show vardir)
|
||||
CONFDIR=/etc/shorewall
|
||||
RESTOREFILE?=firewall
|
||||
|
||||
all: $(VARDIR)/${RESTOREFILE}
|
||||
|
||||
$(VARDIR)/${RESTOREFILE}: $(CONFDIR)/*
|
||||
@@ -11,11 +12,12 @@ $(VARDIR)/${RESTOREFILE}: $(CONFDIR)/*
|
||||
then \
|
||||
/sbin/shorewall -q save >/dev/null; \
|
||||
else \
|
||||
/sbin/shorewall -q restart 2>&1 | tail >&2; \
|
||||
/sbin/shorewall -q restart 2>&1 | tail >&2; exit 1; \
|
||||
fi
|
||||
|
||||
clean:
|
||||
@rm -f $(CONFDIR)/*~ $(CONFDIR)/.*~
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
# EOF
|
||||
|
@@ -322,7 +322,7 @@ sub process_accounting_rule( ) {
|
||||
}
|
||||
}
|
||||
|
||||
dont_optimize( $chainref ) if $target eq 'RETURN';
|
||||
set_optflags( $chainref, DONT_OPTIMIZE ) if $target eq 'RETURN';
|
||||
|
||||
if ( $jumpchainref ) {
|
||||
if ( $asection ) {
|
||||
@@ -407,7 +407,7 @@ sub setup_accounting() {
|
||||
}
|
||||
|
||||
if ( $tableref->{accounting} ) {
|
||||
dont_optimize( 'accounting' );
|
||||
set_optflags( 'accounting' , DONT_OPTIMIZE );
|
||||
for my $chain ( qw/INPUT FORWARD/ ) {
|
||||
insert_ijump( $tableref->{$chain}, j => 'accounting', 0 );
|
||||
}
|
||||
@@ -429,7 +429,7 @@ sub setup_accounting() {
|
||||
insert_ijump( $tableref->{POSTROUTING}, j => 'accountpost', 0 );
|
||||
}
|
||||
} elsif ( $tableref->{accounting} ) {
|
||||
dont_optimize( 'accounting' );
|
||||
set_optflags( 'accounting' , DONT_OPTIMIZE );
|
||||
for my $chain ( qw/INPUT FORWARD OUTPUT/ ) {
|
||||
insert_ijump( $tableref->{$chain}, j => 'accounting', 0 );
|
||||
}
|
||||
|
@@ -36,6 +36,10 @@ use strict;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(
|
||||
DONT_OPTIMIZE
|
||||
DONT_DELETE
|
||||
DONT_MOVE
|
||||
|
||||
add_rule
|
||||
add_irule
|
||||
add_jump
|
||||
@@ -62,6 +66,11 @@ our @EXPORT = qw(
|
||||
require_audit
|
||||
newlogchain
|
||||
log_rule_limit
|
||||
allow_optimize
|
||||
allow_delete
|
||||
allow_move
|
||||
set_optflags
|
||||
reset_optflags
|
||||
dont_optimize
|
||||
dont_delete
|
||||
dont_move
|
||||
@@ -182,6 +191,7 @@ our %EXPORT_TAGS = (
|
||||
do_time
|
||||
do_user
|
||||
do_length
|
||||
decode_tos
|
||||
do_tos
|
||||
do_connbytes
|
||||
do_helper
|
||||
@@ -189,6 +199,7 @@ our %EXPORT_TAGS = (
|
||||
do_headers
|
||||
do_probability
|
||||
do_condition
|
||||
do_dscp
|
||||
have_ipset_rules
|
||||
record_runtime_address
|
||||
conditional_rule
|
||||
@@ -228,6 +239,7 @@ our %EXPORT_TAGS = (
|
||||
create_chainlist_reload
|
||||
create_stop_load
|
||||
%targets
|
||||
%dscpmap
|
||||
) ],
|
||||
);
|
||||
|
||||
@@ -246,9 +258,7 @@ our $VERSION = 'MODULEVERSION';
|
||||
# builtin => undef|1 -- If 1, one of Netfilter's built-in chains.
|
||||
# manual => undef|1 -- If 1, a manual chain.
|
||||
# accounting => undef|1 -- If 1, an accounting chain
|
||||
# dont_optimize=> undef|1 -- Don't optimize away if this chain is 'short'
|
||||
# dont_delete => undef|1 -- Don't delete if this chain is not referenced
|
||||
# dont_move => undef|1 -- Don't copy the rules of this chain somewhere else
|
||||
# optflags => <optimization flags>
|
||||
# log => <logging rule number for use when LOGRULENUMBERS>
|
||||
# policy => <policy>
|
||||
# policychain => <name of policy chain> -- self-reference if this is a policy chain
|
||||
@@ -360,6 +370,37 @@ use constant {
|
||||
|
||||
use constant { OPTIMIZE_MASK => OPTIMIZE_POLICY_MASK | OPTIMIZE_RULESET_MASK };
|
||||
|
||||
use constant { DONT_OPTIMIZE => 1 , DONT_DELETE => 2, DONT_MOVE => 4 };
|
||||
|
||||
our %dscpmap = ( CS0 => 0x00,
|
||||
CS1 => 0x08,
|
||||
CS2 => 0x10,
|
||||
CS3 => 0x18,
|
||||
CS4 => 0x20,
|
||||
CS5 => 0x28,
|
||||
CS6 => 0x30,
|
||||
CS7 => 0x38,
|
||||
BE => 0x00,
|
||||
AF11 => 0x0a,
|
||||
AF12 => 0x0c,
|
||||
AF13 => 0x0e,
|
||||
AF21 => 0x12,
|
||||
AF22 => 0x14,
|
||||
AF23 => 0x16,
|
||||
AF31 => 0x1a,
|
||||
AF32 => 0x1c,
|
||||
AF33 => 0x1e,
|
||||
AF41 => 0x22,
|
||||
AF42 => 0x24,
|
||||
AF43 => 0x26,
|
||||
EF => 0x2e,
|
||||
);
|
||||
|
||||
our %tosmap = ( 'Minimize-Delay' => 0x10,
|
||||
'Maximize-Throughput' => 0x08,
|
||||
'Maximize-Reliability' => 0x04,
|
||||
'Minimize-Cost' => 0x02,
|
||||
'Normal-Service' => 0x00 );
|
||||
#
|
||||
# These hashes hold the shell code to set shell variables. The key is the name of the variable; the value is the code to generate the variable's contents
|
||||
#
|
||||
@@ -1151,7 +1192,7 @@ sub push_matches {
|
||||
}
|
||||
}
|
||||
|
||||
$dont_optimize;
|
||||
DONT_OPTIMIZE if $dont_optimize;
|
||||
}
|
||||
|
||||
sub push_irule( $$$;@ ) {
|
||||
@@ -1180,7 +1221,7 @@ sub push_irule( $$$;@ ) {
|
||||
$chainref->{referenced} = 1;
|
||||
|
||||
unless ( $ruleref->{simple} = ! @matches ) {
|
||||
$chainref->{dont_optimize} = 1 if push_matches( $ruleref, @matches );
|
||||
$chainref->{optflags} |= push_matches( $ruleref, @matches );
|
||||
}
|
||||
|
||||
push @{$chainref->{rules}}, $ruleref;
|
||||
@@ -1294,7 +1335,7 @@ sub insert_irule( $$$$;@ ) {
|
||||
}
|
||||
|
||||
unless ( $ruleref->{simple} = ! @matches ) {
|
||||
$chainref->{dont_optimize} = 1 if push_matches( $ruleref, @matches );
|
||||
$chainref->{optflags} |= push_matches( $ruleref, @matches );
|
||||
}
|
||||
|
||||
if ( $comment ) {
|
||||
@@ -1867,7 +1908,8 @@ sub new_chain($$)
|
||||
log => 1,
|
||||
cmdlevel => 0,
|
||||
references => {},
|
||||
filtered => 0
|
||||
filtered => 0,
|
||||
optflags => 0,
|
||||
};
|
||||
|
||||
trace( $chainref, 'N', undef, '' ) if $debug;
|
||||
@@ -1928,7 +1970,7 @@ sub add_jump( $$$;$$$ ) {
|
||||
|
||||
my $param = $goto_ok && $toref && have_capability( 'GOTO_TARGET' ) ? 'g' : 'j';
|
||||
|
||||
$fromref->{dont_optimize} = 1 if $predicate =~ /! -[piosd] /;
|
||||
$fromref->{optflags} |= DONT_OPTIMIZE if $predicate =~ /! -[piosd] /;
|
||||
|
||||
if ( defined $index ) {
|
||||
assert( ! $expandports );
|
||||
@@ -2052,49 +2094,70 @@ sub delete_jumps ( $$ ) {
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Set the dont_optimize flag for a chain
|
||||
#
|
||||
sub dont_optimize( $ ) {
|
||||
my $chain = shift;
|
||||
sub reset_optflags( $$ ) {
|
||||
my ( $chain, $flags ) = @_;
|
||||
|
||||
my $chainref = reftype $chain ? $chain : $filter_table->{$chain};
|
||||
|
||||
$chainref->{dont_optimize} = 1;
|
||||
$chainref->{optflags} ^= $flags;
|
||||
|
||||
trace( $chainref, '!O', undef, '' ) if $debug;
|
||||
|
||||
$chainref;
|
||||
}
|
||||
|
||||
sub set_optflags( $$ ) {
|
||||
my ( $chain, $flags ) = @_;
|
||||
|
||||
my $chainref = reftype $chain ? $chain : $filter_table->{$chain};
|
||||
|
||||
$chainref->{optflags} |= $flags;
|
||||
|
||||
trace( $chainref, '!O', undef, '' ) if $debug;
|
||||
|
||||
$chainref;
|
||||
}
|
||||
|
||||
#
|
||||
# Reset the dont_optimize flag for a chain
|
||||
#
|
||||
sub allow_optimize( $ ) {
|
||||
reset_optflags( shift, DONT_OPTIMIZE );
|
||||
}
|
||||
|
||||
#
|
||||
# Reset the dont_delete flags for a chain
|
||||
#
|
||||
sub allow_delete( $ ) {
|
||||
reset_optflags( shift, DONT_DELETE );
|
||||
}
|
||||
|
||||
#
|
||||
# Reset the dont_move flag for a chain
|
||||
#
|
||||
sub allow_move( $ ) {
|
||||
reset_optflags( shift, DONT_MOVE );
|
||||
}
|
||||
|
||||
#
|
||||
# Set the dont_optimize flag for a chain
|
||||
#
|
||||
sub dont_optimize( $ ) {
|
||||
set_optflags( shift, DONT_OPTIMIZE );
|
||||
}
|
||||
|
||||
#
|
||||
# Set the dont_optimize and dont_delete flags for a chain
|
||||
#
|
||||
sub dont_delete( $ ) {
|
||||
my $chain = shift;
|
||||
|
||||
my $chainref = reftype $chain ? $chain : $filter_table->{$chain};
|
||||
|
||||
$chainref->{dont_optimize} = $chainref->{dont_delete} = 1;
|
||||
|
||||
trace( $chainref, '!OD', undef, '' ) if $debug;
|
||||
|
||||
$chainref;
|
||||
set_optflags( shift, DONT_OPTIMIZE | DONT_DELETE );
|
||||
}
|
||||
|
||||
#
|
||||
# Set the dont_move flag for a chain
|
||||
#
|
||||
sub dont_move( $ ) {
|
||||
my $chain = shift;
|
||||
|
||||
my $chainref = reftype $chain ? $chain : $filter_table->{$chain};
|
||||
|
||||
$chainref->{dont_move} = 1;
|
||||
|
||||
trace( $chainref, '!M', undef, '' ) if $debug;
|
||||
|
||||
$chainref;
|
||||
set_optflags( shift, DONT_MOVE );
|
||||
}
|
||||
|
||||
#
|
||||
@@ -2136,7 +2199,7 @@ sub ensure_accounting_chain( $$$ )
|
||||
$chainref->{restriction} = $restriction;
|
||||
$chainref->{restricted} = NO_RESTRICT;
|
||||
$chainref->{ipsec} = $ipsec;
|
||||
$chainref->{dont_optimize} = 1 unless $config{OPTIMIZE_ACCOUNTING};
|
||||
$chainref->{optflags} |= DONT_OPTIMIZE unless $config{OPTIMIZE_ACCOUNTING};
|
||||
|
||||
unless ( $chain eq 'accounting' ) {
|
||||
my $file = find_file $chain;
|
||||
@@ -2208,7 +2271,7 @@ sub new_builtin_chain($$$)
|
||||
$chainref->{referenced} = 1;
|
||||
$chainref->{policy} = $policy;
|
||||
$chainref->{builtin} = 1;
|
||||
$chainref->{dont_delete} = 1;
|
||||
$chainref->{optflags} = DONT_DELETE;
|
||||
$chainref;
|
||||
}
|
||||
|
||||
@@ -2636,7 +2699,7 @@ sub conditionally_copy_rules( $$ ) {
|
||||
|
||||
my $targetref = $chain_table{$chainref->{table}}{$basictarget};
|
||||
|
||||
if ( $targetref && ! $targetref->{dont_move} ) {
|
||||
if ( $targetref && ! ( $targetref->{optflags} & DONT_MOVE ) ) {
|
||||
#
|
||||
# Move is safe -- start with an empty rule list
|
||||
#
|
||||
@@ -2678,7 +2741,7 @@ sub optimize_level0() {
|
||||
#
|
||||
# If the chain isn't branched to, then delete it
|
||||
#
|
||||
unless ( $chainref->{dont_delete} || keys %{$chainref->{references}} ) {
|
||||
unless ( $chainref->{optflags} & DONT_DELETE || keys %{$chainref->{references}} ) {
|
||||
delete_chain $chainref if $chainref->{referenced};
|
||||
}
|
||||
}
|
||||
@@ -2696,7 +2759,7 @@ sub optimize_level4( $$ ) {
|
||||
# When a chain with a single entry is found, replace it's references by its contents
|
||||
#
|
||||
# The search continues until no short chains remain
|
||||
# Chains with 'dont_optimize = 1' are exempted from optimization
|
||||
# Chains with 'DONT_OPTIMIZE' are exempted from optimization
|
||||
#
|
||||
while ( $progress ) {
|
||||
$progress = 0;
|
||||
@@ -2708,15 +2771,16 @@ sub optimize_level4( $$ ) {
|
||||
progress_message "\n Table $table pass $passes, $chains referenced chains, level 4a...";
|
||||
|
||||
for my $chainref ( @chains ) {
|
||||
my $optflags = $chainref->{optflags};
|
||||
#
|
||||
# If the chain isn't branched to, then delete it
|
||||
#
|
||||
unless ( $chainref->{dont_delete} || keys %{$chainref->{references}} ) {
|
||||
unless ( ( $optflags & DONT_DELETE ) || keys %{$chainref->{references}} ) {
|
||||
delete_chain $chainref if $chainref->{referenced};
|
||||
next;
|
||||
}
|
||||
|
||||
unless ( $chainref->{dont_optimize} ) {
|
||||
unless ( $optflags & DONT_OPTIMIZE ) {
|
||||
my $numrules = @{$chainref->{rules}};
|
||||
|
||||
if ( $numrules == 0 ) {
|
||||
@@ -2727,7 +2791,7 @@ sub optimize_level4( $$ ) {
|
||||
#
|
||||
# Built-in -- mark it 'dont_optimize' so we ignore it in follow-on passes
|
||||
#
|
||||
$chainref->{dont_optimize} = 1;
|
||||
$chainref->{optflags} |= DONT_OPTIMIZE;
|
||||
} else {
|
||||
#
|
||||
# Not a built-in -- we can delete it and it's references
|
||||
@@ -2758,7 +2822,7 @@ sub optimize_level4( $$ ) {
|
||||
#
|
||||
# Target was a built-in. Ignore this chain in follow-on passes
|
||||
#
|
||||
$chainref->{dont_optimize} = 1;
|
||||
$chainref->{optflags} |= DONT_OPTIMIZE;
|
||||
}
|
||||
} else {
|
||||
#
|
||||
@@ -2774,9 +2838,9 @@ sub optimize_level4( $$ ) {
|
||||
if ( $chainref->{builtin} || ! $globals{KLUDGEFREE} ) {
|
||||
#
|
||||
# This case requires a new rule merging algorithm. Ignore this chain for
|
||||
# now.
|
||||
# now on.
|
||||
#
|
||||
$chainref->{dont_optimize} = 1;
|
||||
$chainref->{optflags} |= DONT_OPTIMIZE;
|
||||
} else {
|
||||
#
|
||||
# Replace references to this chain with the target and add the matches
|
||||
@@ -2866,7 +2930,7 @@ sub optimize_level8( $$$ ) {
|
||||
#
|
||||
for my $chainref1 ( @chains1 ) {
|
||||
next unless @{$chainref1->{rules}};
|
||||
next if $chainref1->{dont_delete};
|
||||
next if $chainref1->{optflags} & DONT_DELETE;
|
||||
if ( $chainref->{digest} eq $chainref1->{digest} ) {
|
||||
progress_message " Chain $chainref1->{name} combined with $chainref->{name}";
|
||||
replace_references $chainref1, $chainref->{name}, undef;
|
||||
@@ -4011,13 +4075,53 @@ sub do_user( $ ) {
|
||||
$rule;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Create a "-m tos" match for the passed TOS
|
||||
#
|
||||
sub do_tos( $ ) {
|
||||
my $tos = $_[0];
|
||||
# This helper is also used during tos file processing
|
||||
#
|
||||
sub decode_tos( $$ ) {
|
||||
my ( $tos, $set ) = @_;
|
||||
|
||||
$tos ne '-' ? "-m tos --tos $tos " : '';
|
||||
if ( $tos eq '-' ) {
|
||||
fatal_error [ '', # 0
|
||||
'A value must be supplied in the TOS column', # 1
|
||||
'Invalid TOS() parameter (-)', # 2
|
||||
]->[$set] if $set;
|
||||
return '';
|
||||
}
|
||||
|
||||
my $mask = 0xff;
|
||||
my $value;
|
||||
|
||||
if ( $tos =~ m"^(.+)/(.+)$" ) {
|
||||
$value = numeric_value $1;
|
||||
$mask = numeric_value $2;
|
||||
} elsif ( ! defined ( $value = numeric_value( $tos ) ) ) {
|
||||
$value = $tosmap{$tos};
|
||||
$mask = 0x3f;
|
||||
}
|
||||
|
||||
fatal_error( [ 'Invalid TOS column value',
|
||||
'Invalid TOS column value',
|
||||
'Invalid TOS() parameter', ]->[$set] . " ($tos)" )
|
||||
unless ( defined $value &&
|
||||
$value <= 0xff &&
|
||||
defined $mask &&
|
||||
$mask <= 0xff );
|
||||
|
||||
warning_message "Unmatchable TOS ($tos)" unless $set || $value & $mask;
|
||||
|
||||
$tos = in_hex( $value) . '/' . in_hex( $mask ) . ' ';
|
||||
|
||||
$set ? " --set-tos $tos" : "-m tos --tos $tos ";
|
||||
|
||||
}
|
||||
|
||||
sub do_tos( $ ) {
|
||||
decode_tos( $_[0], 0 );
|
||||
}
|
||||
|
||||
my %dir = ( O => 'original' ,
|
||||
@@ -4098,8 +4202,17 @@ sub do_helper( $ ) {
|
||||
sub do_length( $ ) {
|
||||
my $length = $_[0];
|
||||
|
||||
return '' if $length eq '-';
|
||||
|
||||
require_capability( 'LENGTH_MATCH' , 'A Non-empty LENGTH' , 's' );
|
||||
$length ne '-' ? "-m length --length $length " : '';
|
||||
|
||||
fatal_error "Invalid LENGTH ($length)" unless $length =~/^(\d+)(:(\d+))?$/;
|
||||
|
||||
if ( supplied $2 ) {
|
||||
fatal_error "First length must be < second length" unless $1 < $3;
|
||||
}
|
||||
|
||||
"-m length --length $length ";
|
||||
}
|
||||
|
||||
#
|
||||
@@ -4186,6 +4299,26 @@ sub do_condition( $ ) {
|
||||
"-m condition ${invert}--condition $condition "
|
||||
}
|
||||
|
||||
#
|
||||
# Generate a -m dscp match
|
||||
#
|
||||
sub do_dscp( $ ) {
|
||||
my $dscp = shift;
|
||||
|
||||
return '' if $dscp eq '-';
|
||||
|
||||
require_capability 'DSCP_MATCH', 'A non-empty DSCP column', 's';
|
||||
|
||||
my $invert = $dscp =~ s/^!// ? '! ' : '';
|
||||
my $value = numeric_value( $dscp );
|
||||
|
||||
$value = $dscpmap{$value} unless defined $value;
|
||||
|
||||
fatal_error( "Invalid DSCP ($dscp)" ) unless defined $value && $value < 0x2f && ! ( $value & 1 );
|
||||
|
||||
"-m dscp ${invert}--dscp $value ";
|
||||
}
|
||||
|
||||
#
|
||||
# Match Source Interface
|
||||
#
|
||||
@@ -4313,6 +4446,13 @@ sub get_set_flags( $$ ) {
|
||||
} elsif ( $setname =~ /^(.*)\[((src|dst)(,(src|dst))*)\]$/ ) {
|
||||
$setname = $1;
|
||||
$options = $2;
|
||||
|
||||
my @options = split /,/, $options;
|
||||
my %typemap = ( src => 'Source', dst => 'Destination' );
|
||||
|
||||
for ( @options ) {
|
||||
warning_message( "The '$_' ipset flag is used in a $typemap{$option} column" ), last unless $_ eq $option;
|
||||
}
|
||||
}
|
||||
|
||||
$setname =~ s/^\+//;
|
||||
@@ -4324,7 +4464,6 @@ sub get_set_flags( $$ ) {
|
||||
|
||||
$ipset_exists{$setname} = 1; # Suppress subsequent checks/warnings
|
||||
}
|
||||
|
||||
fatal_error "Invalid ipset name ($setname)" unless $setname =~ /^(6_)?[a-zA-Z]\w*/;
|
||||
|
||||
have_capability 'OLD_IPSET_MATCH' ? "--set $setname $options " : "--match-set $setname $options ";
|
||||
@@ -4337,11 +4476,21 @@ sub have_ipset_rules() {
|
||||
|
||||
sub get_interface_address( $ );
|
||||
|
||||
sub record_runtime_address( $ ) {
|
||||
my $interface = shift;
|
||||
sub record_runtime_address( $$;$ ) {
|
||||
my ( $addrtype, $interface, $protect ) = @_;
|
||||
fatal_error "Unknown interface address variable (&$interface)" unless known_interface( $interface );
|
||||
fatal_error "Invalid interface address variable (&$interface)" if $interface =~ /\+$/;
|
||||
get_interface_address( $interface ) . ' ';
|
||||
|
||||
my $addr;
|
||||
|
||||
if ( $addrtype eq '&' ) {
|
||||
$addr = get_interface_address( $interface );
|
||||
} else {
|
||||
$addr = get_interface_gateway( $interface, $protect );
|
||||
}
|
||||
|
||||
$addr . ' ';
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
@@ -4353,12 +4502,19 @@ sub record_runtime_address( $ ) {
|
||||
sub conditional_rule( $$ ) {
|
||||
my ( $chainref, $address ) = @_;
|
||||
|
||||
if ( $address =~ /^!?&(.+)$/ ) {
|
||||
my $interface = $1;
|
||||
if ( $address =~ /^!?([&%])(.+)$/ ) {
|
||||
my ($type, $interface) = ($1, $2);
|
||||
if ( my $ref = known_interface $interface ) {
|
||||
if ( $ref->{options}{optional} ) {
|
||||
my $variable = get_interface_address( $interface );
|
||||
add_commands( $chainref , "if [ $variable != " . NILIP . ' ]; then' );
|
||||
my $variable;
|
||||
if ( $type eq '&' ) {
|
||||
$variable = get_interface_address( $interface );
|
||||
add_commands( $chainref , "if [ $variable != " . NILIP . ' ]; then' );
|
||||
} else {
|
||||
$variable = get_interface_gateway( $interface );
|
||||
add_commands( $chainref , qq(if [ -n "$variable" ]; then) );
|
||||
}
|
||||
|
||||
incr_cmd_level $chainref;
|
||||
return 1;
|
||||
}
|
||||
@@ -4422,16 +4578,16 @@ sub match_source_net( $;$\$ ) {
|
||||
}
|
||||
|
||||
if ( $net =~ s/^!// ) {
|
||||
if ( $net =~ /^&(.+)/ ) {
|
||||
return '! -s ' . record_runtime_address $1;
|
||||
if ( $net =~ /^([&%])(.+)/ ) {
|
||||
return '! -s ' . record_runtime_address $1, $2;
|
||||
}
|
||||
|
||||
validate_net $net, 1;
|
||||
return "! -s $net ";
|
||||
}
|
||||
|
||||
if ( $net =~ /^&(.+)/ ) {
|
||||
return '-s ' . record_runtime_address $1;
|
||||
if ( $net =~ /^([&%])(.+)/ ) {
|
||||
return '-s ' . record_runtime_address $1, $2;
|
||||
}
|
||||
|
||||
validate_net $net, 1;
|
||||
@@ -4476,16 +4632,16 @@ sub imatch_source_net( $;$\$ ) {
|
||||
}
|
||||
|
||||
if ( $net =~ s/^!// ) {
|
||||
if ( $net =~ /^&(.+)/ ) {
|
||||
return ( s => '! ' . record_runtime_address $1 );
|
||||
if ( $net =~ /^([&%])(.+)/ ) {
|
||||
return ( s => '! ' . record_runtime_address( $1, $2, 1 ) );
|
||||
}
|
||||
|
||||
validate_net $net, 1;
|
||||
return ( s => "! $net " );
|
||||
}
|
||||
|
||||
if ( $net =~ /^&(.+)/ ) {
|
||||
return ( s => record_runtime_address $1 );
|
||||
if ( $net =~ /^([&%])(.+)/ ) {
|
||||
return ( s => record_runtime_address( $1, $2, 1 ) );
|
||||
}
|
||||
|
||||
validate_net $net, 1;
|
||||
@@ -4525,16 +4681,16 @@ sub match_dest_net( $ ) {
|
||||
}
|
||||
|
||||
if ( $net =~ s/^!// ) {
|
||||
if ( $net =~ /^&(.+)/ ) {
|
||||
return '! -d ' . record_runtime_address $1;
|
||||
if ( $net =~ /^([&%])(.+)/ ) {
|
||||
return '! -d ' . record_runtime_address $1, $2;
|
||||
}
|
||||
|
||||
validate_net $net, 1;
|
||||
return "! -d $net ";
|
||||
}
|
||||
|
||||
if ( $net =~ /^&(.+)/ ) {
|
||||
return '-d ' . record_runtime_address $1;
|
||||
if ( $net =~ /^([&%])(.+)/ ) {
|
||||
return '-d ' . record_runtime_address $1, $2;
|
||||
}
|
||||
|
||||
validate_net $net, 1;
|
||||
@@ -4572,16 +4728,16 @@ sub imatch_dest_net( $ ) {
|
||||
}
|
||||
|
||||
if ( $net =~ s/^!// ) {
|
||||
if ( $net =~ /^&(.+)/ ) {
|
||||
return ( d => '! ' . record_runtime_address $1 );
|
||||
if ( $net =~ /^([&%])(.+)/ ) {
|
||||
return ( d => '! ' . record_runtime_address( $1, $2, 1 ) );
|
||||
}
|
||||
|
||||
validate_net $net, 1;
|
||||
return ( d => "! $net " );
|
||||
}
|
||||
|
||||
if ( $net =~ /^&(.+)/ ) {
|
||||
return ( d => record_runtime_address $1 );
|
||||
if ( $net =~ /^([&%])(.+)/ ) {
|
||||
return ( d => record_runtime_address( $1, $2, 1 ) );
|
||||
}
|
||||
|
||||
validate_net $net, 1;
|
||||
@@ -4599,7 +4755,7 @@ sub match_orig_dest ( $ ) {
|
||||
|
||||
if ( $net =~ s/^!// ) {
|
||||
if ( $net =~ /^&(.+)/ ) {
|
||||
$net = record_runtime_address $1;
|
||||
$net = record_runtime_address '&', $1;
|
||||
} else {
|
||||
validate_net $net, 1;
|
||||
}
|
||||
@@ -4607,7 +4763,7 @@ sub match_orig_dest ( $ ) {
|
||||
have_capability( 'OLD_CONNTRACK_MATCH' ) ? "-m conntrack --ctorigdst ! $net " : "-m conntrack ! --ctorigdst $net ";
|
||||
} else {
|
||||
if ( $net =~ /^&(.+)/ ) {
|
||||
$net = record_runtime_address $1;
|
||||
$net = record_runtime_address '&', $1;
|
||||
} else {
|
||||
validate_net $net, 1;
|
||||
}
|
||||
@@ -5055,8 +5211,8 @@ sub interface_gateway( $ ) {
|
||||
#
|
||||
# Record that the ruleset requires the gateway address on the passed interface
|
||||
#
|
||||
sub get_interface_gateway ( $ ) {
|
||||
my ( $logical ) = $_[0];
|
||||
sub get_interface_gateway ( $;$ ) {
|
||||
my ( $logical, $protect ) = @_;
|
||||
|
||||
my $interface = get_physical $logical;
|
||||
my $variable = interface_gateway( $interface );
|
||||
@@ -5073,7 +5229,7 @@ sub get_interface_gateway ( $ ) {
|
||||
);
|
||||
}
|
||||
|
||||
"\$$variable";
|
||||
$protect ? "\${$variable:-" . NILIP . '}' : "\$$variable";
|
||||
}
|
||||
|
||||
#
|
||||
@@ -5383,7 +5539,7 @@ sub expand_rule( $$$$$$$$$$;$ )
|
||||
} else {
|
||||
$inets = $source;
|
||||
}
|
||||
} elsif ( $source =~ /(?:\+|&|~|\..*\.)/ ) {
|
||||
} elsif ( $source =~ /(?:\+|&|%|~|\..*\.)/ ) {
|
||||
$inets = $source;
|
||||
} else {
|
||||
$iiface = $source;
|
||||
@@ -5468,7 +5624,7 @@ sub expand_rule( $$$$$$$$$$;$ )
|
||||
if ( $dest =~ /^(.+?):(.+)$/ ) {
|
||||
$diface = $1;
|
||||
$dnets = $2;
|
||||
} elsif ( $dest =~ /\+|&|~|\..*\./ ) {
|
||||
} elsif ( $dest =~ /\+|&|%|~|\..*\./ ) {
|
||||
$dnets = $dest;
|
||||
} else {
|
||||
$diface = $dest;
|
||||
@@ -5856,11 +6012,14 @@ sub copy_options( $ ) {
|
||||
#
|
||||
# This function is called after the blacklist rules have been added to the canonical chains. It
|
||||
# either copies the relevant interface option rules into each canonocal chain, or it inserts one
|
||||
# or more jumps to the relevant option chains.
|
||||
# or more jumps to the relevant option chains. The argument indicates whether blacklist rules are
|
||||
# present.
|
||||
#
|
||||
sub add_interface_options( $ ) {
|
||||
|
||||
if ( $_[0] ) {
|
||||
#
|
||||
# We have blacklist rules.
|
||||
my %input_chains;
|
||||
my %forward_chains;
|
||||
|
||||
@@ -5887,7 +6046,7 @@ sub add_interface_options( $ ) {
|
||||
$chainref->{digest} = sha1 $digest;
|
||||
}
|
||||
#
|
||||
# Insert all interface option rules into the rules chains
|
||||
# Insert jumps to the interface chains into the rules chains
|
||||
#
|
||||
for my $zone1 ( off_firewall_zones ) {
|
||||
my @input_interfaces = keys %{zone_interfaces( $zone1 )};
|
||||
@@ -5927,7 +6086,9 @@ sub add_interface_options( $ ) {
|
||||
@forward_interfaces = ( $forward_interfaces[0] );
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Now insert the jumps
|
||||
#
|
||||
for my $zone2 ( all_zones ) {
|
||||
my $chainref = $filter_table->{rules_chain( $zone1, $zone2 )};
|
||||
my $chain1ref;
|
||||
@@ -5962,7 +6123,9 @@ sub add_interface_options( $ ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Now take care of jumps to the interface output option chains
|
||||
#
|
||||
for my $zone1 ( firewall_zone, vserver_zones ) {
|
||||
for my $zone2 ( off_firewall_zones ) {
|
||||
my $chainref = $filter_table->{rules_chain( $zone1, $zone2 )};
|
||||
@@ -5981,7 +6144,7 @@ sub add_interface_options( $ ) {
|
||||
}
|
||||
} else {
|
||||
#
|
||||
# Simply move the option chain rules to the interface chains
|
||||
# No Blacklisting - simply move the option chain rules to the interface chains
|
||||
#
|
||||
for my $interface ( all_real_interfaces ) {
|
||||
my $chainref;
|
||||
@@ -6406,7 +6569,7 @@ sub create_netfilter_load( $ ) {
|
||||
#
|
||||
emit( 'exec 3>&-',
|
||||
'',
|
||||
'[ -n "$DEBUG" ] && command=debug_restore_input || command=$' . $UTILITY,
|
||||
'[ -n "$g_debug_iptables" ] && command=debug_restore_input || command=$' . $UTILITY,
|
||||
'',
|
||||
'progress_message2 "Running $command..."',
|
||||
'',
|
||||
|
@@ -791,7 +791,7 @@ sub compiler {
|
||||
#
|
||||
# Process the rules file.
|
||||
#
|
||||
process_rules;
|
||||
process_rules( $convert );
|
||||
#
|
||||
# Add Tunnel rules.
|
||||
#
|
||||
|
@@ -292,6 +292,8 @@ my %capdesc = ( NAT_ENABLED => 'NAT',
|
||||
STATISTIC_MATCH =>
|
||||
'Statistics Match',
|
||||
IMQ_TARGET => 'IMQ Target',
|
||||
DSCP_MATCH => 'DSCP Match',
|
||||
DSCP_TARGET => 'DSCP Target',
|
||||
CAPVERSION => 'Capability Version',
|
||||
KERNELVERSION => 'Kernel Version',
|
||||
);
|
||||
@@ -389,8 +391,8 @@ my $toolNAME; # Tool name in CAPS
|
||||
our $product; # Name of product that will run the generated script
|
||||
our $Product; # $product with initial cap.
|
||||
|
||||
my $sillyname; # Name of temporary filter chains for testing capabilities
|
||||
my $sillyname1;
|
||||
our $sillyname; # Name of temporary filter chains for testing capabilities
|
||||
our $sillyname1;
|
||||
my $iptables; # Path to iptables/ip6tables
|
||||
my $tc; # Path to tc
|
||||
my $ip; # Path to ip
|
||||
@@ -419,6 +421,11 @@ my %deprecated = ( LOGRATE => '' ,
|
||||
HIGH_ROUTE_MARKS => 'no'
|
||||
);
|
||||
#
|
||||
# Deprecated options that are eliminated via update
|
||||
#
|
||||
my %converted = ( WIDE_TC_MARKS => 1,
|
||||
HIGH_ROUTE_MARKS => 1 );
|
||||
#
|
||||
# Rather than initializing globals in an INIT block or during declaration,
|
||||
# we initialize them in a function. This is done for two reasons:
|
||||
#
|
||||
@@ -692,6 +699,8 @@ sub initialize( $ ) {
|
||||
CT_TARGET => undef,
|
||||
STATISTIC_MATCH => undef,
|
||||
IMQ_TARGET => undef,
|
||||
DSCP_MATCH => undef,
|
||||
DSCP_TARGET => undef,
|
||||
CAPVERSION => undef,
|
||||
KERNELVERSION => undef,
|
||||
);
|
||||
@@ -2778,7 +2787,15 @@ sub Statistic_Match() {
|
||||
}
|
||||
|
||||
sub Imq_Target() {
|
||||
qt1( "$iptables -t mangle -A $sillyname -j IMQ --todev 0" );
|
||||
have_capability 'MANGLE_ENABLED' && qt1( "$iptables -t mangle -A $sillyname -j IMQ --todev 0" );
|
||||
}
|
||||
|
||||
sub Dscp_Match() {
|
||||
have_capability 'MANGLE_ENABLED' && qt1( "$iptables -t mangle -A $sillyname -m dscp --dscp 0" );
|
||||
}
|
||||
|
||||
sub Dscp_Target() {
|
||||
have_capability 'MANGLE_ENABLED' && qt1( "$iptables -t mangle -A $sillyname -j DSCP --set-dscp 0" );
|
||||
}
|
||||
|
||||
our %detect_capability =
|
||||
@@ -2794,6 +2811,8 @@ our %detect_capability =
|
||||
CONNMARK_MATCH => \&Connmark_Match,
|
||||
CONNTRACK_MATCH => \&Conntrack_Match,
|
||||
CT_TARGET => \&Ct_Target,
|
||||
DSCP_MATCH => \&Dscp_Match,
|
||||
DSCP_TARGET => \&Dscp_Target,
|
||||
ENHANCED_REJECT => \&Enhanced_Reject,
|
||||
EXMARK => \&Exmark,
|
||||
FLOW_FILTER => \&Flow_Filter,
|
||||
@@ -2941,11 +2960,6 @@ sub determine_capabilities() {
|
||||
$capabilities{IPMARK_TARGET} = detect_capability( 'IPMARK_TARGET' );
|
||||
$capabilities{TPROXY_TARGET} = detect_capability( 'TPROXY_TARGET' );
|
||||
|
||||
if ( $capabilities{MANGLE_ENABLED} ) {
|
||||
qt1( "$iptables -t mangle -F $sillyname" );
|
||||
qt1( "$iptables -t mangle -X $sillyname" );
|
||||
}
|
||||
|
||||
$capabilities{MANGLE_FORWARD} = detect_capability( 'MANGLE_FORWARD' );
|
||||
$capabilities{RAW_TABLE} = detect_capability( 'RAW_TABLE' );
|
||||
$capabilities{RAWPOST_TABLE} = detect_capability( 'RAWPOST_TABLE' );
|
||||
@@ -2975,6 +2989,8 @@ sub determine_capabilities() {
|
||||
$capabilities{CT_TARGET} = detect_capability( 'CT_TARGET' );
|
||||
$capabilities{STATISTIC_MATCH} = detect_capability( 'STATISTIC_MATCH' );
|
||||
$capabilities{IMQ_TARGET} = detect_capability( 'IMQ_TARGET' );
|
||||
$capabilities{DSCP_MATCH} = detect_capability( 'DSCP_MATCH' );
|
||||
$capabilities{DSCP_TARGET} = detect_capability( 'DSCP_TARGET' );
|
||||
|
||||
|
||||
qt1( "$iptables -F $sillyname" );
|
||||
@@ -2982,6 +2998,16 @@ sub determine_capabilities() {
|
||||
qt1( "$iptables -F $sillyname1" );
|
||||
qt1( "$iptables -X $sillyname1" );
|
||||
|
||||
if ( $capabilities{MANGLE_ENABLED} ) {
|
||||
qt1( "$iptables -t mangle -F $sillyname" );
|
||||
qt1( "$iptables -t mangle -X $sillyname" );
|
||||
}
|
||||
|
||||
if ( $capabilities{NAT_ENABLED} ) {
|
||||
qt1( "$iptables -t nat -F $sillyname" );
|
||||
qt1( "$iptables -t nat -X $sillyname" );
|
||||
}
|
||||
|
||||
$sillyname = $sillyname1 = undef;
|
||||
}
|
||||
}
|
||||
@@ -3145,7 +3171,7 @@ sub update_config_file( $ ) {
|
||||
|
||||
my $heading_printed;
|
||||
|
||||
for ( keys %deprecated ) {
|
||||
for ( grep ! $converted{$_} , keys %deprecated ) {
|
||||
if ( supplied( my $val = $config{$_} ) ) {
|
||||
if ( lc $val ne $deprecated{$_} ) {
|
||||
unless ( $heading_printed ) {
|
||||
@@ -3181,7 +3207,7 @@ EOF
|
||||
progress_message3 "No update required to configuration file $configfile; $configfile.bak not saved";
|
||||
} else {
|
||||
warning_message "Unable to unlink $configfile.bak";
|
||||
progress_message3 "No update required to configuration file $configfile; $configfile.b";
|
||||
progress_message3 "No update required to configuration file $configfile";
|
||||
}
|
||||
|
||||
exit 0 unless -f find_file 'blacklist';
|
||||
@@ -3355,6 +3381,8 @@ sub unsupported_yes_no_warning( $ ) {
|
||||
sub get_params() {
|
||||
my $fn = find_file 'params';
|
||||
|
||||
my %reserved = ( COMMAND => 1, CONFDIR => 1, SHAREDIR => 1, VARDIR => 1 );
|
||||
|
||||
if ( -f $fn ) {
|
||||
progress_message2 "Processing $fn ...";
|
||||
|
||||
@@ -3458,6 +3486,11 @@ sub get_params() {
|
||||
}
|
||||
}
|
||||
|
||||
for ( keys %params ) {
|
||||
fatal_error "The variable name $_ is reserved and may not be set in the params file"
|
||||
if /^SW_/ || /^SHOREWALL_/ || ( exists $config{$_} && ! exists $ENV{$_} ) || exists $reserved{$_};
|
||||
}
|
||||
|
||||
if ( $debug ) {
|
||||
print "PARAMS:\n";
|
||||
my $value;
|
||||
|
@@ -67,18 +67,17 @@ sub process_tos() {
|
||||
my $chain = have_capability( 'MANGLE_FORWARD' ) ? 'fortos' : 'pretos';
|
||||
my $stdchain = have_capability( 'MANGLE_FORWARD' ) ? 'FORWARD' : 'PREROUTING';
|
||||
|
||||
my %tosoptions = ( 'minimize-delay' => 0x10 ,
|
||||
'maximize-throughput' => 0x08 ,
|
||||
'maximize-reliability' => 0x04 ,
|
||||
'minimize-cost' => 0x02 ,
|
||||
'normal-service' => 0x00 );
|
||||
|
||||
if ( my $fn = open_file 'tos' ) {
|
||||
if ( my $fn = open_file 'tos' ) {
|
||||
my $first_entry = 1;
|
||||
|
||||
my ( $pretosref, $outtosref );
|
||||
|
||||
first_entry( sub { progress_message2 "$doing $fn..."; $pretosref = ensure_chain 'mangle' , $chain; $outtosref = ensure_chain 'mangle' , 'outtos'; } );
|
||||
first_entry( sub { progress_message2 "$doing $fn...";
|
||||
warning_message "Use of the tos file is deprecated in favor of the TOS target in tcrules";
|
||||
$pretosref = ensure_chain 'mangle' , $chain;
|
||||
$outtosref = ensure_chain 'mangle' , 'outtos';
|
||||
}
|
||||
);
|
||||
|
||||
while ( read_a_line ) {
|
||||
|
||||
@@ -86,14 +85,7 @@ sub process_tos() {
|
||||
|
||||
$first_entry = 0;
|
||||
|
||||
fatal_error 'A value must be supplied in the TOS column' if $tos eq '-';
|
||||
|
||||
if ( defined ( my $tosval = $tosoptions{"\L$tos"} ) ) {
|
||||
$tos = $tosval;
|
||||
} else {
|
||||
my $val = numeric_value( $tos );
|
||||
fatal_error "Invalid TOS value ($tos)" unless defined( $val ) && $val < 0x1f;
|
||||
}
|
||||
$tos = decode_tos( $tos , 1 );
|
||||
|
||||
my $chainref;
|
||||
|
||||
@@ -129,7 +121,7 @@ sub process_tos() {
|
||||
$src ,
|
||||
$dst ,
|
||||
'' ,
|
||||
"TOS --set-tos $tos" ,
|
||||
'TOS' . $tos ,
|
||||
'' ,
|
||||
'TOS' ,
|
||||
'';
|
||||
@@ -216,8 +208,8 @@ sub setup_blacklist() {
|
||||
# for 'refresh' to work properly.
|
||||
#
|
||||
if ( @$zones || @$zones1 ) {
|
||||
$chainref = dont_delete new_standard_chain 'blacklst' if @$zones;
|
||||
$chainref1 = dont_delete new_standard_chain 'blackout' if @$zones1;
|
||||
$chainref = set_optflags( new_standard_chain( 'blacklst' ), DONT_OPTIMIZE | DONT_DELETE ) if @$zones;
|
||||
$chainref1 = set_optflags( new_standard_chain( 'blackout' ), DONT_OPTIMIZE | DONT_DELETE ) if @$zones1;
|
||||
|
||||
if ( supplied $level ) {
|
||||
$target = ensure_blacklog_chain ( $target, $disposition, $level, $audit );
|
||||
@@ -695,9 +687,9 @@ sub add_common_rules ( $ ) {
|
||||
my $rejectref = $filter_table->{reject};
|
||||
|
||||
if ( $config{DYNAMIC_BLACKLIST} ) {
|
||||
add_rule_pair dont_delete( new_standard_chain( 'logdrop' ) ), '' , 'DROP' , $level ;
|
||||
add_rule_pair dont_delete( new_standard_chain( 'logreject' ) ), '' , 'reject' , $level ;
|
||||
$dynamicref = dont_optimize( new_standard_chain( 'dynamic' ) );
|
||||
add_rule_pair( set_optflags( new_standard_chain( 'logdrop' ) , DONT_OPTIMIZE | DONT_DELETE ), '' , 'DROP' , $level );
|
||||
add_rule_pair( set_optflags( new_standard_chain( 'logreject' ), DONT_OPTIMIZE | DONT_DELETE ), '' , 'reject' , $level );
|
||||
$dynamicref = set_optflags( new_standard_chain( 'dynamic' ) , DONT_OPTIMIZE );
|
||||
add_commands( $dynamicref, '[ -f ${VARDIR}/.dynamic ] && cat ${VARDIR}/.dynamic >&3' );
|
||||
}
|
||||
|
||||
@@ -994,7 +986,7 @@ sub add_common_rules ( $ ) {
|
||||
if ( @$list ) {
|
||||
progress_message2 "$doing UPnP";
|
||||
|
||||
$chainref = dont_optimize new_nat_chain( 'UPnP' );
|
||||
$chainref = set_optflags( new_nat_chain( 'UPnP' ), DONT_OPTIMIZE );
|
||||
|
||||
add_commands( $chainref, '[ -s /${VARDIR}/.UPnP ] && cat ${VARDIR}/.UPnP >&3' );
|
||||
|
||||
@@ -1013,9 +1005,10 @@ sub add_common_rules ( $ ) {
|
||||
for $interface ( @$list ) {
|
||||
my $chainref = $filter_table->{input_option_chain $interface};
|
||||
my $base = uc chain_base get_physical $interface;
|
||||
my $variable = get_interface_gateway $interface;
|
||||
my $optional = interface_is_optional( $interface );
|
||||
my $variable = get_interface_gateway( $interface, ! $optional );
|
||||
|
||||
if ( interface_is_optional $interface ) {
|
||||
if ( $optional ) {
|
||||
add_commands( $chainref,
|
||||
qq(if [ -n "SW_\$${base}_IS_USABLE" -a -n "$variable" ]; then) );
|
||||
incr_cmd_level( $chainref );
|
||||
|
@@ -54,8 +54,8 @@ sub initialize() {
|
||||
#
|
||||
sub process_one_masq( )
|
||||
{
|
||||
my ($interfacelist, $networks, $addresses, $proto, $ports, $ipsec, $mark, $user ) =
|
||||
split_line1 'masq file', { interface => 0, source => 1, address => 2, proto => 3, port => 4, ipsec => 5, mark => 6, user => 7 };
|
||||
my ($interfacelist, $networks, $addresses, $proto, $ports, $ipsec, $mark, $user, $condition ) =
|
||||
split_line1 'masq file', { interface => 0, source => 1, address => 2, proto => 3, port => 4, ipsec => 5, mark => 6, user => 7, switch => 8 };
|
||||
|
||||
if ( $interfacelist eq 'COMMENT' ) {
|
||||
process_comment;
|
||||
@@ -88,7 +88,7 @@ sub process_one_masq( )
|
||||
$interfacelist = $1;
|
||||
} elsif ( $interfacelist =~ /^([^:]+):([^:]*)$/ ) {
|
||||
my ( $one, $two ) = ( $1, $2 );
|
||||
if ( $2 =~ /\./ ) {
|
||||
if ( $2 =~ /\./ || $2 =~ /^%/ ) {
|
||||
$interfacelist = $one;
|
||||
$destnets = $two;
|
||||
}
|
||||
@@ -117,9 +117,9 @@ sub process_one_masq( )
|
||||
}
|
||||
|
||||
#
|
||||
# Handle Protocol and Ports
|
||||
# Handle Protocol, Ports and Condition
|
||||
#
|
||||
$baserule .= do_proto $proto, $ports, '';
|
||||
$baserule .= do_proto( $proto, $ports, '' ) . do_condition( $condition );
|
||||
#
|
||||
# Handle Mark
|
||||
#
|
||||
@@ -195,7 +195,7 @@ sub process_one_masq( )
|
||||
if ( $conditional = conditional_rule( $chainref, $addr ) ) {
|
||||
$addrlist .= '--to-source ' . get_interface_address $1;
|
||||
} else {
|
||||
$addrlist .= '--to-source ' . record_runtime_address $1;
|
||||
$addrlist .= '--to-source ' . record_runtime_address( '&', $1 );
|
||||
}
|
||||
} elsif ( $addr =~ /^.*\..*\..*\./ ) {
|
||||
$target = 'SNAT ';
|
||||
|
@@ -160,9 +160,7 @@ sub setup_route_marking() {
|
||||
|
||||
my $chainref2 = new_chain( 'mangle', load_chain( $physical ) );
|
||||
|
||||
dont_optimize $chainref2;
|
||||
dont_move $chainref2;
|
||||
dont_delete $chainref2;
|
||||
set_optflags( $chainref2, DONT_OPTIMIZE | DONT_MOVE | DONT_DELETE );
|
||||
|
||||
add_ijump ( $chainref1,
|
||||
j => $chainref2 ,
|
||||
@@ -918,7 +916,7 @@ sub add_an_rtrule( ) {
|
||||
if ( $source eq '-' ) {
|
||||
$source = 'from ' . ALLIP;
|
||||
} elsif ( $source =~ s/^&// ) {
|
||||
$source = 'from ' . record_runtime_address $source;
|
||||
$source = 'from ' . record_runtime_address '&', $source;
|
||||
} elsif ( $family == F_IPV4 ) {
|
||||
if ( $source =~ /:/ ) {
|
||||
( my $interface, $source , my $remainder ) = split( /:/, $source, 3 );
|
||||
|
@@ -963,7 +963,7 @@ sub createlogactionchain( $$$$$ ) {
|
||||
|
||||
unless ( $targets{$action} & BUILTIN ) {
|
||||
|
||||
dont_optimize $chainref;
|
||||
set_optflags( $chainref, DONT_OPTIMIZE );
|
||||
|
||||
my $file = find_file $chain;
|
||||
|
||||
@@ -997,7 +997,7 @@ sub createsimpleactionchain( $ ) {
|
||||
|
||||
unless ( $targets{$action} & BUILTIN ) {
|
||||
|
||||
dont_optimize $chainref;
|
||||
set_optflags( $chainref, DONT_OPTIMIZE );
|
||||
|
||||
my $file = find_file $action;
|
||||
|
||||
@@ -1306,7 +1306,7 @@ sub allowInvalid ( $$$$ ) {
|
||||
}
|
||||
|
||||
sub forwardUPnP ( $$$$ ) {
|
||||
my $chainref = dont_optimize 'forwardUPnP';
|
||||
my $chainref = set_optflags( 'forwardUPnP', DONT_OPTIMIZE );
|
||||
|
||||
add_commands( $chainref , '[ -f ${VARDIR}/.forwardUPnP ] && cat ${VARDIR}/.forwardUPnP >&3' );
|
||||
}
|
||||
@@ -2238,7 +2238,7 @@ sub process_rule1 ( $$$$$$$$$$$$$$$$ $) {
|
||||
}
|
||||
}
|
||||
|
||||
dont_move( dont_optimize( $nonat_chain ) ) if $tgt eq 'RETURN';
|
||||
set_optflags( $nonat_chain, DONT_MOVE | DONT_OPTIMIZE ) if $tgt eq 'RETURN';
|
||||
|
||||
expand_rule( $nonat_chain ,
|
||||
PREROUTE_RESTRICT ,
|
||||
@@ -2262,7 +2262,7 @@ sub process_rule1 ( $$$$$$$$$$$$$$$$ $) {
|
||||
$action = $usedactions{$normalized_target}{name};
|
||||
$loglevel = '';
|
||||
} else {
|
||||
dont_move( dont_optimize ( $chainref ) ) if $action eq 'RETURN';
|
||||
set_optflags( $chainref , DONT_MOVE | DONT_OPTIMIZE ) if $action eq 'RETURN';
|
||||
}
|
||||
|
||||
if ( $origdest ) {
|
||||
@@ -2525,11 +2525,13 @@ sub classic_blacklist() {
|
||||
#
|
||||
# Process the BLRules and Rules Files
|
||||
#
|
||||
sub process_rules() {
|
||||
sub process_rules( $ ) {
|
||||
my $convert = shift;
|
||||
my $blrules = 0;
|
||||
#
|
||||
# Generate jumps to the classic blacklist chains
|
||||
#
|
||||
my $blrules = classic_blacklist;
|
||||
$blrules = classic_blacklist unless $convert;
|
||||
#
|
||||
# Process the blrules file
|
||||
#
|
||||
|
@@ -194,14 +194,14 @@ sub initialize( $ ) {
|
||||
}
|
||||
|
||||
sub process_tc_rule( ) {
|
||||
my ( $originalmark, $source, $dest, $proto, $ports, $sports, $user, $testval, $length, $tos , $connbytes, $helper, $headers, $probability );
|
||||
my ( $originalmark, $source, $dest, $proto, $ports, $sports, $user, $testval, $length, $tos , $connbytes, $helper, $headers, $probability , $dscp );
|
||||
if ( $family == F_IPV4 ) {
|
||||
( $originalmark, $source, $dest, $proto, $ports, $sports, $user, $testval, $length, $tos , $connbytes, $helper, $probability ) =
|
||||
split_line1 'tcrules file', { mark => 0, source => 1, dest => 2, proto => 3, dport => 4, sport => 5, user => 6, test => 7, length => 8, tos => 9, connbytes => 10, helper => 11, probability => 12 };
|
||||
( $originalmark, $source, $dest, $proto, $ports, $sports, $user, $testval, $length, $tos , $connbytes, $helper, $probability, $dscp ) =
|
||||
split_line1 'tcrules file', { mark => 0, source => 1, dest => 2, proto => 3, dport => 4, sport => 5, user => 6, test => 7, length => 8, tos => 9, connbytes => 10, helper => 11, probability => 12 , dscp => 13 };
|
||||
$headers = '-';
|
||||
} else {
|
||||
( $originalmark, $source, $dest, $proto, $ports, $sports, $user, $testval, $length, $tos , $connbytes, $helper, $headers, $probability ) =
|
||||
split_line1 'tcrules file', { mark => 0, source => 1, dest => 2, proto => 3, dport => 4, sport => 5, user => 6, test => 7, length => 8, tos => 9, connbytes => 10, helper => 11, headers => 12, probability => 13 };
|
||||
( $originalmark, $source, $dest, $proto, $ports, $sports, $user, $testval, $length, $tos , $connbytes, $helper, $headers, $probability, $dscp ) =
|
||||
split_line1 'tcrules file', { mark => 0, source => 1, dest => 2, proto => 3, dport => 4, sport => 5, user => 6, test => 7, length => 8, tos => 9, connbytes => 10, helper => 11, headers => 12, probability => 13 , dscp => 14 };
|
||||
}
|
||||
|
||||
our @tccmd;
|
||||
@@ -239,6 +239,157 @@ sub process_tc_rule( ) {
|
||||
my $device = '';
|
||||
my $fw = firewall_zone;
|
||||
my $list;
|
||||
my $restriction = 0;
|
||||
my $cmd;
|
||||
my $rest;
|
||||
|
||||
my %processtcc = ( sticky => sub() {
|
||||
if ( $chain eq 'tcout' ) {
|
||||
$target = 'sticko';
|
||||
} else {
|
||||
fatal_error "SAME rules are only allowed in the PREROUTING and OUTPUT chains" if $chain ne 'tcpre';
|
||||
}
|
||||
|
||||
$restriction = DESTIFACE_DISALLOW;
|
||||
|
||||
ensure_mangle_chain($target);
|
||||
|
||||
$sticky++;
|
||||
},
|
||||
IPMARK => sub() {
|
||||
my ( $srcdst, $mask1, $mask2, $shift ) = ('src', 255, 0, 0 );
|
||||
|
||||
require_capability 'IPMARK_TARGET', 'IPMARK', 's';
|
||||
|
||||
if ( $cmd =~ /^IPMARK\((.+?)\)$/ ) {
|
||||
my $params = $1;
|
||||
my $val;
|
||||
|
||||
my ( $sd, $m1, $m2, $s , $bad ) = split ',', $params;
|
||||
|
||||
fatal_error "Invalid IPMARK parameters ($params)" if $bad;
|
||||
fatal_error "Invalid IPMARK parameter ($sd)" unless ( $sd eq 'src' || $sd eq 'dst' );
|
||||
$srcdst = $sd;
|
||||
|
||||
if ( supplied $m1 ) {
|
||||
$val = numeric_value ($m1);
|
||||
fatal_error "Invalid Mask ($m1)" unless defined $val && $val && $val <= 0xffffffff;
|
||||
$mask1 = in_hex ( $val & 0xffffffff );
|
||||
}
|
||||
|
||||
if ( supplied $m2 ) {
|
||||
$val = numeric_value ($m2);
|
||||
fatal_error "Invalid Mask ($m2)" unless defined $val && $val <= 0xffffffff;
|
||||
$mask2 = in_hex ( $val & 0xffffffff );
|
||||
}
|
||||
|
||||
if ( defined $s ) {
|
||||
$val = numeric_value ($s);
|
||||
fatal_error "Invalid Shift Bits ($s)" unless defined $val && $val >= 0 && $val < 128;
|
||||
$shift = $s;
|
||||
}
|
||||
} else {
|
||||
fatal_error "Invalid MARK/CLASSIFY ($cmd)" unless $cmd eq 'IPMARK';
|
||||
}
|
||||
|
||||
$target = "IPMARK --addr $srcdst --and-mask $mask1 --or-mask $mask2 --shift $shift";
|
||||
},
|
||||
TPROXY => sub() {
|
||||
require_capability( 'TPROXY_TARGET', 'Use of TPROXY', 's');
|
||||
|
||||
fatal_error "Invalid TPROXY specification( $cmd/$rest )" if $rest;
|
||||
|
||||
$chain = 'tcpre';
|
||||
|
||||
$cmd =~ /TPROXY\((.+?)\)$/;
|
||||
|
||||
my $params = $1;
|
||||
|
||||
fatal_error "Invalid TPROXY specification( $cmd )" unless defined $params;
|
||||
|
||||
( $mark, my $port, my $ip, my $bad ) = split ',', $params;
|
||||
|
||||
fatal_error "Invalid TPROXY specification( $cmd )" if defined $bad;
|
||||
|
||||
if ( $port ) {
|
||||
$port = validate_port( 'tcp', $port );
|
||||
} else {
|
||||
$port = 0;
|
||||
}
|
||||
|
||||
$target .= " --on-port $port";
|
||||
|
||||
if ( supplied $ip ) {
|
||||
if ( $family == F_IPV6 ) {
|
||||
$ip = $1 if $ip =~ /^\[(.+)\]$/ || $ip =~ /^<(.+)>$/;
|
||||
}
|
||||
|
||||
validate_address $ip, 1;
|
||||
$target .= " --on-ip $ip";
|
||||
}
|
||||
|
||||
$target .= ' --tproxy-mark';
|
||||
},
|
||||
TTL => sub() {
|
||||
fatal_error "TTL is not supported in IPv6 - use HL instead" if $family == F_IPV6;
|
||||
fatal_error "Invalid TTL specification( $cmd/$rest )" if $rest;
|
||||
fatal_error "Chain designator $designator not allowed with TTL" if $designator && ! ( $designator eq 'F' );
|
||||
|
||||
$chain = 'tcfor';
|
||||
|
||||
$cmd =~ /^TTL\(([-+]?\d+)\)$/;
|
||||
|
||||
my $param = $1;
|
||||
|
||||
fatal_error "Invalid TTL specification( $cmd )" unless $param && ( $param = abs $param ) < 256;
|
||||
|
||||
if ( $1 =~ /^\+/ ) {
|
||||
$target .= " --ttl-inc $param";
|
||||
} elsif ( $1 =~ /\-/ ) {
|
||||
$target .= " --ttl-dec $param";
|
||||
} else {
|
||||
$target .= " --ttl-set $param";
|
||||
}
|
||||
},
|
||||
HL => sub() {
|
||||
fatal_error "HL is not supported in IPv4 - use TTL instead" if $family == F_IPV4;
|
||||
fatal_error "Invalid HL specification( $cmd/$rest )" if $rest;
|
||||
fatal_error "Chain designator $designator not allowed with HL" if $designator && ! ( $designator eq 'F' );
|
||||
|
||||
$chain = 'tcfor';
|
||||
|
||||
$cmd =~ /^HL\(([-+]?\d+)\)$/;
|
||||
|
||||
my $param = $1;
|
||||
|
||||
fatal_error "Invalid HL specification( $cmd )" unless $param && ( $param = abs $param ) < 256;
|
||||
|
||||
if ( $1 =~ /^\+/ ) {
|
||||
$target .= " --hl-inc $param";
|
||||
} elsif ( $1 =~ /\-/ ) {
|
||||
$target .= " --hl-dec $param";
|
||||
} else {
|
||||
$target .= " --hl-set $param";
|
||||
}
|
||||
},
|
||||
IMQ => sub() {
|
||||
assert( $cmd =~ /^IMQ\((\d+)\)$/ );
|
||||
require_capability 'IMQ_TARGET', 'IMQ', 's';
|
||||
$target .= " --todev $1";
|
||||
},
|
||||
DSCP => sub() {
|
||||
assert( $cmd =~ /^DSCP\((\w+)\)$/ );
|
||||
require_capability 'DSCP_TARGET', 'The DSCP action', 's';
|
||||
my $dscp = numeric_value( $1 );
|
||||
$dscp = $dscpmap{$1} unless defined $dscp;
|
||||
fatal_error( "Invalid DSCP ($1)" ) unless defined $dscp && $dscp <= 0x38 && ! ( $dscp & 1 );
|
||||
$target .= ' --set-dscp ' . in_hex( $dscp );
|
||||
},
|
||||
TOS => sub() {
|
||||
assert( $cmd =~ /^TOS\((.+)\)$/ );
|
||||
$target .= decode_tos( $1 , 2 );
|
||||
},
|
||||
);
|
||||
|
||||
if ( $source ) {
|
||||
if ( $source eq $fw ) {
|
||||
@@ -312,12 +463,15 @@ sub process_tc_rule( ) {
|
||||
}
|
||||
}
|
||||
|
||||
my ($cmd, $rest) = split( '/', $mark, 2 );
|
||||
if ( $mark =~ /^TOS/ ) {
|
||||
$cmd = $mark;
|
||||
$rest = '';
|
||||
} else {
|
||||
($cmd, $rest) = split( '/', $mark, 2 );
|
||||
}
|
||||
|
||||
$list = '';
|
||||
|
||||
my $restriction = 0;
|
||||
|
||||
unless ( $classid ) {
|
||||
MARK:
|
||||
{
|
||||
@@ -336,134 +490,8 @@ sub process_tc_rule( ) {
|
||||
$mark =~ s/^[|&]//;
|
||||
}
|
||||
|
||||
if ( $target eq 'sticky' ) {
|
||||
if ( $chain eq 'tcout' ) {
|
||||
$target = 'sticko';
|
||||
} else {
|
||||
fatal_error "SAME rules are only allowed in the PREROUTING and OUTPUT chains" if $chain ne 'tcpre';
|
||||
}
|
||||
|
||||
$restriction = DESTIFACE_DISALLOW;
|
||||
|
||||
ensure_mangle_chain($target);
|
||||
|
||||
$sticky++;
|
||||
} elsif ( $target eq 'IPMARK' ) {
|
||||
my ( $srcdst, $mask1, $mask2, $shift ) = ('src', 255, 0, 0 );
|
||||
|
||||
require_capability 'IPMARK_TARGET', 'IPMARK', 's';
|
||||
|
||||
if ( $cmd =~ /^IPMARK\((.+?)\)$/ ) {
|
||||
my $params = $1;
|
||||
my $val;
|
||||
|
||||
my ( $sd, $m1, $m2, $s , $bad ) = split ',', $params;
|
||||
|
||||
fatal_error "Invalid IPMARK parameters ($params)" if $bad;
|
||||
fatal_error "Invalid IPMARK parameter ($sd)" unless ( $sd eq 'src' || $sd eq 'dst' );
|
||||
$srcdst = $sd;
|
||||
|
||||
if ( supplied $m1 ) {
|
||||
$val = numeric_value ($m1);
|
||||
fatal_error "Invalid Mask ($m1)" unless defined $val && $val && $val <= 0xffffffff;
|
||||
$mask1 = in_hex ( $val & 0xffffffff );
|
||||
}
|
||||
|
||||
if ( supplied $m2 ) {
|
||||
$val = numeric_value ($m2);
|
||||
fatal_error "Invalid Mask ($m2)" unless defined $val && $val <= 0xffffffff;
|
||||
$mask2 = in_hex ( $val & 0xffffffff );
|
||||
}
|
||||
|
||||
if ( defined $s ) {
|
||||
$val = numeric_value ($s);
|
||||
fatal_error "Invalid Shift Bits ($s)" unless defined $val && $val >= 0 && $val < 128;
|
||||
$shift = $s;
|
||||
}
|
||||
} else {
|
||||
fatal_error "Invalid MARK/CLASSIFY ($cmd)" unless $cmd eq 'IPMARK';
|
||||
}
|
||||
|
||||
$target = "IPMARK --addr $srcdst --and-mask $mask1 --or-mask $mask2 --shift $shift";
|
||||
} elsif ( $target eq 'TPROXY' ) {
|
||||
require_capability( 'TPROXY_TARGET', 'Use of TPROXY', 's');
|
||||
|
||||
fatal_error "Invalid TPROXY specification( $cmd/$rest )" if $rest;
|
||||
|
||||
$chain = 'tcpre';
|
||||
|
||||
$cmd =~ /TPROXY\((.+?)\)$/;
|
||||
|
||||
my $params = $1;
|
||||
|
||||
fatal_error "Invalid TPROXY specification( $cmd )" unless defined $params;
|
||||
|
||||
( $mark, my $port, my $ip, my $bad ) = split ',', $params;
|
||||
|
||||
fatal_error "Invalid TPROXY specification( $cmd )" if defined $bad;
|
||||
|
||||
if ( $port ) {
|
||||
$port = validate_port( 'tcp', $port );
|
||||
} else {
|
||||
$port = 0;
|
||||
}
|
||||
|
||||
$target .= " --on-port $port";
|
||||
|
||||
if ( supplied $ip ) {
|
||||
if ( $family == F_IPV6 ) {
|
||||
$ip = $1 if $ip =~ /^\[(.+)\]$/ || $ip =~ /^<(.+)>$/;
|
||||
}
|
||||
|
||||
validate_address $ip, 1;
|
||||
$target .= " --on-ip $ip";
|
||||
}
|
||||
|
||||
$target .= ' --tproxy-mark';
|
||||
} elsif ( $target eq 'TTL' ) {
|
||||
fatal_error "TTL is not supported in IPv6 - use HL instead" if $family == F_IPV6;
|
||||
fatal_error "Invalid TTL specification( $cmd/$rest )" if $rest;
|
||||
fatal_error "Chain designator $designator not allowed with TTL" if $designator && ! ( $designator eq 'F' );
|
||||
|
||||
$chain = 'tcfor';
|
||||
|
||||
$cmd =~ /^TTL\(([-+]?\d+)\)$/;
|
||||
|
||||
my $param = $1;
|
||||
|
||||
fatal_error "Invalid TTL specification( $cmd )" unless $param && ( $param = abs $param ) < 256;
|
||||
|
||||
if ( $1 =~ /^\+/ ) {
|
||||
$target .= " --ttl-inc $param";
|
||||
} elsif ( $1 =~ /\-/ ) {
|
||||
$target .= " --ttl-dec $param";
|
||||
} else {
|
||||
$target .= " --ttl-set $param";
|
||||
}
|
||||
} elsif ( $target eq 'HL' ) {
|
||||
fatal_error "HL is not supported in IPv4 - use TTL instead" if $family == F_IPV4;
|
||||
fatal_error "Invalid HL specification( $cmd/$rest )" if $rest;
|
||||
fatal_error "Chain designator $designator not allowed with HL" if $designator && ! ( $designator eq 'F' );
|
||||
|
||||
$chain = 'tcfor';
|
||||
|
||||
$cmd =~ /^HL\(([-+]?\d+)\)$/;
|
||||
|
||||
my $param = $1;
|
||||
|
||||
fatal_error "Invalid HL specification( $cmd )" unless $param && ( $param = abs $param ) < 256;
|
||||
|
||||
if ( $1 =~ /^\+/ ) {
|
||||
$target .= " --hl-inc $param";
|
||||
} elsif ( $1 =~ /\-/ ) {
|
||||
$target .= " --hl-dec $param";
|
||||
} else {
|
||||
$target .= " --hl-set $param";
|
||||
}
|
||||
} elsif ( $target eq 'IMQ' ) {
|
||||
assert( $cmd =~ /^IMQ\((\d+)\)$/ );
|
||||
require_capability 'IMQ_TARGET', 'IMQ', 's';
|
||||
$target .= " --todev $1";
|
||||
if ( my $f = $processtcc{$target} ) {
|
||||
$f->();
|
||||
}
|
||||
|
||||
if ( $rest ) {
|
||||
@@ -510,7 +538,8 @@ sub process_tc_rule( ) {
|
||||
do_connbytes( $connbytes ) .
|
||||
do_helper( $helper ) .
|
||||
do_headers( $headers ) .
|
||||
do_probability( $probability ) ,
|
||||
do_probability( $probability ) .
|
||||
do_dscp( $dscp ),
|
||||
$source ,
|
||||
$dest ,
|
||||
'' ,
|
||||
@@ -855,7 +884,7 @@ sub validate_tc_device( ) {
|
||||
pfifo => $pfifo,
|
||||
tablenumber => 1 ,
|
||||
redirected => \@redirected,
|
||||
default => 0,
|
||||
default => undef,
|
||||
nextclass => 2,
|
||||
qdisc => $qdisc,
|
||||
guarantee => 0,
|
||||
@@ -998,6 +1027,7 @@ sub validate_tc_class( ) {
|
||||
}
|
||||
} else {
|
||||
fatal_error "Duplicate Class NUMBER ($classnumber)" if $tcref->{$classnumber};
|
||||
$markval = '-';
|
||||
}
|
||||
|
||||
if ( $parentclass != 1 ) {
|
||||
@@ -1114,8 +1144,10 @@ sub validate_tc_class( ) {
|
||||
}
|
||||
|
||||
unless ( $devref->{classify} || $occurs > 1 ) {
|
||||
fatal_error "Missing MARK" if $mark eq '-';
|
||||
warning_message "Class NUMBER ignored -- INTERFACE $device does not have the 'classify' option" if $devclass =~ /:/;
|
||||
if ( $mark ne '-' ) {
|
||||
fatal_error "Missing MARK" if $mark eq '-';
|
||||
warning_message "Class NUMBER ignored -- INTERFACE $device does not have the 'classify' option" if $devclass =~ /:/;
|
||||
}
|
||||
}
|
||||
|
||||
$tcref->{flow} = $devref->{flow} unless $tcref->{flow};
|
||||
@@ -1596,7 +1628,7 @@ sub process_traffic_shaping() {
|
||||
my $devnum = in_hexp $devref->{number};
|
||||
my $r2q = int calculate_r2q $devref->{out_bandwidth};
|
||||
|
||||
fatal_error "No default class defined for device $devname" unless $devref->{default};
|
||||
fatal_error "No default class defined for device $devname" unless defined $devref->{default};
|
||||
|
||||
my $device = physical_name $devname;
|
||||
|
||||
@@ -1708,7 +1740,7 @@ sub process_traffic_shaping() {
|
||||
#
|
||||
# add filters
|
||||
#
|
||||
unless ( $devref->{classify} ) {
|
||||
unless ( $mark eq '-' ) {
|
||||
emit "run_tc filter add dev $device protocol all parent $devicenumber:0 prio " . ( $priority | 20 ) . " handle $mark fw classid $classid" if $tcref->{occurs} == 1;
|
||||
}
|
||||
|
||||
@@ -1988,6 +2020,18 @@ sub setup_tc() {
|
||||
mask => '',
|
||||
connmark => 0
|
||||
},
|
||||
{ match => sub( $ ) { $_[0] =~ /^DSCP\(\w+\)$/ },
|
||||
target => 'DSCP',
|
||||
mark => NOMARK,
|
||||
mask => '',
|
||||
connmark => 0
|
||||
},
|
||||
{ match => sub( $ ) { $_[0] =~ /^TOS\(.+\)$/ },
|
||||
target => 'TOS',
|
||||
mark => NOMARK,
|
||||
mask => '',
|
||||
connmark => 0
|
||||
},
|
||||
);
|
||||
|
||||
if ( my $fn = open_file 'tcrules' ) {
|
||||
|
@@ -227,6 +227,25 @@ my %maxoptionvalue = ( routefilter => 2, mss => 100000 , wait => 120 );
|
||||
|
||||
my %validhostoptions;
|
||||
|
||||
my %validzoneoptions = ( mss => NUMERIC,
|
||||
nomark => NOTHING,
|
||||
blacklist => NOTHING,
|
||||
strict => NOTHING,
|
||||
next => NOTHING,
|
||||
reqid => NUMERIC,
|
||||
spi => NUMERIC,
|
||||
proto => IPSECPROTO,
|
||||
mode => IPSECMODE,
|
||||
"tunnel-src" => NETWORK,
|
||||
"tunnel-dst" => NETWORK,
|
||||
);
|
||||
|
||||
use constant { UNRESTRICTED => 1, NOFW => 2 , COMPLEX => 8, IN_OUT_ONLY => 16 };
|
||||
#
|
||||
# Hash of options that have their own key in the returned hash.
|
||||
#
|
||||
my %zonekey = ( mss => UNRESTRICTED | COMPLEX , blacklist => NOFW, nomark => NOFW | IN_OUT_ONLY );
|
||||
|
||||
#
|
||||
# Rather than initializing globals in an INIT block or during declaration,
|
||||
# we initialize them in a function. This is done for two reasons:
|
||||
@@ -329,25 +348,6 @@ sub initialize( $$ ) {
|
||||
#
|
||||
sub parse_zone_option_list($$\$$)
|
||||
{
|
||||
my %validoptions = ( mss => NUMERIC,
|
||||
nomark => NOTHING,
|
||||
blacklist => NOTHING,
|
||||
strict => NOTHING,
|
||||
next => NOTHING,
|
||||
reqid => NUMERIC,
|
||||
spi => NUMERIC,
|
||||
proto => IPSECPROTO,
|
||||
mode => IPSECMODE,
|
||||
"tunnel-src" => NETWORK,
|
||||
"tunnel-dst" => NETWORK,
|
||||
);
|
||||
|
||||
use constant { UNRESTRICTED => 1, NOFW => 2 , COMPLEX => 8, IN_OUT_ONLY => 16 };
|
||||
#
|
||||
# Hash of options that have their own key in the returned hash.
|
||||
#
|
||||
my %key = ( mss => UNRESTRICTED | COMPLEX , blacklist => NOFW, nomark => NOFW | IN_OUT_ONLY );
|
||||
|
||||
my ( $list, $zonetype, $complexref, $column ) = @_;
|
||||
my %h;
|
||||
my $options = '';
|
||||
@@ -367,7 +367,7 @@ sub parse_zone_option_list($$\$$)
|
||||
$e = $1;
|
||||
}
|
||||
|
||||
$fmt = $validoptions{$e};
|
||||
$fmt = $validzoneoptions{$e};
|
||||
|
||||
fatal_error "Invalid Option ($e)" unless $fmt;
|
||||
|
||||
@@ -378,7 +378,7 @@ sub parse_zone_option_list($$\$$)
|
||||
fatal_error "Invalid value ($val) for option \"$e\"" unless $val =~ /^($fmt)$/;
|
||||
}
|
||||
|
||||
my $key = $key{$e};
|
||||
my $key = $zonekey{$e};
|
||||
|
||||
if ( $key ) {
|
||||
fatal_error "Option '$e' not permitted with this zone type " if $key & NOFW && ($zonetype & ( FIREWALL | VSERVER) );
|
||||
@@ -403,7 +403,7 @@ sub parse_zone_option_list($$\$$)
|
||||
#
|
||||
# Set the super option on the passed zoneref and propagate to its parents
|
||||
#
|
||||
sub set_super( $ );
|
||||
sub set_super( $ ); #required for recursion
|
||||
|
||||
sub set_super( $ ) {
|
||||
my $zoneref = shift;
|
||||
@@ -769,13 +769,13 @@ sub add_group_to_zone($$$$$)
|
||||
|
||||
my $gtype = $type & IPSEC ? 'ipsec' : 'ip';
|
||||
|
||||
$hostsref = ( $zoneref->{hosts} || ( $zoneref->{hosts} = {} ) );
|
||||
$typeref = ( $hostsref->{$gtype} || ( $hostsref->{$gtype} = {} ) );
|
||||
$interfaceref = ( $typeref->{$interface} || ( $typeref->{$interface} = [] ) );
|
||||
$hostsref = ( $zoneref->{hosts} ||= {} );
|
||||
$typeref = ( $hostsref->{$gtype} ||= {} );
|
||||
$interfaceref = ( $typeref->{$interface} ||= [] );
|
||||
|
||||
fatal_error "Duplicate Host Group ($interface:" . ALLIP . ") in zone $zone" if $allip && @$interfaceref;
|
||||
|
||||
$zoneref->{options}{complex} = 1 if @$interfaceref || ( @newnetworks > 1 ) || ( @exclusions ) || $options->{routeback};
|
||||
$zoneref->{options}{complex} = 1 if @$interfaceref || @newnetworks > 1 || @exclusions || $options->{routeback};
|
||||
|
||||
push @{$interfaceref}, { options => $options,
|
||||
hosts => \@newnetworks,
|
||||
@@ -912,10 +912,27 @@ sub process_interface( $$ ) {
|
||||
my ( $nextinum, $export ) = @_;
|
||||
my $netsref = '';
|
||||
my $filterref = [];
|
||||
my ($zone, $originalinterface, $bcasts, $options ) = split_line 'interfaces file', { zone => 0, interface => 1, broadcast => 2, options => 3 };
|
||||
my ($zone, $originalinterface, $bcasts, $options );
|
||||
my $zoneref;
|
||||
my $bridge = '';
|
||||
our $format;
|
||||
|
||||
if ( $format == 1 ) {
|
||||
($zone, $originalinterface, $bcasts, $options ) = split_line1 'interfaces file', { zone => 0, interface => 1, broadcast => 2, options => 3 }, { COMMENT => 0, FORMAT => 2 };
|
||||
} else {
|
||||
($zone, $originalinterface, $options ) = split_line1 'interfaces file', { zone => 0, interface => 1, options => 2 }, { COMMENT => 0, FORMAT => 2 };
|
||||
$bcasts = '-';
|
||||
}
|
||||
|
||||
if ( $zone eq 'FORMAT' ) {
|
||||
if ( $originalinterface =~ /^([12])$/ ) {
|
||||
$format = $1;
|
||||
return;
|
||||
}
|
||||
|
||||
fatal_error "Invalid FORMAT ($1)";
|
||||
}
|
||||
|
||||
if ( $zone eq '-' ) {
|
||||
$zone = '';
|
||||
} else {
|
||||
@@ -1185,7 +1202,8 @@ sub process_interface( $$ ) {
|
||||
# Parse the interfaces file.
|
||||
#
|
||||
sub validate_interfaces_file( $ ) {
|
||||
my $export = shift;
|
||||
my $export = shift;
|
||||
our $format = 1;
|
||||
|
||||
my @ifaces;
|
||||
my $nextinum = 1;
|
||||
@@ -1814,7 +1832,7 @@ sub process_host( ) {
|
||||
$interface = $1;
|
||||
$hosts = $2;
|
||||
|
||||
fatal_error "Unknown interface ($interface)" unless ($interfaceref = $interfaces{$interface})->{root};
|
||||
fatal_error "Unknown interface ($interface)" unless ($interfaceref = $interfaces{$interface}) && $interfaceref->{root};
|
||||
} else {
|
||||
fatal_error "Invalid HOST(S) column contents: $hosts"
|
||||
}
|
||||
@@ -1915,7 +1933,6 @@ sub validate_hosts_file()
|
||||
$have_ipsec = $ipsec || haveipseczones;
|
||||
|
||||
$_->{options}{complex} ||= ( keys %{$_->{interfaces}} > 1 ) for values %zones;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
|
@@ -62,12 +62,14 @@ checkkernelversion() {
|
||||
#
|
||||
# Start trace if first arg is "debug" or "trace"
|
||||
#
|
||||
g_debug_iptables=
|
||||
|
||||
if [ $# -gt 1 ]; then
|
||||
if [ "x$1" = "xtrace" ]; then
|
||||
set -x
|
||||
shift
|
||||
elif [ "x$1" = "xdebug" ]; then
|
||||
DEBUG=Yes
|
||||
g_debug_iptables=Yes
|
||||
shift
|
||||
fi
|
||||
fi
|
||||
|
@@ -49,7 +49,7 @@ my $target = require_audit ( $action , $audit );
|
||||
log_rule_limit $level, $chainref, 'Invalid' , $action, '', $tag, 'add', "$globals{STATEMATCH} INVALID " if $level ne '';
|
||||
add_jump $chainref , $target, 0, "$globals{STATEMATCH} INVALID ";
|
||||
|
||||
$chainref->{dont_optimize} = 0;
|
||||
allow_optimize( $chainref );
|
||||
|
||||
1;
|
||||
|
||||
|
@@ -49,7 +49,7 @@ my $target = require_audit ( $action , $audit );
|
||||
log_rule_limit $level, $chainref, 'NotSyn' , $action, '', $tag, 'add', '-p 6 ! --syn ' if $level ne '';
|
||||
add_jump $chainref , $target, 0, '-p 6 ! --syn ';
|
||||
|
||||
$chainref->{dont_optimize} = 0;
|
||||
allow_optimize( $chainref );
|
||||
|
||||
1;
|
||||
|
||||
|
@@ -7,4 +7,8 @@
|
||||
# http://www.shorewall.net/manpages/shorewall-interfaces.html
|
||||
#
|
||||
###############################################################################
|
||||
FORMAT 1
|
||||
#ZONE INTERFACE BROADCAST OPTIONS
|
||||
|
||||
FORMAT 2
|
||||
#ZONE INTERFACE OPTIONS
|
||||
|
@@ -6,6 +6,6 @@
|
||||
# The manpage is also online at
|
||||
# http://www.shorewall.net/manpages/shorewall-masq.html
|
||||
#
|
||||
#############################################################################################
|
||||
#INTERFACE:DEST SOURCE ADDRESS PROTO PORT(S) IPSEC MARK USER/
|
||||
######################################################################################################
|
||||
#INTERFACE:DEST SOURCE ADDRESS PROTO PORT(S) IPSEC MARK USER/ SWITCH
|
||||
# GROUP
|
||||
|
@@ -9,7 +9,7 @@
|
||||
#
|
||||
# See http://shorewall.net/PacketMarking.html for a detailed description of
|
||||
# the Netfilter/Shorewall packet marking mechanism.
|
||||
######################################################################################################################################
|
||||
#MARK SOURCE DEST PROTO DEST SOURCE USER TEST LENGTH TOS CONNBYTES HELPER PROBABILITY
|
||||
##########################################################################################################################################
|
||||
#MARK SOURCE DEST PROTO DEST SOURCE USER TEST LENGTH TOS CONNBYTES HELPER PROBABILITY DSCP
|
||||
# PORT(S) PORT(S)
|
||||
|
||||
|
@@ -4,5 +4,5 @@
|
||||
# For information about entries in this file, type "man shorewall-tos"
|
||||
#
|
||||
###############################################################################
|
||||
#SOURCE DEST PROTOCOL SOURCE DEST TOS MARK
|
||||
#SOURCE DEST PROTOCOL DEST SOURCE TOS MARK
|
||||
# PORTS PORTS
|
||||
|
@@ -78,13 +78,13 @@ shift
|
||||
|
||||
case "$command" in
|
||||
start)
|
||||
exec /sbin/shorewall $OPTIONS start $STARTOPTIONS $@
|
||||
exec /sbin/shorewall $OPTIONS start $STARTOPTIONS
|
||||
;;
|
||||
restart|reload)
|
||||
exec /sbin/shorewall $OPTIONS restart $RESTARTOPTIONS $@
|
||||
exec /sbin/shorewall $OPTIONS restart $RESTARTOPTIONS
|
||||
;;
|
||||
status|stop)
|
||||
exec /sbin/shorewall $OPTIONS $command $@
|
||||
exec /sbin/shorewall $OPTIONS $command
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
|
@@ -92,6 +92,11 @@ install_file() # $1 = source $2 = target $3 = mode
|
||||
|
||||
cd "$(dirname $0)"
|
||||
|
||||
#
|
||||
# Load packager's settings if any
|
||||
#
|
||||
[ -f ../shorewall-pkg.config ] && . ../shorewall-pkg.config
|
||||
|
||||
if [ -f shorewall ]; then
|
||||
PRODUCT=shorewall
|
||||
Product=Shorewall
|
||||
@@ -105,26 +110,15 @@ fi
|
||||
#
|
||||
# Parse the run line
|
||||
#
|
||||
# DEST is the SysVInit script directory
|
||||
# INIT is the name of the script in the $DEST directory
|
||||
#
|
||||
T="-T"
|
||||
|
||||
if [ -z "$DEST" ] ; then
|
||||
DEST="/etc/init.d"
|
||||
fi
|
||||
|
||||
if [ -z "$INIT" ] ; then
|
||||
INIT="$PRODUCT"
|
||||
fi
|
||||
|
||||
ANNOTATED=
|
||||
CYGWIN=
|
||||
MAC=
|
||||
MACHOST=
|
||||
MANDIR=${MANDIR:-"/usr/share/man"}
|
||||
SPARSE=
|
||||
INSTALLD='-D'
|
||||
INITFILE="$PRODUCT"
|
||||
|
||||
[ -n "${LIBEXEC:=/usr/share}" ]
|
||||
[ -n "${PERLLIB:=/usr/share/shorewall}" ]
|
||||
|
||||
@@ -132,7 +126,8 @@ case "$LIBEXEC" in
|
||||
/*)
|
||||
;;
|
||||
*)
|
||||
LIBEXEC=/usr/${LIBEXEC}
|
||||
echo "The LIBEXEC setting must be an absolute path name" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -140,33 +135,45 @@ case "$PERLLIB" in
|
||||
/*)
|
||||
;;
|
||||
*)
|
||||
PERLLIB=/usr/${PERLLIB}
|
||||
echo "The PERLLIB setting must be an absolute path name" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
case $(uname) in
|
||||
CYGWIN*)
|
||||
if [ -z "$DESTDIR" ]; then
|
||||
DEST=
|
||||
INIT=
|
||||
fi
|
||||
if [ -z "$BUILD" ]; then
|
||||
case $(uname) in
|
||||
cygwin*)
|
||||
BUILD=cygwin
|
||||
;;
|
||||
Darwin)
|
||||
BUILD=apple
|
||||
;;
|
||||
*)
|
||||
if [ -f /etc/debian_version ]; then
|
||||
BUILD=debian
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
BUILD=redhat
|
||||
elif [ -f /etc/slackware-version ] ; then
|
||||
BUILD=slackware
|
||||
elif [ -f /etc/SuSE-release ]; then
|
||||
BUILD=suse
|
||||
elif [ -f /etc/arch-release ] ; then
|
||||
BUILD=archlinux
|
||||
else
|
||||
BUILD=linux
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
case $BUILD in
|
||||
cygwin*)
|
||||
OWNER=$(id -un)
|
||||
GROUP=$(id -gn)
|
||||
CYGWIN=Yes
|
||||
SPARSE=Yes
|
||||
;;
|
||||
Darwin)
|
||||
if [ -z "$DESTDIR" ]; then
|
||||
DEST=
|
||||
INIT=
|
||||
SPARSE=Yes
|
||||
fi
|
||||
|
||||
apple)
|
||||
[ -z "$OWNER" ] && OWNER=root
|
||||
[ -z "$GROUP" ] && GROUP=wheel
|
||||
MAC=Yes
|
||||
MACHOST=Yes
|
||||
INSTALLD=
|
||||
T=
|
||||
;;
|
||||
@@ -229,8 +236,64 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
|
||||
# Determine where to install the firewall script
|
||||
#
|
||||
|
||||
if [ $PRODUCT = shorewall -a -z "${DESTDIR}" ]; then
|
||||
#
|
||||
# Verify that Perl is installed
|
||||
#
|
||||
if ! perl -c Perl/compiler.pl; then
|
||||
echo "ERROR: $Product $VERSION requires Perl which either is not installed or is not able to compile the $Product perl code" >&2
|
||||
echo " Try perl -c $PWD/Perl/compiler.pl" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -n "$HOST" ] || HOST=$BUILD
|
||||
|
||||
case "$HOST" in
|
||||
cygwin)
|
||||
echo "Installing Cygwin-specific configuration..."
|
||||
INITFILE=
|
||||
;;
|
||||
apple)
|
||||
echo "Installing Mac-specific configuration...";
|
||||
INITFILE=
|
||||
;;
|
||||
debian)
|
||||
echo "Installing Debian-specific configuration..."
|
||||
SPARSE=yes
|
||||
;;
|
||||
redhat)
|
||||
echo "Installing Redhat/Fedora-specific configuration..."
|
||||
[ -n "$INITDIR" ] || INITDIR="/etc/rc.d/init.d"
|
||||
;;
|
||||
suse)
|
||||
echo "Installing SuSE-specific configuration...";
|
||||
;;
|
||||
slackware)
|
||||
echo "Installing Slackware-specific configuration..."
|
||||
[ -n "$INITDIR" ] || INITDIR="/etc/rc.d"
|
||||
[ -n "$MANDIR" ] || MANDIR="/usr/man"
|
||||
[ -n "$INITFILE" ] || INITFILE="rc.firewall"
|
||||
;;
|
||||
archlinux)
|
||||
echo "Installing ArchLinux-specific configuration..."
|
||||
[ -n "$INITDIR" ] || INITDIR="/etc/rc.d"
|
||||
[ -n "$INITFILE" ] || INITFILE="$PRODUCT"
|
||||
;;
|
||||
linux)
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: Unknown HOST \"$HOST\"" >&2
|
||||
exit 1;
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$INITDIR" -a -n "$INITFILE" ] ; then
|
||||
INITDIR="/etc/init.d"
|
||||
fi
|
||||
|
||||
if [ -n "$DESTDIR" ]; then
|
||||
if [ -z "$CYGWIN" ]; then
|
||||
if [ $BUILD != cygwin ]; then
|
||||
if [ `id -u` != 0 ] ; then
|
||||
echo "Not setting file owner/group permissions, not running as root."
|
||||
OWNERSHIP=""
|
||||
@@ -238,58 +301,20 @@ if [ -n "$DESTDIR" ]; then
|
||||
fi
|
||||
|
||||
install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
|
||||
install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
|
||||
|
||||
CYGWIN=
|
||||
MAC=
|
||||
else
|
||||
if [ $PRODUCT = shorewall ]; then
|
||||
#
|
||||
# Verify that Perl is installed
|
||||
#
|
||||
if ! perl -c Perl/compiler.pl; then
|
||||
echo "ERROR: $Product $VERSION requires Perl which either is not installed or is not able to compile the $Product perl code" >&2
|
||||
echo " Try perl -c $PWD/Perl/compiler.pl" >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
[ -x /usr/share/shorewall/compiler.pl ] || \
|
||||
{ echo " ERROR: Shorewall >= 4.3.5 is not installed" >&2; exit 1; }
|
||||
fi
|
||||
|
||||
if [ -n "$CYGWIN" ]; then
|
||||
echo "Installing Cygwin-specific configuration..."
|
||||
elif [ -n "$MAC" ]; then
|
||||
echo "Installing Mac-specific configuration..."
|
||||
else
|
||||
if [ -f /etc/debian_version ]; then
|
||||
echo "Installing Debian-specific configuration..."
|
||||
DEBIAN=yes
|
||||
SPARSE=yes
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
echo "Installing Redhat/Fedora-specific configuration..."
|
||||
FEDORA=yes
|
||||
elif [ -f /etc/slackware-version ] ; then
|
||||
echo "Installing Slackware-specific configuration..."
|
||||
DEST="/etc/rc.d"
|
||||
MANDIR="/usr/man"
|
||||
SLACKWARE=yes
|
||||
INIT="rc.firewall"
|
||||
elif [ -f /etc/arch-release ] ; then
|
||||
echo "Installing ArchLinux-specific configuration..."
|
||||
DEST="/etc/rc.d"
|
||||
INIT="$PRODUCT"
|
||||
ARCHLINUX=yes
|
||||
fi
|
||||
fi
|
||||
install -d $OWNERSHIP -m 755 ${DESTDIR}${INITDIR}
|
||||
elif [ $PRODUCT != shorewall ]; then
|
||||
[ -x ${LIBEXEC}/shorewall/compiler.pl ] || \
|
||||
{ echo " ERROR: Shorewall >= 4.5.0 is not installed" >&2; exit 1; }
|
||||
fi
|
||||
|
||||
if [ -z "$DESTDIR" ]; then
|
||||
if [ -f /lib/systemd/system ]; then
|
||||
SYSTEMD=Yes
|
||||
INITFILE=
|
||||
fi
|
||||
elif [ -n "$SYSTEMD" ]; then
|
||||
mkdir -p ${DESTDIR}/lib/systemd/system
|
||||
INITFILE=
|
||||
fi
|
||||
|
||||
echo "Installing $Product Version $VERSION"
|
||||
@@ -308,40 +333,38 @@ if [ -z "${DESTDIR}" -a $PRODUCT = shorewall -a ! -f /usr/share/$PRODUCT/corever
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$CYGWIN" ]; then
|
||||
if [ $HOST != cygwin ]; then
|
||||
install_file $PRODUCT ${DESTDIR}/sbin/$PRODUCT 0755
|
||||
if [ -z "$MACHOST" ]; then
|
||||
eval sed -i \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/sbin/$PRODUCT
|
||||
eval sed -i \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/sbin/$PRODUCT
|
||||
else
|
||||
eval sed -i \'\' -e \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/sbin/$PRODUCT
|
||||
eval sed -i \'\' -e \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/sbin/$PRODUCT
|
||||
fi
|
||||
echo "$PRODUCT control program installed in ${DESTDIR}/sbin/$PRODUCT"
|
||||
else
|
||||
install_file $PRODUCT ${DESTDIR}/bin/$PRODUCT 0755
|
||||
eval sed -i \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/bin/$PRODUCT
|
||||
eval sed -i \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/bin/$PRODUCT
|
||||
echo "$PRODUCT control program installed in ${DESTDIR}/bin/$PRODUCT"
|
||||
fi
|
||||
|
||||
#
|
||||
# Install the Firewall Script
|
||||
#
|
||||
if [ -n "$DEBIAN" ]; then
|
||||
install_file init.debian.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544
|
||||
elif [ -n "$FEDORA" ]; then
|
||||
install_file init.fedora.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544
|
||||
elif [ -n "$ARCHLINUX" ]; then
|
||||
install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544
|
||||
elif [ -n "$SLACKWARE" -a $PRODUCT = shorewall ]; then
|
||||
install_file init.slackware.firewall.sh ${DESTDIR}${DEST}/rc.firewall 0644
|
||||
install_file init.slackware.$PRODUCT.sh ${DESTDIR}${DEST}/rc.$PRODUCT 0644
|
||||
elif [ -n "$INIT" ]; then
|
||||
install_file init.sh ${DESTDIR}${DEST}/$INIT 0544
|
||||
fi
|
||||
if [ -n "$INITFILE" ]; then
|
||||
case $HOST in
|
||||
debian)
|
||||
install_file init.debian.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
||||
;;
|
||||
redhat)
|
||||
install_file init.fedora.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
||||
;;
|
||||
slackware)
|
||||
if [ $PRODUCT = shorewall ]; then
|
||||
install_file init.slackware.firewall.sh ${DESTDIR}${DEST}/rc.firewall 0644
|
||||
install_file init.slackware.$PRODUCT.sh ${DESTDIR}${DEST}/rc.$PRODUCT 0644
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
install_file init.sh ${DESTDIR}${INITDIR}/$INITFILE 0544
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -n "$INIT" ] && echo "$Product script installed in ${DESTDIR}${DEST}/$INIT"
|
||||
echo "$Product script installed in ${DESTDIR}${INITDIR}/$INITFILE"
|
||||
fi
|
||||
|
||||
#
|
||||
# Create /etc/$PRODUCT and /var/lib/$PRODUCT if needed
|
||||
@@ -436,7 +459,7 @@ run_install $OWNERSHIP -m 0644 $PRODUCT.conf.annotated ${DESTDIR}/usr/share/$PRO
|
||||
if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
|
||||
run_install $OWNERSHIP -m 0644 $PRODUCT.conf${suffix} ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
|
||||
|
||||
if [ -n "$DEBIAN" ] && mywhich perl; then
|
||||
if [ $HOST = debian ] && mywhich perl; then
|
||||
#
|
||||
# Make a Debian-like $PRODUCT.conf
|
||||
#
|
||||
@@ -447,7 +470,7 @@ if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "$ARCHLINUX" ] ; then
|
||||
if [ $HOST = archlinux ] ; then
|
||||
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
|
||||
fi
|
||||
|
||||
@@ -591,7 +614,7 @@ run_install $OWNERSHIP -m 0644 maclist.annotated ${DESTDIR}/usr/share/$PRODUCT/c
|
||||
|
||||
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/maclist ]; then
|
||||
run_install $OWNERSHIP -m 0600 maclist${suffix} ${DESTDIR}/etc/$PRODUCT/maclist
|
||||
echo "MAC list file installed as ${DESTDIR}/etc/$PRODUCT/maclist"
|
||||
echo "mac list file installed as ${DESTDIR}/etc/$PRODUCT/maclist"
|
||||
fi
|
||||
|
||||
if [ -f masq ]; then
|
||||
@@ -897,11 +920,6 @@ fi
|
||||
# Install the Isusable file
|
||||
#
|
||||
run_install $OWNERSHIP -m 0644 isusable ${DESTDIR}/usr/share/$PRODUCT/configfiles/isusable
|
||||
|
||||
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/isusable ]; then
|
||||
run_install $OWNERSHIP -m 0600 isusable ${DESTDIR}/etc/$PRODUCT/isusable
|
||||
echo "Isusable file installed as ${DESTDIR}/etc/$PRODUCT/isusable"
|
||||
fi
|
||||
#
|
||||
# Install the Refresh file
|
||||
#
|
||||
@@ -1057,7 +1075,7 @@ chmod 644 ${DESTDIR}/usr/share/$PRODUCT/version
|
||||
|
||||
if [ -z "$DESTDIR" ]; then
|
||||
rm -f /usr/share/$PRODUCT/init
|
||||
ln -s ${DEST}/${INIT} /usr/share/$PRODUCT/init
|
||||
ln -s ${INITDIR}/${INITFILE} /usr/share/$PRODUCT/init
|
||||
fi
|
||||
|
||||
#
|
||||
@@ -1089,8 +1107,8 @@ if [ -d ${DESTDIR}/etc/logrotate.d ]; then
|
||||
echo "Logrotate file installed as ${DESTDIR}/etc/logrotate.d/$PRODUCT"
|
||||
fi
|
||||
|
||||
if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${CYGWIN}${MAC}" ]; then
|
||||
if [ -n "$DEBIAN" ]; then
|
||||
if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then
|
||||
if [ $HOST = debian ]; then
|
||||
run_install $OWNERSHIP -m 0644 default.debian /etc/default/$PRODUCT
|
||||
|
||||
update-rc.d $PRODUCT defaults
|
||||
@@ -1126,7 +1144,7 @@ if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${CYGWIN}${MAC}" ]; then
|
||||
else
|
||||
cant_autostart
|
||||
fi
|
||||
elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically
|
||||
elif [ "$INITFILE" != rc.f ]; then #Slackware starts this automatically
|
||||
cant_autostart
|
||||
fi
|
||||
fi
|
||||
|
@@ -1579,7 +1579,7 @@ usage() # $1 = exit status
|
||||
echo " status"
|
||||
echo " stop"
|
||||
echo " try <directory> [ <timeout> ]"
|
||||
echo " update [ -b ] [ -r ] [ -T ] [ <directory> ]"
|
||||
echo " update [ -a ] [ -b ] [ -r ] [ -T ] [ <directory> ]"
|
||||
echo " version [ -a ]"
|
||||
echo
|
||||
exit $1
|
||||
|
@@ -510,6 +510,20 @@ debug_restore_input() {
|
||||
qt1 $g_tool -t raw -P $chain ACCEPT
|
||||
done
|
||||
|
||||
qt1 $g_tool -t rawpost -F
|
||||
qt1 $g_tool -t rawpost -X
|
||||
|
||||
for chain in POSTROUTING; do
|
||||
qt1 $g_tool -t rawpost -P $chain ACCEPT
|
||||
done
|
||||
|
||||
qt1 $g_tool -t nat -F
|
||||
qt1 $g_tool -t nat -X
|
||||
|
||||
for chain in PREROUTING POSTROUTING; do
|
||||
qt1 $g_tool -t nat -P $chain ACCEPT
|
||||
done
|
||||
|
||||
qt1 $g_tool -t filter -F
|
||||
qt1 $g_tool -t filter -X
|
||||
|
||||
|
@@ -75,12 +75,9 @@
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>A jump to a user-defined accounting chain before entries that
|
||||
add rules to that chain.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>This eliminates loops and unreferenced chains.</para>
|
||||
<para>A jump to a user-defined accounting chain must appear before
|
||||
entries that add rules to that chain. This eliminates loops and
|
||||
unreferenced chains.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
@@ -40,7 +40,7 @@
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">ACTION- {<emphasis
|
||||
role="bold">ACCEPT</emphasis>|CONTINUE|DROP|A_DROP|REJECT|A_REJECT|<emphasis
|
||||
role="bold">WHITELIES</emphasis>|<emphasis
|
||||
role="bold">WHITELIST</emphasis>|<emphasis
|
||||
role="bold">LOG</emphasis>|<emphasis
|
||||
role="bold">QUEUE</emphasis>|<emphasis
|
||||
role="bold">NFQUEUE</emphasis>[<emphasis
|
||||
@@ -292,10 +292,9 @@
|
||||
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||
shorewall-hosts(5), shorewall-interfaces(5), shorewall-maclist(5),
|
||||
shoewall6-netmap(5),shorewall-params(5), shorewall-policy(5),
|
||||
shorewall-providers(5), shorewall-rtrules(5),
|
||||
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
||||
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||
shorewall-tcrules(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||
shorewall-zones(5)</para>
|
||||
shorewall-providers(5), shorewall-rtrules(5), shorewall-routestopped(5),
|
||||
shorewall-rules(5), shorewall.conf(5), shorewall-secmarks(5),
|
||||
shorewall-tcclasses(5), shorewall-tcdevices(5), shorewall-tcrules(5),
|
||||
shorewall-tos(5), shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@@ -35,8 +35,8 @@
|
||||
<para>If you have more than one ISP link, adding entries to this file
|
||||
will <emphasis role="bold">not</emphasis> force connections to go out
|
||||
through a particular link. You must use entries in <ulink
|
||||
url="shorewall-rtrules.html">shorewall-rtrules</ulink>(5) or
|
||||
PREROUTING entries in <ulink
|
||||
url="shorewall-rtrules.html">shorewall-rtrules</ulink>(5) or PREROUTING
|
||||
entries in <ulink
|
||||
url="shorewall-tcrules.html">shorewall-tcrules</ulink>(5) to do
|
||||
that.</para>
|
||||
</warning>
|
||||
@@ -88,7 +88,8 @@
|
||||
addresses to indicate that you only want to change the source IP
|
||||
address for packets being sent to those particular destinations.
|
||||
Exclusion is allowed (see <ulink
|
||||
url="shorewall-exclusion.html">shorewall-exclusion</ulink>(5)).</para>
|
||||
url="shorewall-exclusion.html">shorewall-exclusion</ulink>(5)) as
|
||||
are ipset names preceded by a plus sign '+';</para>
|
||||
|
||||
<para>If you wish to inhibit the action of ADD_SNAT_ALIASES for this
|
||||
entry then include the ":" but omit the digit:</para>
|
||||
@@ -149,6 +150,10 @@
|
||||
|
||||
<para>In that example traffic from eth1 would be masqueraded unless
|
||||
it came from 192.168.1.4 or 196.168.32.0/27</para>
|
||||
|
||||
<para>The preferred way to specify the SOURCE is to supply one or
|
||||
more host or network addresses separated by comma. You may use ipset
|
||||
names preceded by a plus sign (+) to specify a set of hosts.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -467,6 +472,43 @@
|
||||
</variablelist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">SWITCH -
|
||||
[!]<replaceable>switch-name</replaceable></emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.5.1 and allows enabling and disabling the
|
||||
rule without requiring <command>shorewall restart</command>.</para>
|
||||
|
||||
<para>The rule is enabled if the value stored in
|
||||
<filename>/proc/net/nf_condition/<replaceable>switch-name</replaceable></filename>
|
||||
is 1. The rule is disabled if that file contains 0 (the default). If
|
||||
'!' is supplied, the test is inverted such that the rule is enabled
|
||||
if the file contains 0. <replaceable>switch-name</replaceable> must
|
||||
begin with a letter and be composed of letters, decimal digits,
|
||||
underscores or hyphens. Switch names must be 30 characters or less
|
||||
in length.</para>
|
||||
|
||||
<para>Switches are normally <emphasis role="bold">off</emphasis>. To
|
||||
turn a switch <emphasis role="bold">on</emphasis>:</para>
|
||||
|
||||
<simplelist>
|
||||
<member><command>echo 1 >
|
||||
/proc/net/nf_condition/<replaceable>switch-name</replaceable></command></member>
|
||||
</simplelist>
|
||||
|
||||
<para>To turn it <emphasis role="bold">off</emphasis> again:</para>
|
||||
|
||||
<simplelist>
|
||||
<member><command>echo 0 >
|
||||
/proc/net/nf_condition/<replaceable>switch-name</replaceable></command></member>
|
||||
</simplelist>
|
||||
|
||||
<para>Switch settings are retained over <command>shorewall
|
||||
restart</command>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
@@ -548,6 +590,19 @@
|
||||
</warning>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>Example 6:</term>
|
||||
|
||||
<listitem>
|
||||
<para>Connections leaving on eth0 and destined to any host defined
|
||||
in the ipset <emphasis>myset</emphasis> should have the source IP
|
||||
address changed to 206.124.146.177.</para>
|
||||
|
||||
<programlisting> #INTERFACE SOURCE ADDRESS
|
||||
eth0:+myset[dst] - 206.124.146.177</programlisting>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
|
@@ -468,6 +468,112 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
||||
<replaceable>number</replaceable>. Requires IMQ Target support
|
||||
in your kernel and iptables.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis
|
||||
role="bold">DSCP</emphasis>(<replaceable>dscp</replaceable>)</para>
|
||||
|
||||
<para>Added in Shorewall 4.5.1. Sets the
|
||||
<firstterm>Differentiated Services Code Point</firstterm> field
|
||||
in the IP header. The <replaceable>dscp</replaceable> value may
|
||||
be given as an even number (hex or decimal) or as the name of a
|
||||
DSCP class. Valid class names and their associated hex numeric
|
||||
values are:</para>
|
||||
|
||||
<programlisting> CS0 => 0x00
|
||||
CS1 => 0x08
|
||||
CS2 => 0x10
|
||||
CS3 => 0x18
|
||||
CS4 => 0x20
|
||||
CS5 => 0x28
|
||||
CS6 => 0x30
|
||||
CS7 => 0x38
|
||||
BE => 0x00
|
||||
AF11 => 0x0a
|
||||
AF12 => 0x0c
|
||||
AF13 => 0x0e
|
||||
AF21 => 0x12
|
||||
AF22 => 0x14
|
||||
AF23 => 0x16
|
||||
AF31 => 0x1a
|
||||
AF32 => 0x1c
|
||||
AF33 => 0x1e
|
||||
AF41 => 0x22
|
||||
AF42 => 0x24
|
||||
AF43 => 0x26
|
||||
EF => 0x2e</programlisting>
|
||||
|
||||
<para>May be optionally followed by ':' and a capital letter
|
||||
designating the chain where classification is to occur.</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>F</term>
|
||||
|
||||
<listitem>
|
||||
<para>FORWARD chain.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>T</term>
|
||||
|
||||
<listitem>
|
||||
<para>POSTROUTING chain (default).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis
|
||||
role="bold">TOS</emphasis>(<replaceable>tos</replaceable>[/<replaceable>mask</replaceable>])</para>
|
||||
|
||||
<para>Added in Shorewall 4.5.1. Sets the <firstterm>Type of
|
||||
Service</firstterm> field in the IP header. The
|
||||
<replaceable>tos</replaceable> value may be given as an number
|
||||
(hex or decimal) or as the name of a TOS type. Valid type names
|
||||
and their associated hex numeric values are:</para>
|
||||
|
||||
<programlisting>Minimize-Delay => 0x10,
|
||||
Maximize-Throughput => 0x08,
|
||||
Maximize-Reliability => 0x04,
|
||||
Minimize-Cost => 0x02,
|
||||
Normal-Service => 0x00</programlisting>
|
||||
|
||||
<para>When <replaceable>tos</replaceable> is given as a number,
|
||||
it may be optionally followed by '/' and a
|
||||
<replaceable>mask</replaceable>. When no
|
||||
<replaceable>mask</replaceable> is given, the value 0xff is
|
||||
assumed. When <replaceable>tos</replaceable> is given as a type
|
||||
name, the <replaceable>mask</replaceable> 0x3f is
|
||||
assumed.</para>
|
||||
|
||||
<para>The action performed is to zero out the bits specified by
|
||||
the <replaceable>mask</replaceable>, then set the bits specified
|
||||
by <replaceable>tos</replaceable>.</para>
|
||||
|
||||
<para>May be optionally followed by ':' and a capital letter
|
||||
designating the chain where classification is to occur.</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>F</term>
|
||||
|
||||
<listitem>
|
||||
<para>FORWARD chain.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>T</term>
|
||||
|
||||
<listitem>
|
||||
<para>POSTROUTING chain (default).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -840,7 +946,7 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">PROBABILITY</emphasis> -
|
||||
[probability]</term>
|
||||
[<replaceable>probability</replaceable>]</term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.5.0. When non-empty, requires the
|
||||
@@ -852,6 +958,44 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
||||
at up to 8 decimal points of precision.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">DSCP -</emphasis>
|
||||
[[!]<replaceable>dscp</replaceable>]</term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.5.1. When non-empty, match packets whose
|
||||
<firstterm>Differentiated Service Code Point</firstterm> field
|
||||
matches the supplied value (when '!' is given, the rule matches
|
||||
packets whose DSCP field does not match the supplied value). The
|
||||
<replaceable>dscp</replaceable> value may be given as an even number
|
||||
(hex or decimal) or as the name of a DSCP class. Valid class names
|
||||
and their associated hex numeric values are:</para>
|
||||
|
||||
<programlisting> CS0 => 0x00
|
||||
CS1 => 0x08
|
||||
CS2 => 0x10
|
||||
CS3 => 0x18
|
||||
CS4 => 0x20
|
||||
CS5 => 0x28
|
||||
CS6 => 0x30
|
||||
CS7 => 0x38
|
||||
BE => 0x00
|
||||
AF11 => 0x0a
|
||||
AF12 => 0x0c
|
||||
AF13 => 0x0e
|
||||
AF21 => 0x12
|
||||
AF22 => 0x14
|
||||
AF23 => 0x16
|
||||
AF31 => 0x1a
|
||||
AF32 => 0x1c
|
||||
AF33 => 0x1e
|
||||
AF41 => 0x22
|
||||
AF42 => 0x24
|
||||
AF43 => 0x26
|
||||
EF => 0x2e</programlisting>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
|
@@ -23,7 +23,9 @@
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<para>This file defines rules for setting Type Of Service (TOS)</para>
|
||||
<para>This file defines rules for setting Type Of Service (TOS). Its use
|
||||
is deprecated, beginning in Shorewall 4.5.1, in favor of the TOS target in
|
||||
<ulink url="shorewall-tcrules.html">shorewall-tcrules</ulink> (5).</para>
|
||||
|
||||
<para>The columns in the file are as follows (where the column name is
|
||||
followed by a different name in parentheses, the different name is used in
|
||||
|
@@ -1243,7 +1243,7 @@
|
||||
directory is given, then Shorewall will look in that directory first
|
||||
when opening configuration files.</para>
|
||||
|
||||
<para>Begining with Shorewall 4.5.0, you may specify a different
|
||||
<para>Beginning with Shorewall 4.5.0, you may specify a different
|
||||
<replaceable>timeout</replaceable> value using the
|
||||
<option>-t</option> option. The numeric
|
||||
<replaceable>timeout</replaceable> may optionally be followed by an
|
||||
@@ -1265,7 +1265,7 @@
|
||||
Shorewall will look in that directory first when opening
|
||||
configuration files.</para>
|
||||
|
||||
<para>Begining with Shorewall 4.5.0, you may specify a different
|
||||
<para>Beginning with Shorewall 4.5.0, you may specify a different
|
||||
<replaceable>timeout</replaceable> value using the
|
||||
<option>-t</option> option. The numeric
|
||||
<replaceable>timeout</replaceable> may optionally be followed by an
|
||||
@@ -1600,7 +1600,7 @@
|
||||
role="bold">restore</emphasis> is performed after
|
||||
<replaceable>timeout</replaceable> seconds.</para>
|
||||
|
||||
<para>Begining with Shorewall 4.5.0, the numeric
|
||||
<para>Beginning with Shorewall 4.5.0, the numeric
|
||||
<replaceable>timeout</replaceable> may optionally be followed by an
|
||||
<option>s</option>, <option>m</option> or <option>h</option> suffix
|
||||
(e.g., 5m) to specify seconds, minutes or hours respectively. If the
|
||||
|
@@ -112,7 +112,7 @@ rm -rf /etc/shorewall
|
||||
rm -rf /etc/shorewall-*.bkout
|
||||
rm -rf /var/lib/shorewall
|
||||
rm -rf /var/lib/shorewall-*.bkout
|
||||
rm -rf $PERLLIB}/Shorewall/*
|
||||
rm -rf ${PERLLIB}/Shorewall/*
|
||||
rm -rf ${LIBEXEC}/shorewall
|
||||
rm -rf /usr/share/shorewall/configfiles/
|
||||
rm -rf /usr/share/shorewall/Samples/
|
||||
|
@@ -12,7 +12,7 @@ $(VARDIR)/${RESTOREFILE}: $(VARDIR)/firewall
|
||||
then \
|
||||
/sbin/shorewall6-lite -q save >/dev/null; \
|
||||
else \
|
||||
/sbin/shorewall6-lite -q restart 2>&1 | tail >&2; \
|
||||
/sbin/shorewall6-lite -q restart 2>&1 | tail >&2; exit 1; \
|
||||
fi
|
||||
|
||||
# EOF
|
||||
|
@@ -76,10 +76,10 @@ command="$1"
|
||||
|
||||
case "$command" in
|
||||
start)
|
||||
exec /sbin/shorewall6-lite $OPTIONS start $STARTOPTIONS $@
|
||||
exec /sbin/shorewall6-lite $OPTIONS start $STARTOPTIONS
|
||||
;;
|
||||
restart|reload)
|
||||
exec /sbin/shorewall6-lite $OPTIONS restart $RESTARTOPTIONS $@
|
||||
exec /sbin/shorewall6-lite $OPTIONS restart $RESTARTOPTIONS
|
||||
;;
|
||||
status|stop)
|
||||
exec /sbin/shorewall6-lite $OPTIONS $command $@
|
||||
|
@@ -11,11 +11,27 @@
|
||||
<refnamediv>
|
||||
<refname>shorewall6-lite</refname>
|
||||
|
||||
<refpurpose>Administration tool for Shoreline Firewall 6 Lite
|
||||
(Shorewall6-lite)</refpurpose>
|
||||
<refpurpose>Administration tool for Shoreline 6 Firewall Lite (Shorewall6
|
||||
Lite)</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>shorewall6-lite</command>
|
||||
|
||||
<arg
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
|
||||
<arg rep="norepeat">-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>add</option></arg>
|
||||
|
||||
<arg choice="plain"
|
||||
rep="repeat"><replaceable>interface</replaceable>[:<replaceable>host-list</replaceable>]</arg>
|
||||
|
||||
<arg choice="plain"><replaceable>zone</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall6-lite</command>
|
||||
|
||||
@@ -37,11 +53,28 @@
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>clear</option></arg>
|
||||
<arg
|
||||
choice="plain"><option>clear</option><arg><option>-f</option></arg></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall</command>
|
||||
<command>shorewall6-lite</command>
|
||||
|
||||
<arg
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
|
||||
<arg rep="norepeat">-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>delete</option></arg>
|
||||
|
||||
<arg choice="plain"
|
||||
rep="repeat"><replaceable>interface</replaceable>[:<replaceable>host-list</replaceable>]</arg>
|
||||
|
||||
<arg choice="plain"><replaceable>zone</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall6-lite</command>
|
||||
|
||||
<arg
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
@@ -78,11 +111,13 @@
|
||||
|
||||
<arg><option>-x</option></arg>
|
||||
|
||||
<arg><option>-l</option></arg>
|
||||
|
||||
<arg><option>-m</option></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall</command>
|
||||
<command>shorewall6-lite</command>
|
||||
|
||||
<arg
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
@@ -98,7 +133,8 @@
|
||||
<cmdsynopsis>
|
||||
<command>shorewall6-lite</command>
|
||||
|
||||
<arg choice="opt"><option>trace</option>|<option>debug</option></arg>
|
||||
<arg
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
@@ -124,7 +160,52 @@
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>hits</option></arg>
|
||||
<arg
|
||||
choice="plain"><option>hits</option><arg><option>-t</option></arg></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall6-lite</command>
|
||||
|
||||
<arg choice="opt"><option>trace</option>|<option>debug</option></arg>
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>ipcalc</option></arg>
|
||||
|
||||
<group choice="req">
|
||||
<arg choice="plain"><replaceable>address</replaceable>
|
||||
<replaceable>mask</replaceable></arg>
|
||||
|
||||
<arg
|
||||
choice="plain"><replaceable>address</replaceable>/<replaceable>vlsm</replaceable></arg>
|
||||
</group>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall6-lite</command>
|
||||
|
||||
<arg choice="opt"><option>trace</option>|<option>debug</option></arg>
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>iprange</option></arg>
|
||||
|
||||
<arg
|
||||
choice="plain"><replaceable>address1</replaceable><option>-</option><replaceable>address2</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall6-lite</command>
|
||||
|
||||
<arg choice="opt"><option>trace</option>|<option>debug</option></arg>
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>iptrace</option></arg>
|
||||
|
||||
<arg choice="plain"><replaceable>iptables match
|
||||
expression</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
@@ -167,6 +248,19 @@
|
||||
<arg choice="plain"><replaceable>address</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall6-lite</command>
|
||||
|
||||
<arg choice="opt"><option>trace</option>|<option>debug</option></arg>
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>noiptrace</option></arg>
|
||||
|
||||
<arg choice="plain"><replaceable>iptables match
|
||||
expression</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall6-lite</command>
|
||||
|
||||
@@ -188,8 +282,24 @@
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>reset</option></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall6-lite</command>
|
||||
|
||||
<arg
|
||||
choice="plain"><option>restart</option><arg><option>-n</option></arg><arg><option>-p</option></arg></arg>
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>restart</option></arg>
|
||||
|
||||
<arg><option>-n</option></arg>
|
||||
|
||||
<arg><option>-p</option></arg>
|
||||
|
||||
<arg><replaceable>directory</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
@@ -229,8 +339,10 @@
|
||||
|
||||
<arg><option>-x</option></arg>
|
||||
|
||||
<arg><option>-l</option></arg>
|
||||
|
||||
<arg><option>-t</option>
|
||||
{<option>filter</option>|<option>mangle</option>|<option>raw</option>}</arg>
|
||||
{<option>filter</option>|<option>mangle</option>|<option>nat</option>|<option>raw|rawpost</option>}</arg>
|
||||
|
||||
<arg><arg><option>chain</option></arg><arg choice="plain"
|
||||
rep="repeat"><replaceable>chain</replaceable></arg></arg>
|
||||
@@ -260,7 +372,7 @@
|
||||
<arg choice="plain"><option>show</option></arg>
|
||||
|
||||
<arg
|
||||
choice="req"><option>actions|classifiers|connections|config|zones</option></arg>
|
||||
choice="req"><option>classifiers|connections|config|filters|ip|ipa|zones|policies|marks</option></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
@@ -274,7 +386,7 @@
|
||||
|
||||
<arg><option>-x</option></arg>
|
||||
|
||||
<arg choice="plain"><option>mangle</option></arg>
|
||||
<arg choice="req"><option>mangle|nat|routing|raw|rawpost</option></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
@@ -311,8 +423,11 @@
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg
|
||||
choice="plain"><option>start</option><arg>-<option>n</option></arg><arg>-<option>p</option></arg><arg>-<option>f</option></arg></arg>
|
||||
<arg choice="plain"><option>start</option></arg>
|
||||
|
||||
<arg><option>-n</option></arg>
|
||||
|
||||
<arg><option>-p</option></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
@@ -343,7 +458,8 @@
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>version</option></arg>
|
||||
<arg
|
||||
choice="plain"><option>version</option><arg><option>-a</option></arg></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
@@ -351,7 +467,7 @@
|
||||
<title>Description</title>
|
||||
|
||||
<para>The shorewall6-lite utility is used to control the Shoreline
|
||||
Firewall 6 (Shorewall6) Lite.</para>
|
||||
Firewall Lite (Shorewall Lite).</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
@@ -359,19 +475,19 @@
|
||||
|
||||
<para>The <option>trace</option> and <option>debug</option> options are
|
||||
used for debugging. See <ulink
|
||||
url="http://www.shorewall.net/starting_and_stopping.htm#Trace">http://www.shorewall.net/starting_and_stopping.htm#Trace</ulink>.</para>
|
||||
url="http://www.shorewall.net/starting_and_stopping_shorewall.htm#Trace">http://www.shorewall.net/starting_and_stopping_shorewall.htm#Trace</ulink>.</para>
|
||||
|
||||
<para>The nolock <option>option</option> prevents the command from
|
||||
attempting to acquire the Shorewall6 Lite lockfile. It is useful if you
|
||||
need to include <command>shorewall6-lite</command> commands in the
|
||||
<filename>started</filename> extension script.</para>
|
||||
attempting to acquire the shorewall6-lite lockfile. It is useful if you
|
||||
need to include <command>shorewall</command> commands in
|
||||
<filename>/etc/shorewall/started</filename>.</para>
|
||||
|
||||
<para>The <emphasis>options</emphasis> control the amount of output that
|
||||
the command produces. They consist of a sequence of the letters <emphasis
|
||||
role="bold">v</emphasis> and <emphasis role="bold">q</emphasis>. If the
|
||||
options are omitted, the amount of output is determined by the setting of
|
||||
the VERBOSITY parameter in <ulink
|
||||
url="shorewall6.conf.html">shorewall6.conf</ulink>(5). Each <emphasis
|
||||
url="shorewall.conf.html">shorewall6.conf</ulink>(5). Each <emphasis
|
||||
role="bold">v</emphasis> adds one to the effective verbosity and each
|
||||
<emphasis role="bold">q</emphasis> subtracts one from the effective
|
||||
VERBOSITY. Anternately, <emphasis role="bold">v</emphasis> may be followed
|
||||
@@ -390,6 +506,29 @@
|
||||
<para>The available commands are listed below.</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">add</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Adds a list of hosts or subnets to a dynamic zone usually used
|
||||
with VPN's.</para>
|
||||
|
||||
<para>The <emphasis>interface</emphasis> argument names an interface
|
||||
defined in the <ulink
|
||||
url="shorewall-interfaces.html">shorewall-interfaces</ulink>(5)
|
||||
file. A <emphasis>host-list</emphasis> is comma-separated list whose
|
||||
elements are host or network addresses.<caution>
|
||||
<para>The <command>add</command> command is not very robust. If
|
||||
there are errors in the <replaceable>host-list</replaceable>,
|
||||
you may see a large number of error messages yet a subsequent
|
||||
<command>shorewall6-lite show zones</command> command will
|
||||
indicate that all hosts were added. If this happens, replace
|
||||
<command>add</command> by <command>delete</command> and run the
|
||||
same command again. Then enter the correct command.</para>
|
||||
</caution></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">allow</emphasis></term>
|
||||
|
||||
@@ -406,10 +545,31 @@
|
||||
<term><emphasis role="bold">clear</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Clear will remove all rules and chains installed by Shorewall6
|
||||
Lite. The firewall is then wide open and unprotected. Existing
|
||||
connections are untouched. Clear is often used to see if the
|
||||
firewall is causing connection problems.</para>
|
||||
<para>Clear will remove all rules and chains installed by
|
||||
shorewall6-lite. The firewall is then wide open and unprotected.
|
||||
Existing connections are untouched. Clear is often used to see if
|
||||
the firewall is causing connection problems.</para>
|
||||
|
||||
<para>If <option>-f</option> is given, the command will be processed
|
||||
by the compiled script that executed the last successful <emphasis
|
||||
role="bold">start</emphasis>, <emphasis
|
||||
role="bold">restart</emphasis> or <emphasis
|
||||
role="bold">refresh</emphasis> command if that script exists.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">delete</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>The delete command reverses the effect of an earlier <emphasis
|
||||
role="bold">add</emphasis> command.</para>
|
||||
|
||||
<para>The <emphasis>interface</emphasis> argument names an interface
|
||||
defined in the <ulink
|
||||
url="shorewall-interfaces.html">shorewall-interfaces</ulink>(5)
|
||||
file. A <emphasis>host-list</emphasis> is comma-separated list whose
|
||||
elements are a host or network address.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -444,8 +604,11 @@
|
||||
<para>The <emphasis role="bold">-x</emphasis> option causes actual
|
||||
packet and byte counts to be displayed. Without that option, these
|
||||
counts are abbreviated. The <emphasis role="bold">-m</emphasis>
|
||||
option causes any MAC addresses included in Shorewall6 Lite log
|
||||
option causes any MAC addresses included in shorewall6-lite log
|
||||
messages to be displayed.</para>
|
||||
|
||||
<para>The <emphasis role="bold">-l</emphasis> option causes the rule
|
||||
number for each Netfilter rule to be displayed.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -469,7 +632,7 @@
|
||||
and /var/lib/shorewall6-lite/save. If no
|
||||
<emphasis>filename</emphasis> is given then the file specified by
|
||||
RESTOREFILE in <ulink
|
||||
url="shorewall6-lite.conf.html">shorewall6-lite.conf</ulink>(5) is
|
||||
url="shorewall.conf.html">shorewall6.conf</ulink>(5) is
|
||||
assumed.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -486,8 +649,47 @@
|
||||
<term><emphasis role="bold">hits</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Generates several reports from Shorewall6 Lite log messages in
|
||||
the current log file.</para>
|
||||
<para>Generates several reports from shorewall6-lite log messages in
|
||||
the current log file. If the <option>-t</option> option is included,
|
||||
the reports are restricted to log messages generated today.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">ipcalc</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Ipcalc displays the network address, broadcast address,
|
||||
network in CIDR notation and netmask corresponding to the
|
||||
input[s].</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">iprange</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Iprange decomposes the specified range of IP addresses into
|
||||
the equivalent list of network/host addresses.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">iptrace</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>This is a low-level debugging command that causes iptables
|
||||
TRACE log records to be created. See iptables(8) for details.</para>
|
||||
|
||||
<para>The <replaceable>iptables match expression</replaceable> must
|
||||
be one or more matches that may appear in both the raw table OUTPUT
|
||||
and raw table PREROUTING chains.</para>
|
||||
|
||||
<para>The trace records are written to the kernel's log buffer with
|
||||
faciility = kernel and priority = warning, and they are routed from
|
||||
there by your logging daemon (syslogd, rsyslog, syslog-ng, ...) --
|
||||
shorewall6-lite has no control over where the messages go; consult
|
||||
your logging daemon's documentation.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -496,7 +698,9 @@
|
||||
|
||||
<listitem>
|
||||
<para>Causes traffic from the listed <emphasis>address</emphasis>es
|
||||
to be logged then discarded.</para>
|
||||
to be logged then discarded. Logging occurs at the log level
|
||||
specified by the BLACKLIST_LOGLEVEL setting in <ulink
|
||||
url="shorewall.conf.html">shorewall6.conf</ulink> (5).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -504,9 +708,9 @@
|
||||
<term><emphasis role="bold">logwatch</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Monitors the log file specified by theLOGFILE option in <ulink
|
||||
url="shorewall6-lite.conf.html">shorewall6-lite.conf</ulink>(5) and
|
||||
produces an audible alarm when new Shorewall6 Lite messages are
|
||||
<para>Monitors the log file specified by the LOGFILE option in
|
||||
<ulink url="shorewall.conf.html">shorewall6.conf</ulink>(5) and
|
||||
produces an audible alarm when new shorewall6-lite messages are
|
||||
logged. The <emphasis role="bold">-m</emphasis> option causes the
|
||||
MAC address of each packet source to be displayed if that
|
||||
information is available. The
|
||||
@@ -524,7 +728,22 @@
|
||||
|
||||
<listitem>
|
||||
<para>Causes traffic from the listed <emphasis>address</emphasis>es
|
||||
to be logged then rejected.</para>
|
||||
to be logged then rejected. Logging occurs at the log level
|
||||
specified by the BLACKLIST_LOGLEVEL setting in <ulink
|
||||
url="shorewall.conf.html">shorewall6.conf</ulink> (5).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">noiptrace</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>This is a low-level debugging command that cancels a trace
|
||||
started by a preceding <command>iptrace</command> command.</para>
|
||||
|
||||
<para>The <replaceable>iptables match expression</replaceable> must
|
||||
be one given in the <command>iptrace</command> command being
|
||||
cancelled.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -542,10 +761,10 @@
|
||||
|
||||
<listitem>
|
||||
<para>Restart is similar to <emphasis role="bold">shorewall6-lite
|
||||
stop</emphasis> followed by <emphasis role="bold">shorewall6-lite
|
||||
start</emphasis>. Existing connections are maintained.</para>
|
||||
start</emphasis> except that it assumes that the firewall is already
|
||||
started. Existing connections are maintained.</para>
|
||||
|
||||
<para>The <option>-n</option> option causes Shorewall6 to avoid
|
||||
<para>The <option>-n</option> option causes shorewall6-lite to avoid
|
||||
updating the routing table(s).</para>
|
||||
|
||||
<para>The <option>-p</option> option causes the connection tracking
|
||||
@@ -558,14 +777,14 @@
|
||||
<term><emphasis role="bold">restore</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Restore Shorewall6 Lite to a state saved using the <emphasis
|
||||
<para>Restore shorewall6-lite to a state saved using the <emphasis
|
||||
role="bold">shorewall6-lite save</emphasis> command. Existing
|
||||
connections are maintained. The <emphasis>filename</emphasis> names
|
||||
a restore file in /var/lib/shorewall6-lite created using <emphasis
|
||||
role="bold">shorewall6-lite save</emphasis>; if no
|
||||
<emphasis>filename</emphasis> is given then Shorewall6 Lite will be
|
||||
<emphasis>filename</emphasis> is given then shorewall6-lite will be
|
||||
restored from the file specified by the RESTOREFILE option in <ulink
|
||||
url="shorewall6-lite.conf.html">shorewall6-lite.conf</ulink>(5).</para>
|
||||
url="shorewall.conf.html">shorewall6.conf</ulink>(5).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -576,11 +795,10 @@
|
||||
<para>The dynamic blacklist is stored in
|
||||
/var/lib/shorewall6-lite/save. The state of the firewall is stored
|
||||
in /var/lib/shorewall6-lite/<emphasis>filename</emphasis> for use by
|
||||
the <emphasis role="bold">shorewall6-lite restore</emphasis> and
|
||||
<emphasis role="bold">shorewall6-lite -f start</emphasis> commands.
|
||||
If <emphasis>filename</emphasis> is not given then the state is
|
||||
saved in the file specified by the RESTOREFILE option in <ulink
|
||||
url="shorewall6-lite.conf.html">shorewall6-lite.conf</ulink>(5).</para>
|
||||
the <emphasis role="bold">shorewall6-lite restore</emphasis>. If
|
||||
<emphasis>filename</emphasis> is not given then the state is saved
|
||||
in the file specified by the RESTOREFILE option in <ulink
|
||||
url="shorewall.conf.html">shorewall6.conf</ulink>(5).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -592,15 +810,6 @@
|
||||
arguments:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">actions</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Produces a report about the available actions (built-in,
|
||||
standard and user-defined).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">capabilities</emphasis></term>
|
||||
|
||||
@@ -613,12 +822,12 @@
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>[ [ <option>chain</option> ] <emphasis>chain</emphasis>
|
||||
... ]</term>
|
||||
<term>[ [ <option>chain</option> ] <emphasis>chain</emphasis>...
|
||||
]</term>
|
||||
|
||||
<listitem>
|
||||
<para>The rules in each <emphasis>chain</emphasis> are
|
||||
displayed using the <emphasis role="bold">ip6tables
|
||||
displayed using the <emphasis role="bold">iptables
|
||||
-L</emphasis> <emphasis>chain</emphasis> <emphasis
|
||||
role="bold">-n -v</emphasis> command. If no
|
||||
<emphasis>chain</emphasis> is given, all of the chains in the
|
||||
@@ -630,15 +839,20 @@
|
||||
Netfilter table to display. The default is <emphasis
|
||||
role="bold">filter</emphasis>.</para>
|
||||
|
||||
<para>The <emphasis role="bold">-l</emphasis> option causes
|
||||
the rule number for each Netfilter rule to be
|
||||
displayed.</para>
|
||||
|
||||
<para>If the <emphasis role="bold">t</emphasis> option and the
|
||||
<option>chain</option> keyword are both omitted and any of the
|
||||
listed <replaceable>chain</replaceable>s do not exist, a usage
|
||||
message will be displayed.</para>
|
||||
message is displayed.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">classifiers</emphasis></term>
|
||||
<term><emphasis
|
||||
role="bold">classifiers|filters</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays information about the packet classifiers
|
||||
@@ -659,21 +873,96 @@
|
||||
<term><emphasis role="bold">connections</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays the IPv6 connections currently being tracked by
|
||||
<para>Displays the IP connections currently being tracked by
|
||||
the firewall.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">mangle</emphasis></term>
|
||||
<term><emphasis role="bold">ip</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays the Netfilter mangle table using the command
|
||||
<emphasis role="bold">ip6tables -t mangle -L -n
|
||||
-v</emphasis>.The <emphasis role="bold">-x</emphasis> option
|
||||
is passed directly through to iptables and causes actual
|
||||
packet and byte counts to be displayed. Without this option,
|
||||
those counts are abbreviated.</para>
|
||||
<para>Displays the system's IPv4 configuration.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">ipa</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.4.17. Displays the per-IP
|
||||
accounting counters (<ulink
|
||||
url="manpages/shorewall-accounting.html">shorewall-accounting</ulink>
|
||||
(5)).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">log</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays the last 20 shorewall6-lite messages from the
|
||||
log file specified by the LOGFILE option in <ulink
|
||||
url="shorewall.conf.html">shorewall6.conf</ulink>(5). The
|
||||
<emphasis role="bold">-m</emphasis> option causes the MAC
|
||||
address of each packet source to be displayed if that
|
||||
information is available.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">marks</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.4.26. Displays the various fields
|
||||
in packet marks giving the min and max value (in both decimal
|
||||
and hex) and the applicable mask (in hex).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">nat</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays the Netfilter nat table using the command
|
||||
<emphasis role="bold">iptables -t nat -L -n -v</emphasis>.The
|
||||
<emphasis role="bold">-x</emphasis> option is passed directly
|
||||
through to iptables and causes actual packet and byte counts
|
||||
to be displayed. Without this option, those counts are
|
||||
abbreviated.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">policies</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.4.4. Displays the applicable policy
|
||||
between each pair of zones. Note that implicit intrazone
|
||||
ACCEPT policies are not displayed for zones associated with a
|
||||
single network where that network doesn't specify
|
||||
<option>routeback</option>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">routing</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays the system's IPv4 routing configuration.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">raw</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays the Netfilter raw table using the command
|
||||
<emphasis role="bold">iptables -t raw -L -n -v</emphasis>.The
|
||||
<emphasis role="bold">-x</emphasis> option is passed directly
|
||||
through to iptables and causes actual packet and byte counts
|
||||
to be displayed. Without this option, those counts are
|
||||
abbreviated.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -690,8 +979,8 @@
|
||||
<term><emphasis role="bold">zones</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays the current composition of the Shorewall6 Lite
|
||||
zones on the system.</para>
|
||||
<para>Displays the current composition of the Shorewall zones
|
||||
on the system.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -702,17 +991,10 @@
|
||||
<term><emphasis role="bold">start</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Start shorewall6 Lite. Existing connections through
|
||||
<para>Start Shorewall Lite. Existing connections through
|
||||
shorewall6-lite managed interfaces are untouched. New connections
|
||||
will be allowed only if they are allowed by the firewall rules or
|
||||
policies. If <emphasis role="bold">-f</emphasis> is specified, the
|
||||
saved configuration specified by the RESTOREFILE option in <ulink
|
||||
url="shorewall6-lite.conf.html">shorewall6-lite.conf</ulink>(5) will
|
||||
be restored if that saved configuration exists and has been modified
|
||||
more recently than the files in /etc/shorewall6.</para>
|
||||
|
||||
<para>The <option>-n</option> option causes Shorewall6 to avoid
|
||||
updating the routing table(s).</para>
|
||||
policies.</para>
|
||||
|
||||
<para>The <option>-p</option> option causes the connection tracking
|
||||
table to be flushed; the <command>conntrack</command> utility must
|
||||
@@ -726,12 +1008,19 @@
|
||||
<listitem>
|
||||
<para>Stops the firewall. All existing connections, except those
|
||||
listed in <ulink
|
||||
url="shorewall6-routestopped.html">shorewall6-routestopped</ulink>(5)
|
||||
or permitted by the ADMINISABSENTMINDED option in
|
||||
shorewall6.conf(5), are taken down. The only new traffic permitted
|
||||
through the firewall is from systems listed in <ulink
|
||||
url="shorewall6-routestopped.html">shorewall6-routestopped</ulink>(5)
|
||||
url="shorewall-routestopped.html">shorewall-routestopped</ulink>(5)
|
||||
or permitted by the ADMINISABSENTMINDED option in <ulink
|
||||
url="shorewall.conf.html">shorewall6.conf</ulink>(5), are taken
|
||||
down. The only new traffic permitted through the firewall is from
|
||||
systems listed in <ulink
|
||||
url="shorewall-routestopped.html">shorewall-routestopped</ulink>(5)
|
||||
or by ADMINISABSENTMINDED.</para>
|
||||
|
||||
<para>If <option>-f</option> is given, the command will be processed
|
||||
by the compiled script that executed the last successful <emphasis
|
||||
role="bold">start</emphasis>, <emphasis
|
||||
role="bold">restart</emphasis> or <emphasis
|
||||
role="bold">refresh</emphasis> command if that script exists.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -740,7 +1029,7 @@
|
||||
|
||||
<listitem>
|
||||
<para>Produces a short report about the state of the
|
||||
Shorewall6-configured firewall.</para>
|
||||
Shorewall-configured firewall.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -748,7 +1037,9 @@
|
||||
<term><emphasis role="bold">version</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Displays Shorewall6-lite's version.</para>
|
||||
<para>Displays Shorewall's version. The <option>-a</option> option
|
||||
is included for compatibility with earlier Shorewall releases and is
|
||||
ignored.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -764,14 +1055,16 @@
|
||||
<title>See ALSO</title>
|
||||
|
||||
<para><ulink
|
||||
url="http://www.shorewall.net/starting_and_stopping_shorewall6.htm">http://www.shorewall.net/starting_and_stopping_shorewall.htm</ulink></para>
|
||||
url="http://www.shorewall.net/starting_and_stopping_shorewall.htm">http://www.shorewall.net/starting_and_stopping_shorewall.htm</ulink></para>
|
||||
|
||||
<para>shorewall6-accounting(5), shorewall6-actions(5),
|
||||
shorewall6-blacklist(5), shorewall6-hosts(5), shorewall6-interfaces(5),
|
||||
shorewall6-maclist(5), shorewall6-params(5), shorewall6-policy(5),
|
||||
shorewall6-providers(5), shorewall6-route_rules(5),
|
||||
shorewall6-blacklist(5), shorewall6-hosts(5), shorewall_interfaces(5),
|
||||
shorewall6-ipsets(5), shorewall6-maclist(5), shorewall6-masq(5),
|
||||
shorewall6-netmap(5), shorewall6-params(5), shorewall6-policy(5),
|
||||
shorewall6-providers(5), shorewall6-proxyarp(5), shorewall6-rtrules(5),
|
||||
shorewall6-routestopped(5), shorewall6-rules(5), shorewall6.conf(5),
|
||||
shorewall6-tcclasses(5), shorewall6-tcdevices(5), shorewall6-tcrules(5),
|
||||
shorewall6-tos(5), shorewall6-tunnels(5), shorewall6-zones(5)</para>
|
||||
shorewall6-secmarks(5), shorewall6-tcclasses(5), shorewall6-tcdevices(5),
|
||||
shorewall6-tcrules(5), shorewall6-tos(5), shorewall6-tunnels(5),
|
||||
shorewall6-zones(5)</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@@ -2,6 +2,7 @@
|
||||
VARDIR=$(shell /sbin/shorewall6 show vardir)
|
||||
CONFDIR=/etc/shorewall6
|
||||
RESTOREFILE?=firewall
|
||||
|
||||
all: $(VARDIR)/${RESTOREFILE}
|
||||
|
||||
$(VARDIR)/${RESTOREFILE}: $(CONFDIR)/*
|
||||
@@ -11,11 +12,12 @@ $(VARDIR)/${RESTOREFILE}: $(CONFDIR)/*
|
||||
then \
|
||||
/sbin/shorewall6 -q save >/dev/null; \
|
||||
else \
|
||||
/sbin/shorewall6 -q restart 2>&1 | tail >&2; \
|
||||
/sbin/shorewall6 -q restart 2>&1 | tail >&2; exit 1; \
|
||||
fi
|
||||
|
||||
clean:
|
||||
@rm -f $(CONFDIR)/*~ $(CONFDIR)/.*~
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
# EOF
|
||||
|
@@ -7,4 +7,8 @@
|
||||
# http://www.shorewall.net/manpages6/shorewall6-interfaces.html
|
||||
#
|
||||
###############################################################################
|
||||
FORMAT 1
|
||||
#ZONE INTERFACE ANYCAST OPTIONS
|
||||
|
||||
FORMAT 2
|
||||
#ZONE INTERFACE OPTIONS
|
||||
|
@@ -8,13 +8,15 @@
|
||||
#
|
||||
# The script is invoked inside a function that accepts an interface
|
||||
# name as a single argument. The file below is designed to work with
|
||||
# both swping and lsm as described at http://www.shorewall.net/MultiISP.html
|
||||
# both swping and lsm as described at
|
||||
# http://www.shorewall.net/MultiISP.html
|
||||
#
|
||||
# See http://shorewall.net/shorewall_extension_scripts.htm for additional
|
||||
# information.
|
||||
#
|
||||
###############################################################################
|
||||
local status=0
|
||||
local status
|
||||
status=0
|
||||
|
||||
[ -f ${VARDIR}/${1}.status ] && status=$(cat ${VARDIR}/${1}.status)
|
||||
|
||||
|
@@ -9,6 +9,6 @@
|
||||
#
|
||||
# See http://shorewall.net/PacketMarking.html for a detailed description of
|
||||
# the Netfilter/Shorewall packet marking mechanism.
|
||||
##############################################################################################################################################
|
||||
#MARK SOURCE DEST PROTO DEST SOURCE USER TEST LENGTH TOS CONNBYTES HELPER HEADERS PROBABILITY
|
||||
###################################################################################################################################################
|
||||
#MARK SOURCE DEST PROTO DEST SOURCE USER TEST LENGTH TOS CONNBYTES HELPER HEADERS PROBABILITY DSCP
|
||||
# PORT(S) PORT(S)
|
||||
|
@@ -4,5 +4,5 @@
|
||||
# For information about entries in this file, type "man shorewall6-tos"
|
||||
#
|
||||
###############################################################################
|
||||
#SOURCE DEST PROTOCOL SOURCE DEST TOS MARK
|
||||
#SOURCE DEST PROTOCOL DEST SOURCE TOS MARK
|
||||
# PORTS PORTS
|
||||
|
@@ -77,10 +77,10 @@ command="$1"
|
||||
|
||||
case "$command" in
|
||||
start)
|
||||
exec /sbin/shorewall6 $OPTIONS start $STARTOPTIONS $@
|
||||
exec /sbin/shorewall6 $OPTIONS start $STARTOPTIONS
|
||||
;;
|
||||
restart|reload)
|
||||
exec /sbin/shorewall6 $OPTIONS restart $RESTARTOPTIONS $@
|
||||
exec /sbin/shorewall6 $OPTIONS restart $RESTARTOPTIONS
|
||||
;;
|
||||
status|stop)
|
||||
exec /sbin/shorewall6 $OPTIONS $command $@
|
||||
|
@@ -75,12 +75,9 @@
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>A jump to a user-defined accounting chain before entries that
|
||||
add rules to that chain.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>This eliminates loops and unreferenced chains.</para>
|
||||
<para>A jump to a user-defined accounting chain must appear before
|
||||
entries that add rules to that chain. This eliminates loops and
|
||||
unreferenced chains.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
@@ -41,7 +41,7 @@
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">ACTION- {<emphasis
|
||||
role="bold">ACCEPT</emphasis>|CONTINUE|DROP|A_DROP|REJECT|A_REJECT|<emphasis
|
||||
role="bold">WHITELIES</emphasis>|<emphasis
|
||||
role="bold">WHITELIST</emphasis>|<emphasis
|
||||
role="bold">LOG</emphasis>|<emphasis
|
||||
role="bold">QUEUE</emphasis>|<emphasis
|
||||
role="bold">NFQUEUE</emphasis>[<emphasis
|
||||
|
@@ -365,6 +365,112 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
||||
<replaceable>number</replaceable>. Requires IMQ Target support
|
||||
in your kernel and ip6tables.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis
|
||||
role="bold">DSCP</emphasis>(<replaceable>dscp</replaceable>)</para>
|
||||
|
||||
<para>Added in Shorewall 4.5.1. Sets the
|
||||
<firstterm>Differentiated Services Code Point</firstterm> field
|
||||
in the IP header. The <replaceable>dscp</replaceable> value may
|
||||
be given as an even number (hex or decimal) or as the name of a
|
||||
DSCP class. Valid class names and their associated hex numeric
|
||||
values are:</para>
|
||||
|
||||
<programlisting> CS0 => 0x00
|
||||
CS1 => 0x08
|
||||
CS2 => 0x10
|
||||
CS3 => 0x18
|
||||
CS4 => 0x20
|
||||
CS5 => 0x28
|
||||
CS6 => 0x30
|
||||
CS7 => 0x38
|
||||
BE => 0x00
|
||||
AF11 => 0x0a
|
||||
AF12 => 0x0c
|
||||
AF13 => 0x0e
|
||||
AF21 => 0x12
|
||||
AF22 => 0x14
|
||||
AF23 => 0x16
|
||||
AF31 => 0x1a
|
||||
AF32 => 0x1c
|
||||
AF33 => 0x1e
|
||||
AF41 => 0x22
|
||||
AF42 => 0x24
|
||||
AF43 => 0x26
|
||||
EF => 0x2e</programlisting>
|
||||
|
||||
<para>May be optionally followed by ':' and a capital letter
|
||||
designating the chain where classification is to occur.</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>F</term>
|
||||
|
||||
<listitem>
|
||||
<para>FORWARD chain.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>T</term>
|
||||
|
||||
<listitem>
|
||||
<para>POSTROUTING chain (default).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis
|
||||
role="bold">TOS</emphasis>(<replaceable>tos</replaceable>[/<replaceable>mask</replaceable>])</para>
|
||||
|
||||
<para>Added in Shorewall 4.5.1. Sets the <firstterm>Type of
|
||||
Service</firstterm> field in the IP header. The
|
||||
<replaceable>tos</replaceable> value may be given as an number
|
||||
(hex or decimal) or as the name of a TOS type. Valid type names
|
||||
and their associated hex numeric values are:</para>
|
||||
|
||||
<programlisting>Minimize-Delay => 0x10,
|
||||
Maximize-Throughput => 0x08,
|
||||
Maximize-Reliability => 0x04,
|
||||
Minimize-Cost => 0x02,
|
||||
Normal-Service => 0x00</programlisting>
|
||||
|
||||
<para>When <replaceable>tos</replaceable> is given as a number,
|
||||
it may be optionally followed by '/' and a
|
||||
<replaceable>mask</replaceable>. When no
|
||||
<replaceable>mask</replaceable> is given, the value 0xff is
|
||||
assumed. When <replaceable>tos</replaceable> is given as a type
|
||||
name, the <replaceable>mask</replaceable> 0x3f is
|
||||
assumed.</para>
|
||||
|
||||
<para>The action performed is to zero out the bits specified by
|
||||
the <replaceable>mask</replaceable>, then set the bits specified
|
||||
by <replaceable>tos</replaceable>.</para>
|
||||
|
||||
<para>May be optionally followed by ':' and a capital letter
|
||||
designating the chain where classification is to occur.</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>F</term>
|
||||
|
||||
<listitem>
|
||||
<para>FORWARD chain.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>T</term>
|
||||
|
||||
<listitem>
|
||||
<para>POSTROUTING chain (default).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@@ -23,7 +23,10 @@
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<para>This file defines rules for setting Type Of Service (TOS)</para>
|
||||
<para>This file defines rules for setting Type Of Service (TOS). Its use
|
||||
is deprecated, beginning in Shorewall 4.5.1, in favor of the TOS target in
|
||||
<ulink url="shorewall6-tcrules.html">shorewall6-tcrules</ulink>
|
||||
(5).</para>
|
||||
|
||||
<para>The columns in the file are as follows.</para>
|
||||
|
||||
|
@@ -1108,7 +1108,7 @@
|
||||
directory is given, then Shorewall6 will look in that directory
|
||||
first when opening configuration files.</para>
|
||||
|
||||
<para>Begining with Shorewall 4.5.0, you may specify a different
|
||||
<para>Beginning with Shorewall 4.5.0, you may specify a different
|
||||
<replaceable>timeout</replaceable> value using the
|
||||
<option>-t</option> option. The numeric
|
||||
<replaceable>timeout</replaceable> may optionally be followed by an
|
||||
@@ -1130,7 +1130,7 @@
|
||||
Shorewall6 will look in that directory first when opening
|
||||
configuration files.</para>
|
||||
|
||||
<para>Begining with Shorewall 4.5.0, you may specify a different
|
||||
<para>Beginning with Shorewall 4.5.0, you may specify a different
|
||||
<replaceable>timeout</replaceable> value using the
|
||||
<option>-t</option> option. The numeric
|
||||
<replaceable>timeout</replaceable> may optionally be followed by an
|
||||
@@ -1422,7 +1422,7 @@
|
||||
role="bold">restore</emphasis> is performed after
|
||||
<replaceable>timeout</replaceable> seconds.</para>
|
||||
|
||||
<para>Begining with Shorewall 4.5.0, the numeric
|
||||
<para>Beginning with Shorewall 4.5.0, the numeric
|
||||
<replaceable>timeout</replaceable> may optionally be followed by an
|
||||
<option>s</option>, <option>m</option> or <option>h</option> suffix
|
||||
(e.g., 5m) to specify seconds, minutes or hours respectively. If the
|
||||
|
@@ -106,7 +106,7 @@
|
||||
|
||||
<para>The <filename>/sbin/shorewall</filename> shell program is used to
|
||||
interact with Shorewall. See <ulink
|
||||
url="manpages/shorewall.html">shorewall</ulink>(8). </para>
|
||||
url="manpages/shorewall.html">shorewall</ulink>(8).</para>
|
||||
</section>
|
||||
|
||||
<section id="share-shorewall">
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<!--/$Id$-->
|
||||
|
||||
<articleinfo>
|
||||
<title>Shorewall 4.5 Documentation</title>
|
||||
<title>Shorewall 4.4/4.5 Documentation</title>
|
||||
|
||||
<authorgroup>
|
||||
<author>
|
||||
@@ -55,7 +55,7 @@
|
||||
<tgroup align="left" cols="3">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry></entry>
|
||||
<entry/>
|
||||
|
||||
<entry><ulink url="LXC.html">Linux Containers
|
||||
(LXC)</ulink></entry>
|
||||
@@ -223,8 +223,8 @@
|
||||
|
||||
<entry><ulink url="OpenVZ.html">OpenVZ</ulink></entry>
|
||||
|
||||
<entry><ulink url="LennyToSqueeze.html">Upgrading to Shorewall 4.4
|
||||
(Upgrading Debian Lenny to Squeeze)</ulink></entry>
|
||||
<entry><ulink url="upgrade_issues.htm">Upgrade
|
||||
Issues</ulink></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -234,7 +234,8 @@
|
||||
<entry><ulink url="starting_and_stopping_shorewall.htm">Operating
|
||||
Shorewall</ulink></entry>
|
||||
|
||||
<entry><ulink url="VPNBasics.html">VPN</ulink></entry>
|
||||
<entry><ulink url="LennyToSqueeze.html">Upgrading to Shorewall 4.4
|
||||
(Upgrading Debian Lenny to Squeeze)</ulink></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -245,7 +246,7 @@
|
||||
<entry><ulink url="PacketMarking.html">Packet
|
||||
Marking</ulink></entry>
|
||||
|
||||
<entry><ulink url="VPN.htm">VPN Passthrough</ulink></entry>
|
||||
<entry><ulink url="VPNBasics.html">VPN</ulink></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -255,8 +256,7 @@
|
||||
<entry><ulink url="PacketHandling.html">Packet Processing in a
|
||||
Shorewall-based Firewall</ulink></entry>
|
||||
|
||||
<entry><ulink url="blacklisting_support.htm#whitelisting">White
|
||||
List Creation</ulink></entry>
|
||||
<entry><ulink url="VPN.htm">VPN Passthrough</ulink></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -264,8 +264,8 @@
|
||||
|
||||
<entry><ulink url="ping.html">'Ping' Management</ulink></entry>
|
||||
|
||||
<entry><ulink url="XenMyWay.html">Xen - Shorewall in a Bridged Xen
|
||||
DomU</ulink></entry>
|
||||
<entry><ulink url="blacklisting_support.htm#whitelisting">White
|
||||
List Creation</ulink></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -275,8 +275,8 @@
|
||||
<entry><ulink url="two-interface.htm#DNAT">Port
|
||||
Forwarding</ulink></entry>
|
||||
|
||||
<entry><ulink url="XenMyWay-Routed.html">Xen - Shorewall in Routed
|
||||
Xen Dom0</ulink></entry>
|
||||
<entry><ulink url="XenMyWay.html">Xen - Shorewall in a Bridged Xen
|
||||
DomU</ulink></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -285,7 +285,8 @@
|
||||
|
||||
<entry><ulink url="ports.htm">Port Information</ulink></entry>
|
||||
|
||||
<entry></entry>
|
||||
<entry><ulink url="XenMyWay-Routed.html">Xen - Shorewall in Routed
|
||||
Xen Dom0</ulink></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -294,7 +295,7 @@
|
||||
<entry><ulink url="PortKnocking.html">Port Knocking and Other Uses
|
||||
of the 'Recent Match'</ulink></entry>
|
||||
|
||||
<entry></entry>
|
||||
<entry/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -303,7 +304,7 @@
|
||||
|
||||
<entry><ulink url="PPTP.htm">PPTP</ulink></entry>
|
||||
|
||||
<entry></entry>
|
||||
<entry/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -312,7 +313,7 @@
|
||||
|
||||
<entry><ulink url="ProxyARP.htm">Proxy ARP</ulink></entry>
|
||||
|
||||
<entry></entry>
|
||||
<entry/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -322,7 +323,7 @@
|
||||
<entry><ulink url="shorewall_quickstart_guide.htm">QuickStart
|
||||
Guides</ulink></entry>
|
||||
|
||||
<entry></entry>
|
||||
<entry/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -330,7 +331,7 @@
|
||||
|
||||
<entry><ulink url="NewRelease.html">Release Model</ulink></entry>
|
||||
|
||||
<entry></entry>
|
||||
<entry/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -339,7 +340,7 @@
|
||||
<entry><ulink
|
||||
url="shorewall_prerequisites.htm">Requirements</ulink></entry>
|
||||
|
||||
<entry></entry>
|
||||
<entry/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -348,7 +349,7 @@
|
||||
<entry><ulink url="Shorewall_and_Routing.html">Routing and
|
||||
Shorewall</ulink></entry>
|
||||
|
||||
<entry></entry>
|
||||
<entry/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -357,7 +358,7 @@
|
||||
<entry><ulink url="Multiple_Zones.html">Routing on One
|
||||
Interface</ulink></entry>
|
||||
|
||||
<entry></entry>
|
||||
<entry/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -366,7 +367,7 @@
|
||||
|
||||
<entry><ulink url="samba.htm">Samba</ulink></entry>
|
||||
|
||||
<entry></entry>
|
||||
<entry/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -376,7 +377,7 @@
|
||||
<entry><ulink url="Shorewall-init.html">Shorewall
|
||||
Init</ulink></entry>
|
||||
|
||||
<entry></entry>
|
||||
<entry/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -386,7 +387,7 @@
|
||||
<entry><ulink url="Shorewall-Lite.html">Shorewall
|
||||
Lite</ulink></entry>
|
||||
|
||||
<entry></entry>
|
||||
<entry/>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
|
52
docs/FAQ.xml
52
docs/FAQ.xml
@@ -247,7 +247,7 @@ DNAT net:<emphasis>address</emphasis> loc:<emphasis>local-IP-address</empha
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>You are trying to test from inside your firewall (no, that
|
||||
won't work -- see <xref linkend="faq2" />).</para>
|
||||
won't work -- see <xref linkend="faq2"/>).</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
@@ -2837,7 +2837,7 @@ Shorewall has detected the following iptables/netfilter capabilities:
|
||||
Persistent SNAT: Available
|
||||
gateway:~# </programlisting>
|
||||
|
||||
<para></para>
|
||||
<para/>
|
||||
</section>
|
||||
|
||||
<section id="faq19">
|
||||
@@ -2982,5 +2982,53 @@ EXT_IF:192.168.1.1 0.0.0.0/0 192.168.1.254
|
||||
examples, macros, etc. easier.</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="faq98">
|
||||
<title>(FAQ 98) How do I Unsubscribe from the Mailing List</title>
|
||||
|
||||
<para><emphasis role="bold">Answer</emphasis>: There are two
|
||||
ways:</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>On the web</para>
|
||||
|
||||
<para>Go to <ulink
|
||||
url="https://lists.sourceforge.net/lists/listinfo/shorewall-users">https://lists.sourceforge.net/lists/listinfo/shorewall-users</ulink>.
|
||||
At the bottom of the form is a section entitled "<emphasis
|
||||
role="bold">Shorewall-users Subscribers</emphasis>". At the bottom
|
||||
of that section find:</para>
|
||||
|
||||
<blockquote>
|
||||
<para>"To <emphasis role="bold">unsubscribe</emphasis> from
|
||||
Shorewall-users, get a password reminder, or change your
|
||||
subscription options <emphasis role="bold">enter your subscription
|
||||
email address</emphasis>:".</para>
|
||||
</blockquote>
|
||||
|
||||
<para>Enter your email address in the box provided and click on the
|
||||
"<emphasis role="bold"><ulink url="???">Unsubscribe or edit
|
||||
options</ulink></emphasis>" button. That will take you to a second
|
||||
form.</para>
|
||||
|
||||
<para>At the top of the second form is a box to <emphasis
|
||||
role="bold">enter your password</emphasis> -- enter it there then
|
||||
click the <emphasis role="bold">Unsubscribe</emphasis> button in the
|
||||
center of the form. You will be unsubscribed.</para>
|
||||
|
||||
<para>If you <emphasis role="bold">don't remember your
|
||||
password</emphasis>, click on the <emphasis
|
||||
role="bold">Remind</emphasis> button at the bottom of the form and
|
||||
your password will be emailed to you.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Via email using this link: <ulink
|
||||
url="mailto:shorewall-users-request@lists.sourceforge.net?subject=unsubscribe">mailto:shorewall-users-request@lists.sourceforge.net?subject=unsubscribe</ulink>.
|
||||
You will receive a confirmation email shortly; follow the
|
||||
instructions in that email.</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</section>
|
||||
</section>
|
||||
</article>
|
||||
|
343
docs/Install.xml
343
docs/Install.xml
@@ -24,6 +24,8 @@
|
||||
|
||||
<year>2009</year>
|
||||
|
||||
<year>2012</year>
|
||||
|
||||
<holder>Thomas M. Eastep</holder>
|
||||
</copyright>
|
||||
|
||||
@@ -135,11 +137,31 @@
|
||||
<section id="Install_Tarball">
|
||||
<title>Install using tarball</title>
|
||||
|
||||
<para>Beginning with Shorewall-4.5.0, the Shorewall packages depend on
|
||||
Shorewall-core. So the first step is to install that package:</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>unpack the tarballs:<programlisting><command>tar -jxf shorewall-core-4.5.0.tar.bz2</command></programlisting></para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>cd to the shorewall directory (the version is encoded in the
|
||||
directory name as in <quote>shorewall-core-4.5.0</quote>).</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Type:</para>
|
||||
|
||||
<programlisting><command>./install.sh </command></programlisting>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
||||
<para>To install Shorewall using the tarball and install script:</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>unpack the tarballs:<programlisting><command>tar -jxf shorewall-4.3.5.tar.bz2</command></programlisting></para>
|
||||
<para>unpack the tarballs:<programlisting><command>tar -jxf shorewall-4.5.0.tar.bz2</command></programlisting></para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
@@ -241,6 +263,9 @@
|
||||
<para>Beginning with Shorewall 4.4.20, you can specify an absolute
|
||||
path name for LIBEXEC, in which case the listed executables will
|
||||
be installed in ${LIBEXEC}/shorewall*.</para>
|
||||
|
||||
<para>Beginning with Shorewall 4.5.1, you must specify an absolute
|
||||
pathname for LIBEXEC.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -258,10 +283,302 @@
|
||||
<para>Beginning with Shorewall 4.4.20, you can specify an absolute
|
||||
path name for PERLLIB, in which case the Shorewall Perl modules
|
||||
will be installed in ${PERLLIB}/Shorewall/.</para>
|
||||
|
||||
<para>Beginning with Shorewall 4.5.1, you must specify an absolute
|
||||
pathname for PERLLIB.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Default Install Locations</title>
|
||||
|
||||
<para>The default install locations are distribution dependent as shown
|
||||
in the following sections. These are the locations that are chosen by
|
||||
the install.sh scripts.</para>
|
||||
|
||||
<section>
|
||||
<title>All Distributions</title>
|
||||
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><emphasis role="bold">COMPONENT</emphasis></entry>
|
||||
|
||||
<entry><emphasis role="bold">LOCATION</emphasis></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>man pages</entry>
|
||||
|
||||
<entry>/usr/share/man/ (may ve overridden using
|
||||
MANDIR)</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Shorewall Perl Modules</entry>
|
||||
|
||||
<entry>/usr/share/shorewall/ (may be overridden using
|
||||
PERLLIB)</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Executable helper scripts (compiler.pl, getparams,
|
||||
wait4ifup)</entry>
|
||||
|
||||
<entry>/usr/share/shorewall/ (may be overridden using
|
||||
LIBEXEC)</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>ifupdown.sh (from Shorewall-init)</entry>
|
||||
|
||||
<entry>/usr/share/shorewall-init/ (may be overridden using
|
||||
LIBEXEC)</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Debian</title>
|
||||
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><emphasis role="bold">COMPONENT</emphasis></entry>
|
||||
|
||||
<entry><emphasis role="bold">LOCATION</emphasis></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>CLI programs</entry>
|
||||
|
||||
<entry>/sbin/<replaceable>product</replaceable></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Distribution-specific configuration file</entry>
|
||||
|
||||
<entry>/etc/default/<replaceable>product</replaceable></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Init Scripts</entry>
|
||||
|
||||
<entry>/etc/init.d/<replaceable>product</replaceable></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>ifupdown scripts from Shorewall-init</entry>
|
||||
|
||||
<entry>/etc/network/if-up.d/shorewall,
|
||||
/etc/network/if-post-down.d/shorewall</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>ppp ifupdown scripts from Shorewall-init</entry>
|
||||
|
||||
<entry>/etc/ppp/ip-up.d/shorewall,
|
||||
/etc/ppp/ip-down.d/shorewall /etc/ppp/ipv6-up.d/shorewall
|
||||
/etc/ppp/ipv6-down.d/shorewall</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Redhat and Derivatives</title>
|
||||
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><emphasis role="bold">COMPONENT</emphasis></entry>
|
||||
|
||||
<entry><emphasis role="bold">LOCATION</emphasis></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>CLI programs</entry>
|
||||
|
||||
<entry>/sbin/<replaceable>product</replaceable></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Distribution-specific configuration file</entry>
|
||||
|
||||
<entry>/etc/sysconfig/<replaceable>product</replaceable></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Init Scripts</entry>
|
||||
|
||||
<entry>/etc/rc.d/init.d/<replaceable>product</replaceable></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>ifupdown scripts from Shorewall-init</entry>
|
||||
|
||||
<entry>/sbin/ifup-local, /sbin/ifdown-local</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>ppp ifupdown scripts from Shorewall-init</entry>
|
||||
|
||||
<entry>/etc/ppp/ip-up.local, /etc/ppp/ip-down.local</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>SuSE</title>
|
||||
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><emphasis role="bold">COMPONENT</emphasis></entry>
|
||||
|
||||
<entry><emphasis role="bold">LOCATION</emphasis></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>CLI programs</entry>
|
||||
|
||||
<entry>/sbin/<replaceable>product</replaceable></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Distribution-specific configuration file</entry>
|
||||
|
||||
<entry>/etc/sysconfig/<replaceable>product</replaceable></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Init Scripts</entry>
|
||||
|
||||
<entry>/etc/init.d/<replaceable>product</replaceable></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>ifupdown scripts from Shorewall-init</entry>
|
||||
|
||||
<entry>/etc/sysconfig/network/if-up.d/shorewall,
|
||||
/etc/sysconfig/network/if-down.d/shorewall</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>ppp ifupdown scripts from Shorewall-init</entry>
|
||||
|
||||
<entry>/etc/ppp/ip-up.d/shorewall,
|
||||
/etc/ppp/ip-down.d/shorewall /etc/ppp/ipv6-up.d/shorewall
|
||||
/etc/ppp/ipv6-down.d/shorewall</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Cygwin</title>
|
||||
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><emphasis role="bold">COMPONENT</emphasis></entry>
|
||||
|
||||
<entry><emphasis role="bold">LOCATION</emphasis></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>CLI programs</entry>
|
||||
|
||||
<entry>/bin/<replaceable>product</replaceable></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Distribution-specific configuration file</entry>
|
||||
|
||||
<entry>N/A</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Init Scripts</entry>
|
||||
|
||||
<entry>N/A</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>ifupdown scripts from Shorewall-init</entry>
|
||||
|
||||
<entry>N/A</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>ppp ifupdown scripts from Shorewall-init</entry>
|
||||
|
||||
<entry>N/A</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>OS X</title>
|
||||
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><emphasis role="bold">COMPONENT</emphasis></entry>
|
||||
|
||||
<entry><emphasis role="bold">LOCATION</emphasis></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>CLI programs</entry>
|
||||
|
||||
<entry>/sbin/<replaceable>product</replaceable></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Distribution-specific configuration file</entry>
|
||||
|
||||
<entry>N/A</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>Init Scripts</entry>
|
||||
|
||||
<entry>N/A</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>ifupdown scripts from Shorewall-init</entry>
|
||||
|
||||
<entry>N/A</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>ppp ifupdown scripts from Shorewall-init</entry>
|
||||
|
||||
<entry>N/A</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="Debian">
|
||||
@@ -406,17 +723,37 @@ Pin-Priority: 700</programlisting><emphasis role="bold"><emphasis>Then
|
||||
issues</ulink> for specific instructions.</para>
|
||||
</important></para>
|
||||
|
||||
<para>If you are upgrading to version 4.5.0 or later, you must first
|
||||
install or upgrade the Shorewall-core package:</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>unpack the tarballs:<programlisting><command>tar -jxf shorewall-core-4.5.0.tar.bz2</command></programlisting></para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>cd to the shorewall directory (the version is encoded in the
|
||||
directory name as in <quote>shorewall-core-4.5.0</quote>).</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Type:</para>
|
||||
|
||||
<programlisting><command>./install.sh </command></programlisting>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
||||
<para>If you already have Shorewall installed and are upgrading to a new
|
||||
version using the tarball:</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>unpack the tarball:<programlisting><command>tar -jxf shorewall-4.3.5.tar.bz2</command></programlisting></para>
|
||||
<para>unpack the tarball:<programlisting><command>tar -jxf shorewall-4.5.0.tar.bz2</command></programlisting></para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>cd to the shorewall-perl directory (the version is encoded in
|
||||
the directory name as in <quote>shorewall-4.3.5</quote>).</para>
|
||||
the directory name as in <quote>shorewall-4.5.0</quote>).</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
<pubdate><?dbtimestamp format="Y/m/d"?></pubdate>
|
||||
|
||||
<copyright>
|
||||
<year>2003-2009</year>
|
||||
<year>2003-2012</year>
|
||||
|
||||
<holder>Thomas M. Eastep</holder>
|
||||
</copyright>
|
||||
@@ -385,9 +385,14 @@ ACCEPT net $FW tcp 22</programlisting>
|
||||
<section id="Packages">
|
||||
<title>Shorewall Packages</title>
|
||||
|
||||
<para>Shorewall 4.3 and later consists of four packages.</para>
|
||||
<para>Shorewall 4.5 and later consists of six packages.</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para><emphasis role="bold">Shorewall-core</emphasis>. All of the
|
||||
other packages depend on this one.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis role="bold">Shorewall</emphasis>. This package must be
|
||||
installed on at least one system in your network. It contains
|
||||
@@ -417,6 +422,13 @@ ACCEPT net $FW tcp 22</programlisting>
|
||||
scripts are generated. These scripts are copied to the firewall
|
||||
systems where they run under the control of Shorewall6-lite.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis role="bold">Shorewall-init</emphasis>. May be
|
||||
installed with any of the other firewall packages. Allows the firewall
|
||||
to be close prior to bringing up network interfaces. It can also react
|
||||
to interface up/down events.</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</section>
|
||||
|
||||
|
@@ -117,7 +117,7 @@
|
||||
ISP.</para>
|
||||
</footnote> as in the following diagram.</para>
|
||||
|
||||
<graphic align="center" fileref="images/TwoISPs.png" valign="middle" />
|
||||
<graphic align="center" fileref="images/TwoISPs.png" valign="middle"/>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
@@ -1578,8 +1578,11 @@ DOWN_COUNT=2</programlisting>
|
||||
return $status</programlisting></para>
|
||||
|
||||
<para>The above script is installed in <filename
|
||||
class="directory">/etc/shorewall</filename>, beginning with Shorewall
|
||||
4.3.11.</para>
|
||||
class="directory">/etc/shorewall</filename> in Shorewall releases
|
||||
4.3.11 - 4.5.0. Beginning with Shorewall 4.5.1, it is no longer
|
||||
installed in <filename class="directory">/etc/shorewall</filename>,
|
||||
but may be copied there from <filename
|
||||
class="directory">/usr/share/shorewall/configfiles</filename>.</para>
|
||||
|
||||
<para>Also included is a sample init script
|
||||
(<filename>swping.init</filename>) to start the monitoring daemon.
|
||||
@@ -2088,7 +2091,7 @@ exit 0
|
||||
on ursa that I will describe here</emphasis>.</para>
|
||||
|
||||
<para>Below is a diagram of our network:<graphic align="center"
|
||||
fileref="images/Network2008a.png" /></para>
|
||||
fileref="images/Network2008a.png"/></para>
|
||||
|
||||
<para>The local wired network in my office is connected to both gateways
|
||||
and uses the private (RFC 1918) network 172.20.1.0/24. The Comcast
|
||||
@@ -2242,7 +2245,7 @@ wlan0 192.168.0.0/24</programlisting><note>
|
||||
|
||||
<para>The network is pictured in the following diagram:</para>
|
||||
|
||||
<graphic align="center" fileref="images/Network2009.png" />
|
||||
<graphic align="center" fileref="images/Network2009.png"/>
|
||||
|
||||
<para>Because of the speed of the cable provider, all traffic uses that
|
||||
provider unless there is a specific need for the traffic to use the DSL
|
||||
|
@@ -32,6 +32,8 @@
|
||||
|
||||
<year>2010</year>
|
||||
|
||||
<year>2012</year>
|
||||
|
||||
<holder>Thomas M. Eastep</holder>
|
||||
</copyright>
|
||||
|
||||
@@ -52,81 +54,64 @@
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>Releases have a three-level identification
|
||||
<firstterm>x.y.z</firstterm> (e.g., 2.0.3).</para>
|
||||
<firstterm>x.y.z</firstterm> (e.g., 4.5.0).</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>The first two levels (<emphasis>x.y</emphasis>) designate the
|
||||
<firstterm>Major Release Number</firstterm> (e.g., 2.0).</para>
|
||||
<firstterm>major release number</firstterm> (e.g., 4.5).</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>The third level (<emphasis>z</emphasis>) designates the
|
||||
<firstterm>Minor Release Number</firstterm>.</para>
|
||||
<para>The third level (<emphasis>y</emphasis>) designates the
|
||||
<firstterm>minor release Number</firstterm>.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Even numbered major releases (e.g., 1.4, 2.0, 2.2, ...) are
|
||||
<firstterm>Stable Releases</firstterm>. No major new features are
|
||||
added to stable releases and new minor releases of a stable release
|
||||
will only contain bug fixes and simple low-risk enhancements.
|
||||
Installing a new minor release for the major release that you are
|
||||
currently running involves no migration issues unless you want to take
|
||||
advantage of an enhancement (for example, if you are running 1.4.10
|
||||
and I release 1.4.11, your current configuration is 100% compatible
|
||||
with the new release).</para>
|
||||
<para>Installing a new minor release involves no migration issues
|
||||
unless you want to take advantage of an enhancement. For example, if
|
||||
you are running 4.5.0 and I release 4.5.1, your current configuration
|
||||
is 100% compatible with the new release.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>A major release may have migration issues. These are listed in
|
||||
the release notes and on the <ulink url="upgrade_issues.htm">upgrade
|
||||
issues page</ulink>.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Support is available through the <ulink
|
||||
url="http://sourceforge.net/mail/?group_id=22587">Mailing List</ulink>
|
||||
for the two or three most recent Stable Releases. Three releases are
|
||||
supported when the Shorewall release in the Stable Debian distribution
|
||||
is two releases behind the current Shorewall development. In that
|
||||
case, only the minor release in Stable is supported.</para>
|
||||
for the two most recent Major Releases. Fixes will only be provided
|
||||
for the last minor release in the previous Major Release. For example,
|
||||
only 4.5.0 was released, the only fixes for major issues with 4.4.27
|
||||
would be released for the 4.4 series.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Odd numbered major releases (e.g., 2.1, 2.3, ...) are
|
||||
<firstterm>Development Releases</firstterm>. Development releases are
|
||||
where new functionality is introduced. Documentation for new features
|
||||
will be available but it may not be up to the standards of the stable
|
||||
release documentation. Sites running Development Releases should be
|
||||
prepared to play an active role in testing new features. Bug fixes and
|
||||
problem resolution for the development release take a back seat to
|
||||
support of the stable releases. Problem reports for the current
|
||||
development release should be sent to the <ulink
|
||||
url="mailto:shorewall-devel@lists.shorewall.net">Shorewall Development
|
||||
Mailing List</ulink>.</para>
|
||||
<para>Once a minor release has been announced, work begins on the next
|
||||
minor release. Periodic Beta releases are made available through
|
||||
announcements on the Shorewall Development and Shorewall User mailing
|
||||
lists. Those Beta releases are numberd w.x.y-Beta1, ...Beta2, etc.
|
||||
Support for the Beta releases is offered through the Shorewall
|
||||
Development mailing list in the form of emailed patches. There is no
|
||||
guarantee of compatability between one Beta release and the next as
|
||||
features are tweaked.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>When the level of functionality of the current development
|
||||
release is judged adequate, the <firstterm>Beta period</firstterm> for
|
||||
a new Stable release will begin. Beta releases have identifications of
|
||||
the form <emphasis>x.y.0-BetaN</emphasis> where
|
||||
<emphasis>x.y</emphasis> is the number of the next Stable Release and
|
||||
<emphasis>N</emphasis>=1,2,3... . Betas are expected to occur roughly
|
||||
once per year. Beta releases may contain new functionality not present
|
||||
in the previous beta release (e.g., 2.2.0-Beta4 may contain
|
||||
functionality not present in 2.2.0-Beta3). When I'm confident that the
|
||||
current Beta release is stable, I will release the first
|
||||
<firstterm>Release Candidate</firstterm>. Release candidates have
|
||||
identifications of the form <emphasis>x.y.0-RCn</emphasis> where
|
||||
<emphasis>x.y</emphasis> is the number of the next Stable Release and
|
||||
<emphasis>n</emphasis>=1,2,3... . Release candidates contain no new
|
||||
functionality -- they only contain bug fixes. When the stability of
|
||||
the current release candidate is judged to be sufficient then that
|
||||
release candidate will be released as the new stable release (e.g.,
|
||||
2.2.0). At that time, the new stable release and the prior stable
|
||||
release are those that are supported.</para>
|
||||
<para>When the next minor release is functionally complete, one or
|
||||
more <firstterm>release candidates</firstterm> are announced on the
|
||||
Shorewall Development and Shorewall User mailing lists. These release
|
||||
candidates are numbered w.x.y-RC1, ...-RC2, etc.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>What does it mean for a major release to be
|
||||
<firstterm>supported</firstterm>? It means that I will answer
|
||||
questions about the release and that if a bug is found, I will fix the
|
||||
bug and include the fix in the next minor release.</para>
|
||||
<firstterm>supported</firstterm>? It means that that if a bug is
|
||||
found, we will fix the bug and include the fix in the next minor
|
||||
release.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
@@ -135,16 +120,8 @@
|
||||
four-level identification <emphasis>x.y.z.N</emphasis> where x.y.z is
|
||||
the minor release being fixed and N = 1.2.3...</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Additionally, bug fixes may be made available in the form of a
|
||||
<firstterm>patch release</firstterm>. Patch releases have four-level
|
||||
identifications (e.g., 4.0.6.1); the first three identify the minor
|
||||
release and the fourth identifies the patch level.</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
||||
<para>The currently-supported major releases are and 4.0.10., 4.2.x. and
|
||||
4.4.x.</para>
|
||||
<para>The currently-supported major releases are 4.4 and 4.5.</para>
|
||||
</section>
|
||||
</article>
|
||||
|
@@ -190,9 +190,9 @@
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><filename>/etc/shorewall/rtrules</filename> - Defines
|
||||
routing rules to be used in conjunction with the routing tables
|
||||
defined in <filename>/etc/shorewall/providers</filename>.</para>
|
||||
<para><filename>/etc/shorewall/rtrules</filename> - Defines routing
|
||||
rules to be used in conjunction with the routing tables defined in
|
||||
<filename>/etc/shorewall/providers</filename>.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
@@ -1287,6 +1287,11 @@ SHELL cat /etc/shorewall/rules.d/*.rules 2> /dev/null || true</programlisting
|
||||
<para><ulink url="Macros.html">Macro</ulink> files</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manpages/shorewall-nat.html">shorewall-nat</ulink>(5)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manpages/shorewall-rules.html">shorewall-rules</ulink> (5)</para>
|
||||
@@ -1324,8 +1329,88 @@ SHELL cat /etc/shorewall/rules.d/*.rules 2> /dev/null || true</programlisting
|
||||
</itemizedlist>
|
||||
|
||||
<para>For optional interfaces, if the interface is not usable at the time
|
||||
that the firewall starts the all-zero address will be used (0.0.0.0 in
|
||||
IPv4 and :: in IPv6), resulting in no packets matching the rule.</para>
|
||||
that the firewall starts, one of two approaches are taken, depending on
|
||||
the context:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>the all-zero address will be used (0.0.0.0 in IPv4 and :: in
|
||||
IPv6), resulting in no packets matching the rule (or all packets if
|
||||
used with exclusion).</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>the entire rule is omitted from the ruleset.</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>Beginning with Shorewall 4.5.1, <firstterm>Run-time Gateway
|
||||
Variables</firstterm> in the form of a percent sign ('%') followed by a
|
||||
logical interface name are also supported. These are expanded at run-time
|
||||
to the gateway through the named interface. For optional interfaces, if
|
||||
the interface is not usable at the time that the firewall starts, the nil
|
||||
address will be used (0.0.0.0 in IPv4 and :: in IPv6), resulting in no
|
||||
packets matching the rule. Run-time gateway variables may be used in the
|
||||
SOURCE and DEST columns of the following configuration files:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manapges/shorewall-accounting.html">shorewall-accounting</ulink>
|
||||
(5)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink url="Actions.html">Action</ulink> files</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manpages/shorewall-accounting.html">shorewall-blacklist</ulink>
|
||||
(5)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink url="Macros.html">Macro</ulink> files</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manpages/shorewall-nat.html">shorewall-nat</ulink>(5) (As a
|
||||
qualifier to the INTERFACE).</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manpages/shorewall-rules.html">shorewall-rules</ulink> (5)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink
|
||||
url="manpages/shorewall-tcrules.html">shorewall-tcrules</ulink>
|
||||
(5)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><ulink url="manpages/shorewall-tos.html">shorewall-tos</ulink>
|
||||
(5)</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>Example:</term>
|
||||
|
||||
<listitem>
|
||||
<para><emphasis role="bold">%eth0</emphasis> would represent the IP
|
||||
address of the gateway out of eth0.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>If there is no gateway out of the named interface, the nil IP
|
||||
address is used (0.0.0.0 in IPv4 and :: in IPv6). That way, the generated
|
||||
rule will match no packets (or all packets if used with exclusion).</para>
|
||||
|
||||
<para>Beginning with Shorewall 4.4.27, you may also use options in <ulink
|
||||
url="manpages/shorewall.conf.html">shorewall.conf</ulink> (5) (e.g.,
|
||||
@@ -1333,7 +1418,7 @@ SHELL cat /etc/shorewall/rules.d/*.rules 2> /dev/null || true</programlisting
|
||||
|
||||
<note>
|
||||
<para>When an option is set to 'No' in shorewall.conf, the corresponding
|
||||
shell variable is will be empty.</para>
|
||||
shell variable will be empty.</para>
|
||||
</note>
|
||||
|
||||
<note>
|
||||
@@ -1353,7 +1438,9 @@ SHELL cat /etc/shorewall/rules.d/*.rules 2> /dev/null || true</programlisting
|
||||
richer and more flexible extension capability.</para>
|
||||
|
||||
<para>While inline scripts may be written in either Shell or Perl, those
|
||||
written in Perl have a lot more power.</para>
|
||||
written in Perl have a lot more power. They may be used in all
|
||||
configuration files except <filename>/etc/shorewall/params</filename> and
|
||||
<filename>/etc/shorewall/shorewall.conf</filename>.</para>
|
||||
|
||||
<para>Embedded scripts can be either single-line or multi-line. Single
|
||||
line scripts take one of the following forms:</para>
|
||||
|
@@ -85,7 +85,7 @@
|
||||
problem reporting process. It will ensure that you provide us with the
|
||||
information we need to solve your problem as quickly as possible.</para>
|
||||
|
||||
<graphic align="center" fileref="images/Troubleshoot.png" />
|
||||
<graphic align="center" fileref="images/Troubleshoot.png"/>
|
||||
|
||||
<orderedlist>
|
||||
<important>
|
||||
@@ -203,7 +203,7 @@
|
||||
message produced by Shorewall is "done.":</para>
|
||||
|
||||
<blockquote>
|
||||
<para></para>
|
||||
<para/>
|
||||
|
||||
<programlisting>…
|
||||
Activating Rules...
|
||||
@@ -457,9 +457,7 @@ State:Stopped (Thu Mar 30 14:08:11 PDT 2006)</programlisting>
|
||||
<section id="Unsubscribe">
|
||||
<title>Unsubscribing from Shorewall Mailing Lists</title>
|
||||
|
||||
<para>If you are really dim-witted enough to have to ask -- you
|
||||
unsubscribe at the same place that you subscribed. <emphasis
|
||||
role="bold">Doh.......</emphasis></para>
|
||||
<para>See <ulink url="FAQ.htm#faq98">Shorewall FAQ 98</ulink>.</para>
|
||||
</section>
|
||||
|
||||
<section id="Other">
|
||||
|
@@ -31,9 +31,11 @@
|
||||
|
||||
<year>2009</year>
|
||||
|
||||
<year>2012</year>
|
||||
|
||||
<holder>Thomas M. Eastep</holder>
|
||||
|
||||
<holder></holder>
|
||||
<holder/>
|
||||
</copyright>
|
||||
|
||||
<legalnotice>
|
||||
@@ -74,6 +76,44 @@
|
||||
zones.</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Versions >= 4.5.0</title>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>Shorewall, Shorewall6, Shorewall-lite and Shorewall6-lite now
|
||||
depend on the new package Shorewall-core. If you use the Shorewall
|
||||
installers, you must install Shorewall-core prior to installing or
|
||||
upgrading any of the other packages.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>The BLACKLIST section of the rules file has been eliminated. If
|
||||
you have entries in that file section, you must move them to the
|
||||
blrules file.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>This version of Shorewall requires the Digest::SHA1 Perl
|
||||
module.</para>
|
||||
|
||||
<simplelist>
|
||||
<member>Debian: libdigest-sha1-perl</member>
|
||||
|
||||
<member>Fedora: perl-Digest-SHA1</member>
|
||||
|
||||
<member>OpenSuSE: perl-Digest-SHA1</member>
|
||||
</simplelist>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>The generated firewall script now maintains the
|
||||
/var/lib/shorewall[6][-lite]/interface.status files used by SWPING and
|
||||
by LSM.</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Versions >= 4.4.0</title>
|
||||
|
||||
@@ -318,7 +358,7 @@
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para> Beginning with Shorewall 4.4.17, the EXPORTPARAMS option is
|
||||
<para>Beginning with Shorewall 4.4.17, the EXPORTPARAMS option is
|
||||
deprecated. With EXPORTPARAMS=No, the variables set by <ulink
|
||||
url="manpages/shorewall-params.html">/etc/shorewall/params</ulink>
|
||||
(<ulink
|
||||
|
Reference in New Issue
Block a user