forked from extern/shorewall_code
Compare commits
131 Commits
4.5.0.1
...
4.5.2-Beta
Author | SHA1 | Date | |
---|---|---|---|
|
f104596b39 | ||
|
146d66f0aa | ||
|
0ccb398cec | ||
|
287a44be52 | ||
|
86f3667b82 | ||
|
962b1cca1f | ||
|
2026fdab6a | ||
|
722e888043 | ||
|
e3997abfb9 | ||
|
710687bbd6 | ||
|
d4a1e7dba9 | ||
|
c7237e5c8e | ||
|
c299c6d61a | ||
|
6769acc7a7 | ||
|
df33587395 | ||
|
508f33a183 | ||
|
11f970d1c2 | ||
|
72e6330ff4 | ||
|
5caf68bc31 | ||
|
29ccde1603 | ||
|
826d864448 | ||
|
78306e9f5b | ||
|
15ca0fd1f0 | ||
|
955a9f0051 | ||
|
bd56caf74f | ||
|
5bfd2cc2c9 | ||
|
e47ae4f26e | ||
|
c51e387e79 | ||
|
56f66bd966 | ||
|
0415883628 | ||
|
6e089fb0e2 | ||
|
0fac1d182f | ||
|
0d71c590e4 | ||
|
d1661c95d5 | ||
|
13bf383ce8 | ||
|
60f1004339 | ||
|
81714ee81f | ||
|
5f3ba4eb40 | ||
|
164d2f5d1b | ||
|
1d021e3701 | ||
|
f9f557e1c6 | ||
|
29dd342118 | ||
|
8262cff71a | ||
|
b7465262ca | ||
|
ab13fbe95e | ||
|
f7a2cd4ef1 | ||
|
95e4f8dd91 | ||
|
8e413a7bf0 | ||
|
3e9edcb7e8 | ||
|
4ba88d2e9c | ||
|
aa503e7211 | ||
|
2a67a202b0 | ||
|
7e14777b8f | ||
|
c1d0681e17 | ||
|
98f8edbde5 | ||
|
1dd6a8b291 | ||
|
e839648b8e | ||
|
feb5cc0093 | ||
|
a3219f71c9 | ||
|
e3f2c49c7e | ||
|
fecd091078 | ||
|
e0b360513c | ||
|
01d99d4873 | ||
|
acb2e2a8ab | ||
|
0223439e2b | ||
|
fa9f8329b5 | ||
|
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 | ||
|
460efbac77 | ||
|
f4be778b86 | ||
|
bd959884cc |
@@ -30,8 +30,6 @@ usage() # $1 = exit status
|
|||||||
echo "usage: $ME"
|
echo "usage: $ME"
|
||||||
echo " $ME -v"
|
echo " $ME -v"
|
||||||
echo " $ME -h"
|
echo " $ME -h"
|
||||||
echo " $ME -s"
|
|
||||||
echo " $ME -f"
|
|
||||||
exit $1
|
exit $1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,6 +85,13 @@ install_file() # $1 = source $2 = target $3 = mode
|
|||||||
run_install $T $OWNERSHIP -m $3 $1 ${2}
|
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"
|
[ -n "$DESTDIR" ] || DESTDIR="$PREFIX"
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -98,13 +103,13 @@ T="-T"
|
|||||||
|
|
||||||
[ -n "${LIBEXEC:=/usr/share}" ]
|
[ -n "${LIBEXEC:=/usr/share}" ]
|
||||||
[ -n "${PERLLIB:=/usr/share/shorewall}" ]
|
[ -n "${PERLLIB:=/usr/share/shorewall}" ]
|
||||||
MACHOST=
|
|
||||||
|
|
||||||
case "$LIBEXEC" in
|
case "$LIBEXEC" in
|
||||||
/*)
|
/*)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
LIBEXEC=/usr/${LIBEXEC}
|
echo "The LIBEXEC setting must be an absolute path name" >&2
|
||||||
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
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
|
esac
|
||||||
|
|
||||||
INSTALLD='-D'
|
INSTALLD='-D'
|
||||||
|
|
||||||
case $(uname) in
|
if [ -z "$BUILD" ]; then
|
||||||
CYGWIN*)
|
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
|
if [ -z "$DESTDIR" ]; then
|
||||||
DEST=
|
DEST=
|
||||||
INIT=
|
INIT=
|
||||||
@@ -127,18 +159,16 @@ case $(uname) in
|
|||||||
|
|
||||||
OWNER=$(id -un)
|
OWNER=$(id -un)
|
||||||
GROUP=$(id -gn)
|
GROUP=$(id -gn)
|
||||||
CYGWIN=Yes
|
|
||||||
;;
|
;;
|
||||||
Darwin)
|
apple)
|
||||||
if [ -z "$DESTDIR" ]; then
|
if [ -z "$DESTDIR" ]; then
|
||||||
DEST=
|
DEST=
|
||||||
INIT=
|
INIT=
|
||||||
|
SPARSE=Yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -z "$OWNER" ] && OWNER=root
|
[ -z "$OWNER" ] && OWNER=root
|
||||||
[ -z "$GROUP" ] && GROUP=wheel
|
[ -z "$GROUP" ] && GROUP=wheel
|
||||||
MAC=Yes
|
|
||||||
MACHOST=Yes
|
|
||||||
INSTALLD=
|
INSTALLD=
|
||||||
T=
|
T=
|
||||||
;;
|
;;
|
||||||
@@ -168,14 +198,6 @@ while [ $finished -eq 0 ]; do
|
|||||||
echo "Shorewall Firewall Installer Version $VERSION"
|
echo "Shorewall Firewall Installer Version $VERSION"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
a*)
|
|
||||||
ANNOTATED=Yes
|
|
||||||
option=${option#a}
|
|
||||||
;;
|
|
||||||
p*)
|
|
||||||
ANNOTATED=
|
|
||||||
option=${option#p}
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
usage 1
|
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
|
# 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 [ -n "$DESTDIR" ]; then
|
||||||
if [ -z "$CYGWIN" ]; then
|
if [ $BUILD != cygwin ]; then
|
||||||
if [ `id -u` != 0 ] ; then
|
if [ `id -u` != 0 ] ; then
|
||||||
echo "Not setting file owner/group permissions, not running as root."
|
echo "Not setting file owner/group permissions, not running as root."
|
||||||
OWNERSHIP=""
|
OWNERSHIP=""
|
||||||
fi
|
fi
|
||||||
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
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -247,7 +256,12 @@ echo "Installing Shorewall Core Version $VERSION"
|
|||||||
# Create /usr/share/shorewall
|
# Create /usr/share/shorewall
|
||||||
#
|
#
|
||||||
mkdir -p ${DESTDIR}${LIBEXEC}/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
|
# Install wait4ifup
|
||||||
#
|
#
|
||||||
@@ -264,7 +278,7 @@ for f in lib.* ; do
|
|||||||
echo "Library ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall/$f"
|
echo "Library ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall/$f"
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -z "$MACHOST" ]; then
|
if [ $BUILD != apple ]; then
|
||||||
eval sed -i \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/usr/share/shorewall/lib.cli
|
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
|
eval sed -i \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/usr/share/shorewall/lib.cli
|
||||||
else
|
else
|
||||||
|
@@ -1112,7 +1112,7 @@ do_dump_command() {
|
|||||||
echo " Shorewall $(cat /usr/share/shorewall/version)"
|
echo " Shorewall $(cat /usr/share/shorewall/version)"
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
show_status
|
||||||
show_reset
|
show_reset
|
||||||
host=$(echo $g_hostname | sed 's/\..*$//')
|
host=$(echo $g_hostname | sed 's/\..*$//')
|
||||||
$g_tool -L $g_ipt_options
|
$g_tool -L $g_ipt_options
|
||||||
@@ -1957,6 +1957,8 @@ determine_capabilities() {
|
|||||||
CT_TARGET=
|
CT_TARGET=
|
||||||
STATISTIC_MATCH=
|
STATISTIC_MATCH=
|
||||||
IMQ_TARGET=
|
IMQ_TARGET=
|
||||||
|
DSCP_MATCH=
|
||||||
|
DSCP_TARGET=
|
||||||
|
|
||||||
chain=fooX$$
|
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 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 -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 -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 -F $chain
|
||||||
qt $g_tool -t mangle -X $chain
|
qt $g_tool -t mangle -X $chain
|
||||||
|
|
||||||
qt $g_tool -t mangle -L FORWARD -n && MANGLE_FORWARD=Yes
|
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
|
fi
|
||||||
|
|
||||||
qt $g_tool -t raw -L -n && RAW_TABLE=Yes
|
qt $g_tool -t raw -L -n && RAW_TABLE=Yes
|
||||||
@@ -2267,6 +2273,8 @@ report_capabilities() {
|
|||||||
report_capability "Condition Match" $CONDITION_MATCH
|
report_capability "Condition Match" $CONDITION_MATCH
|
||||||
report_capability "Statistic Match" $STATISTIC_MATCH
|
report_capability "Statistic Match" $STATISTIC_MATCH
|
||||||
report_capability "IMQ Target" $IMQ_TARGET
|
report_capability "IMQ Target" $IMQ_TARGET
|
||||||
|
report_capability "DSCP Match" $DSCP_MATCH
|
||||||
|
report_capability "DSCP Target" $DSCP_TARGET
|
||||||
|
|
||||||
if [ $g_family -eq 4 ]; then
|
if [ $g_family -eq 4 ]; then
|
||||||
report_capability "iptables -S" $IPTABLES_S
|
report_capability "iptables -S" $IPTABLES_S
|
||||||
@@ -2354,14 +2362,14 @@ report_capabilities1() {
|
|||||||
report_capability1 CT_TARGET
|
report_capability1 CT_TARGET
|
||||||
report_capability1 STATISTIC_MATCH
|
report_capability1 STATISTIC_MATCH
|
||||||
report_capability1 IMQ_TARGET
|
report_capability1 IMQ_TARGET
|
||||||
|
report_capability1 DSCP_MATCH
|
||||||
|
report_capability1 DSCP_TARGET
|
||||||
|
|
||||||
echo CAPVERSION=$SHOREWALL_CAPVERSION
|
echo CAPVERSION=$SHOREWALL_CAPVERSION
|
||||||
echo KERNELVERSION=$KERNELVERSION
|
echo KERNELVERSION=$KERNELVERSION
|
||||||
}
|
}
|
||||||
|
|
||||||
status_command() {
|
show_status() {
|
||||||
echo "${g_product}-$SHOREWALL_VERSION Status at $g_hostname - $(date)"
|
|
||||||
echo
|
|
||||||
if product_is_started ; then
|
if product_is_started ; then
|
||||||
echo "$g_product is running"
|
echo "$g_product is running"
|
||||||
status=0
|
status=0
|
||||||
@@ -2381,6 +2389,12 @@ status_command() {
|
|||||||
state=Unknown
|
state=Unknown
|
||||||
fi
|
fi
|
||||||
echo "State:$state"
|
echo "State:$state"
|
||||||
|
}
|
||||||
|
|
||||||
|
status_command() {
|
||||||
|
echo "${g_product}-$SHOREWALL_VERSION Status at $g_hostname - $(date)"
|
||||||
|
echo
|
||||||
|
show_status
|
||||||
echo
|
echo
|
||||||
exit $status
|
exit $status
|
||||||
}
|
}
|
||||||
|
@@ -86,21 +86,14 @@ install_file() # $1 = source $2 = target $3 = mode
|
|||||||
run_install $T $OWNERSHIP -m $3 $1 ${2}
|
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
|
[ -n "$DESTDIR" ] || DESTDIR="$PREFIX"
|
||||||
DEST="/etc/init.d"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$INIT" ] ; then
|
|
||||||
INIT="shorewall-init"
|
|
||||||
fi
|
|
||||||
|
|
||||||
while [ $# -gt 0 ] ; do
|
while [ $# -gt 0 ] ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -116,7 +109,6 @@ while [ $# -gt 0 ] ; do
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
ARGS="yes"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
|
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
|
esac
|
||||||
|
|
||||||
#
|
INITFILE="shorewall-init"
|
||||||
# Determine where to install the firewall script
|
|
||||||
#
|
|
||||||
|
|
||||||
case $(uname) in
|
if [ -z "$BUILD" ]; then
|
||||||
Darwin)
|
case $(uname) in
|
||||||
[ -z "$OWNER" ] && OWNER=root
|
cygwin*)
|
||||||
[ -z "$GROUP" ] && GROUP=wheel
|
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=
|
T=
|
||||||
;;
|
;;
|
||||||
|
debian|redhat|suse|slackware|archlinux)
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
[ -z "$OWNER" ] && OWNER=root
|
[ -n "$BUILD" ] && echo "ERROR: Unknown BUILD environment ($BUILD)" >&2 || echo "ERROR: Unknown BUILD environment"
|
||||||
[ -z "$GROUP" ] && GROUP=root
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
OWNERSHIP="-o $OWNER -g $GROUP"
|
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 [ -n "$DESTDIR" ]; then
|
||||||
if [ `id -u` != 0 ] ; then
|
if [ `id -u` != 0 ] ; then
|
||||||
echo "Not setting file owner/group permissions, not running as root."
|
echo "Not setting file owner/group permissions, not running as root."
|
||||||
OWNERSHIP=""
|
OWNERSHIP=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
|
install -d $OWNERSHIP -m 755 ${DESTDIR}${INITDIR}
|
||||||
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
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$DESTDIR" ]; then
|
if [ -z "$DESTDIR" ]; then
|
||||||
if [ -f /lib/systemd/system ]; then
|
if [ -d /lib/systemd/system ]; then
|
||||||
SYSTEMD=Yes
|
SYSTEMD=Yes
|
||||||
|
INITFILE=
|
||||||
fi
|
fi
|
||||||
elif [ -n "$SYSTEMD" ]; then
|
elif [ -n "$SYSTEMD" ]; then
|
||||||
mkdir -p ${DESTDIR}/lib/systemd/system
|
mkdir -p ${DESTDIR}/lib/systemd/system
|
||||||
|
INITFILE=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
|
||||||
# Change to the directory containing this script
|
|
||||||
#
|
|
||||||
cd "$(dirname $0)"
|
|
||||||
|
|
||||||
echo "Installing Shorewall Init Version $VERSION"
|
echo "Installing Shorewall Init Version $VERSION"
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -207,27 +236,36 @@ else
|
|||||||
first_install="Yes"
|
first_install="Yes"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
if [ -n "$INITFILE" ]; then
|
||||||
# Install the Init Script
|
#
|
||||||
#
|
# Install the Init Script
|
||||||
if [ -n "$DEBIAN" ]; then
|
#
|
||||||
install_file init.debian.sh ${DESTDIR}/etc/init.d/shorewall-init 0544
|
case $TARGET in
|
||||||
elif [ -n "$FEDORA" ]; then
|
debian)
|
||||||
install_file init.fedora.sh ${DESTDIR}/etc/init.d/shorewall-init 0544
|
install_file init.debian.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
||||||
#elif [ -n "$ARCHLINUX" ]; then
|
;;
|
||||||
# install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544
|
redhat)
|
||||||
else
|
install_file init.fedora.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
||||||
install_file init.sh ${DESTDIR}${DEST}/$INIT 0544
|
;;
|
||||||
|
*)
|
||||||
|
install_file init.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "Shorewall-init script installed in ${DESTDIR}${INITDIR}/${INITFILE}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Shorewall Init script installed in ${DESTDIR}${DEST}/$INIT"
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Install the .service file
|
# Install the .service file
|
||||||
#
|
#
|
||||||
if [ -n "$SYSTEMD" ]; then
|
if [ -n "$SYSTEMD" ]; then
|
||||||
run_install $OWNERSHIP -m 600 shorewall-init.service ${DESTDIR}/lib/systemd/system/shorewall-init.service
|
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"
|
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
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -247,10 +285,10 @@ chmod 644 ${DESTDIR}/usr/share/shorewall-init/version
|
|||||||
#
|
#
|
||||||
if [ -z "$DESTDIR" ]; then
|
if [ -z "$DESTDIR" ]; then
|
||||||
rm -f /usr/share/shorewall-init/init
|
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
|
fi
|
||||||
|
|
||||||
if [ -n "$DEBIAN" ]; then
|
if [ $HOST = debian ]; then
|
||||||
if [ -n "${DESTDIR}" ]; then
|
if [ -n "${DESTDIR}" ]; then
|
||||||
mkdir -p ${DESTDIR}/etc/network/if-up.d/
|
mkdir -p ${DESTDIR}/etc/network/if-up.d/
|
||||||
mkdir -p ${DESTDIR}/etc/network/if-post-down.d/
|
mkdir -p ${DESTDIR}/etc/network/if-post-down.d/
|
||||||
@@ -268,7 +306,7 @@ else
|
|||||||
mkdir -p ${DESTDIR}/etc/sysconfig
|
mkdir -p ${DESTDIR}/etc/sysconfig
|
||||||
|
|
||||||
if [ -z "$RPM" ]; then
|
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-up.d
|
||||||
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-down.d
|
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-down.d
|
||||||
else
|
else
|
||||||
@@ -294,24 +332,30 @@ if [ -d ${DESTDIR}/etc/NetworkManager ]; then
|
|||||||
install_file ifupdown.sh ${DESTDIR}/etc/NetworkManager/dispatcher.d/01-shorewall 0544
|
install_file ifupdown.sh ${DESTDIR}/etc/NetworkManager/dispatcher.d/01-shorewall 0544
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$DEBIAN" ]; then
|
case $HOST in
|
||||||
install_file ifupdown.sh ${DESTDIR}/etc/network/if-up.d/shorewall 0544
|
debian)
|
||||||
install_file ifupdown.sh ${DESTDIR}/etc/network/if-post-down.d/shorewall 0544
|
install_file ifupdown.sh ${DESTDIR}/etc/network/if-up.d/shorewall 0544
|
||||||
elif [ -n "$SUSE" ]; then
|
install_file ifupdown.sh ${DESTDIR}/etc/network/if-post-down.d/shorewall 0544
|
||||||
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
|
suse)
|
||||||
elif [ -n "$REDHAT" ]; then
|
if [ -z "$RPM" ]; then
|
||||||
if [ -f ${DESTDIR}/sbin/ifup-local -o -f ${DESTDIR}/sbin/ifdown-local ]; then
|
install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-up.d/shorewall 0544
|
||||||
echo "WARNING: /sbin/ifup-local and/or /sbin/ifdown-local already exist; up/down events will not be handled"
|
install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-down.d/shorewall 0544
|
||||||
else
|
fi
|
||||||
install_file ifupdown.sh ${DESTDIR}/sbin/ifup-local 0544
|
;;
|
||||||
install_file ifupdown.sh ${DESTDIR}/sbin/ifdown-local 0544
|
redhat)
|
||||||
fi
|
if [ -f ${DESTDIR}/sbin/ifup-local -o -f ${DESTDIR}/sbin/ifdown-local ]; then
|
||||||
fi
|
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 [ -z "$DESTDIR" ]; then
|
||||||
if [ -n "$first_install" ]; then
|
if [ -n "$first_install" ]; then
|
||||||
if [ -n "$DEBIAN" ]; then
|
if [ $HOST = debian ]; then
|
||||||
|
|
||||||
update-rc.d shorewall-init defaults
|
update-rc.d shorewall-init defaults
|
||||||
|
|
||||||
@@ -340,7 +384,7 @@ if [ -z "$DESTDIR" ]; then
|
|||||||
else
|
else
|
||||||
cant_autostart
|
cant_autostart
|
||||||
fi
|
fi
|
||||||
elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically
|
else
|
||||||
cant_autostart
|
cant_autostart
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -348,7 +392,7 @@ if [ -z "$DESTDIR" ]; then
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ -n "$first_install" ]; then
|
if [ -n "$first_install" ]; then
|
||||||
if [ -n "$DEBIAN" ]; then
|
if [ $HOST = debian ]; then
|
||||||
if [ -n "${DESTDIR}" ]; then
|
if [ -n "${DESTDIR}" ]; then
|
||||||
mkdir -p ${DESTDIR}/etc/rcS.d
|
mkdir -p ${DESTDIR}/etc/rcS.d
|
||||||
fi
|
fi
|
||||||
@@ -360,31 +404,33 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f ${DESTDIR}/etc/ppp ]; then
|
if [ -f ${DESTDIR}/etc/ppp ]; then
|
||||||
if [ -n "$DEBIAN" ] -o -n "$SUSE" ]; then
|
case $HOST in
|
||||||
for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do
|
debian|suse)
|
||||||
mkdir -p ${DESTDIR}/etc/ppp/$directory #SuSE doesn't create the IPv6 directories
|
for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do
|
||||||
cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown ${DESTDIR}/etc/ppp/$directory/shorewall
|
mkdir -p ${DESTDIR}/etc/ppp/$directory #SuSE doesn't create the IPv6 directories
|
||||||
done
|
cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown ${DESTDIR}/etc/ppp/$directory/shorewall
|
||||||
elif [ -n "$REDHAT" ]; then
|
done
|
||||||
#
|
;;
|
||||||
# Must use the dreaded ip_xxx.local file
|
redhat)
|
||||||
#
|
#
|
||||||
for file in ip-up.local ip-down.local; do
|
# Must use the dreaded ip_xxx.local file
|
||||||
FILE=${DESTDIR}/etc/ppp/$file
|
#
|
||||||
if [ -f $FILE ]; then
|
for file in ip-up.local ip-down.local; do
|
||||||
if fgrep -q Shorewall-based $FILE ; then
|
FILE=${DESTDIR}/etc/ppp/$file
|
||||||
cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown $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
|
else
|
||||||
echo "$FILE already exists -- ppp devices will not be handled"
|
cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown $FILE
|
||||||
break
|
|
||||||
fi
|
fi
|
||||||
else
|
done
|
||||||
cp -fp ${DESTDIR}${LIBEXEC}/shorewall-init/ifupdown $FILE
|
;;
|
||||||
fi
|
esac
|
||||||
done
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# Report Success
|
# 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 \
|
then \
|
||||||
/sbin/shorewall-lite -q save >/dev/null; \
|
/sbin/shorewall-lite -q save >/dev/null; \
|
||||||
else \
|
else \
|
||||||
/sbin/shorewall-lite -q restart 2>&1 | tail >&2; \
|
/sbin/shorewall-lite -q restart 2>&1 | tail >&2; exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# EOF
|
# EOF
|
||||||
|
@@ -76,10 +76,10 @@ command="$1"
|
|||||||
|
|
||||||
case "$command" in
|
case "$command" in
|
||||||
start)
|
start)
|
||||||
exec /sbin/shorewall-lite $OPTIONS start $STARTOPTIONS $@
|
exec /sbin/shorewall-lite $OPTIONS start $STARTOPTIONS
|
||||||
;;
|
;;
|
||||||
restart|reload)
|
restart|reload)
|
||||||
exec /sbin/shorewall-lite $OPTIONS restart $RESTARTOPTIONS $@
|
exec /sbin/shorewall-lite $OPTIONS restart $RESTARTOPTIONS
|
||||||
;;
|
;;
|
||||||
status|stop)
|
status|stop)
|
||||||
exec /sbin/shorewall-lite $OPTIONS $command $@
|
exec /sbin/shorewall-lite $OPTIONS $command $@
|
||||||
|
@@ -90,6 +90,11 @@ install_file() # $1 = source $2 = target $3 = mode
|
|||||||
#
|
#
|
||||||
cd "$(dirname $0)"
|
cd "$(dirname $0)"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Load packager's settings if any
|
||||||
|
#
|
||||||
|
[ -f ../shorewall-pkg.config ] && . ../shorewall-pkg.config
|
||||||
|
|
||||||
if [ -f shorewall-lite ]; then
|
if [ -f shorewall-lite ]; then
|
||||||
PRODUCT=shorewall-lite
|
PRODUCT=shorewall-lite
|
||||||
Product="Shorewall Lite"
|
Product="Shorewall Lite"
|
||||||
@@ -103,17 +108,6 @@ fi
|
|||||||
#
|
#
|
||||||
# Parse the run line
|
# 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
|
while [ $# -gt 0 ] ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h|help|?)
|
-h|help|?)
|
||||||
@@ -138,28 +132,53 @@ case "$LIBEXEC" in
|
|||||||
/*)
|
/*)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
LIBEXEC=/usr/${LIBEXEC}
|
echo "The LIBEXEC setting must be an absolute path name" >&2
|
||||||
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
#
|
#
|
||||||
# Determine where to install the firewall script
|
# Determine where to install the firewall script
|
||||||
#
|
#
|
||||||
CYGWIN=
|
cygwin=
|
||||||
INSTALLD='-D'
|
INSTALLD='-D'
|
||||||
|
INITFILE=$PRODUCT
|
||||||
T='-T'
|
T='-T'
|
||||||
|
|
||||||
case $(uname) in
|
if [ -z "$BUILD" ]; then
|
||||||
CYGWIN*)
|
case $(uname) in
|
||||||
if [ -z "$DESTDIR" ]; then
|
cygwin*)
|
||||||
DEST=
|
BUILD=cygwin
|
||||||
INIT=
|
;;
|
||||||
fi
|
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)
|
OWNER=$(id -un)
|
||||||
GROUP=$(id -gn)
|
GROUP=$(id -gn)
|
||||||
;;
|
;;
|
||||||
Darwin)
|
apple)
|
||||||
|
[ -z "$OWNER" ] && OWNER=root
|
||||||
|
[ -z "$GROUP" ] && GROUP=wheel
|
||||||
INSTALLD=
|
INSTALLD=
|
||||||
T=
|
T=
|
||||||
;;
|
;;
|
||||||
@@ -171,6 +190,45 @@ esac
|
|||||||
|
|
||||||
OWNERSHIP="-o $OWNER -g $GROUP"
|
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 [ -n "$DESTDIR" ]; then
|
||||||
if [ `id -u` != 0 ] ; then
|
if [ `id -u` != 0 ] ; then
|
||||||
echo "Not setting file owner/group permissions, not running as root."
|
echo "Not setting file owner/group permissions, not running as root."
|
||||||
@@ -178,21 +236,13 @@ if [ -n "$DESTDIR" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
|
install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
|
||||||
install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
|
install -d $OWNERSHIP -m 755 ${DESTDIR}${DESTFILE}
|
||||||
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
|
|
||||||
|
|
||||||
if [ -z "$DESTDIR" ]; then
|
if [ -n "$SYSTEMD" ]; then
|
||||||
|
mkdir -p ${DESTDIR}/lib/systemd/system
|
||||||
|
INITFILE=
|
||||||
|
fi
|
||||||
|
else
|
||||||
if [ ! -f /usr/share/shorewall/coreversion ]; then
|
if [ ! -f /usr/share/shorewall/coreversion ]; then
|
||||||
echo "$PRODUCT $VERSION requires Shorewall Core which does not appear to be installed" >&2
|
echo "$PRODUCT $VERSION requires Shorewall Core which does not appear to be installed" >&2
|
||||||
exit 1
|
exit 1
|
||||||
@@ -200,9 +250,8 @@ if [ -z "$DESTDIR" ]; then
|
|||||||
|
|
||||||
if [ -f /lib/systemd/system ]; then
|
if [ -f /lib/systemd/system ]; then
|
||||||
SYSTEMD=Yes
|
SYSTEMD=Yes
|
||||||
|
INITFILE=
|
||||||
fi
|
fi
|
||||||
elif [ -n "$SYSTEMD" ]; then
|
|
||||||
mkdir -p ${DESTDIR}/lib/systemd/system
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing $Product Version $VERSION"
|
echo "Installing $Product Version $VERSION"
|
||||||
@@ -222,7 +271,7 @@ else
|
|||||||
rm -rf ${DESTDIR}/etc/$PRODUCT
|
rm -rf ${DESTDIR}/etc/$PRODUCT
|
||||||
rm -rf ${DESTDIR}/usr/share/$PRODUCT
|
rm -rf ${DESTDIR}/usr/share/$PRODUCT
|
||||||
rm -rf ${DESTDIR}/var/lib/$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
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -240,21 +289,6 @@ install_file $PRODUCT ${DESTDIR}/sbin/$PRODUCT 0544
|
|||||||
|
|
||||||
echo "$Product control program installed in ${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
|
# Create /etc/$PRODUCT, /usr/share/$PRODUCT and /var/lib/$PRODUCT if needed
|
||||||
#
|
#
|
||||||
@@ -269,8 +303,28 @@ chmod 755 ${DESTDIR}/usr/share/$PRODUCT
|
|||||||
if [ -n "$DESTDIR" ]; then
|
if [ -n "$DESTDIR" ]; then
|
||||||
mkdir -p ${DESTDIR}/etc/logrotate.d
|
mkdir -p ${DESTDIR}/etc/logrotate.d
|
||||||
chmod 755 ${DESTDIR}/etc/logrotate.d
|
chmod 755 ${DESTDIR}/etc/logrotate.d
|
||||||
|
mkdir -p ${DESTDIR}${INITDIR}
|
||||||
|
chmod 755 ${DESTDIR}${INITDIR}
|
||||||
fi
|
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
|
# Install the .service file
|
||||||
#
|
#
|
||||||
@@ -287,7 +341,7 @@ if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
|
|||||||
echo "Config file installed as ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf"
|
echo "Config file installed as ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf"
|
||||||
fi
|
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
|
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -387,7 +441,7 @@ chmod 644 ${DESTDIR}/usr/share/$PRODUCT/version
|
|||||||
|
|
||||||
if [ -z "$DESTDIR" ]; then
|
if [ -z "$DESTDIR" ]; then
|
||||||
rm -f /usr/share/$PRODUCT/init
|
rm -f /usr/share/$PRODUCT/init
|
||||||
ln -s ${DEST}/${INIT} /usr/share/$PRODUCT/init
|
ln -s ${INITDIR}/${INITFILE} /usr/share/$PRODUCT/init
|
||||||
fi
|
fi
|
||||||
|
|
||||||
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.common
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.common
|
||||||
@@ -398,7 +452,7 @@ if [ -z "$DESTDIR" ]; then
|
|||||||
touch /var/log/$PRODUCT-init.log
|
touch /var/log/$PRODUCT-init.log
|
||||||
|
|
||||||
if [ -n "$first_install" ]; then
|
if [ -n "$first_install" ]; then
|
||||||
if [ -n "$DEBIAN" ]; then
|
if [ $HOST = debian ]; then
|
||||||
run_install $OWNERSHIP -m 0644 default.debian /etc/default/$PRODUCT
|
run_install $OWNERSHIP -m 0644 default.debian /etc/default/$PRODUCT
|
||||||
|
|
||||||
update-rc.d $PRODUCT defaults
|
update-rc.d $PRODUCT defaults
|
||||||
@@ -434,7 +488,7 @@ if [ -z "$DESTDIR" ]; then
|
|||||||
else
|
else
|
||||||
cant_autostart
|
cant_autostart
|
||||||
fi
|
fi
|
||||||
elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically
|
elif [ "$INITFILE" != rc.firewall ]; then #Slackware starts this automatically
|
||||||
cant_autostart
|
cant_autostart
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@@ -517,15 +517,17 @@
|
|||||||
defined in the <ulink
|
defined in the <ulink
|
||||||
url="shorewall-interfaces.html">shorewall-interfaces</ulink>(5)
|
url="shorewall-interfaces.html">shorewall-interfaces</ulink>(5)
|
||||||
file. A <emphasis>host-list</emphasis> is comma-separated list whose
|
file. A <emphasis>host-list</emphasis> is comma-separated list whose
|
||||||
elements are host or network addresses.<caution>
|
elements are host or network addresses.</para>
|
||||||
<para>The <command>add</command> command is not very robust. If
|
|
||||||
there are errors in the <replaceable>host-list</replaceable>,
|
<caution>
|
||||||
you may see a large number of error messages yet a subsequent
|
<para>The <command>add</command> command is not very robust. If
|
||||||
<command>shorewall-lite show zones</command> command will
|
there are errors in the <replaceable>host-list</replaceable>, you
|
||||||
indicate that all hosts were added. If this happens, replace
|
may see a large number of error messages yet a subsequent
|
||||||
<command>add</command> by <command>delete</command> and run the
|
<command>shorewall-lite show zones</command> command will indicate
|
||||||
same command again. Then enter the correct command.</para>
|
that all hosts were added. If this happens, replace
|
||||||
</caution></para>
|
<command>add</command> by <command>delete</command> and run the
|
||||||
|
same command again. Then enter the correct command.</para>
|
||||||
|
</caution>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
VARDIR=$(shell /sbin/shorewall show vardir)
|
VARDIR=$(shell /sbin/shorewall show vardir)
|
||||||
CONFDIR=/etc/shorewall
|
CONFDIR=/etc/shorewall
|
||||||
RESTOREFILE?=firewall
|
RESTOREFILE?=firewall
|
||||||
|
|
||||||
all: $(VARDIR)/${RESTOREFILE}
|
all: $(VARDIR)/${RESTOREFILE}
|
||||||
|
|
||||||
$(VARDIR)/${RESTOREFILE}: $(CONFDIR)/*
|
$(VARDIR)/${RESTOREFILE}: $(CONFDIR)/*
|
||||||
@@ -11,11 +12,12 @@ $(VARDIR)/${RESTOREFILE}: $(CONFDIR)/*
|
|||||||
then \
|
then \
|
||||||
/sbin/shorewall -q save >/dev/null; \
|
/sbin/shorewall -q save >/dev/null; \
|
||||||
else \
|
else \
|
||||||
/sbin/shorewall -q restart 2>&1 | tail >&2; \
|
/sbin/shorewall -q restart 2>&1 | tail >&2; exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -f $(CONFDIR)/*~ $(CONFDIR)/.*~
|
@rm -f $(CONFDIR)/*~ $(CONFDIR)/.*~
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
# EOF
|
# EOF
|
||||||
|
@@ -1,17 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>Shorewall</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.epic.perleditor.perlbuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>org.epic.perleditor.perlnature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
@@ -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 ( $jumpchainref ) {
|
||||||
if ( $asection ) {
|
if ( $asection ) {
|
||||||
@@ -407,7 +407,7 @@ sub setup_accounting() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $tableref->{accounting} ) {
|
if ( $tableref->{accounting} ) {
|
||||||
dont_optimize( 'accounting' );
|
set_optflags( 'accounting' , DONT_OPTIMIZE );
|
||||||
for my $chain ( qw/INPUT FORWARD/ ) {
|
for my $chain ( qw/INPUT FORWARD/ ) {
|
||||||
insert_ijump( $tableref->{$chain}, j => 'accounting', 0 );
|
insert_ijump( $tableref->{$chain}, j => 'accounting', 0 );
|
||||||
}
|
}
|
||||||
@@ -429,7 +429,7 @@ sub setup_accounting() {
|
|||||||
insert_ijump( $tableref->{POSTROUTING}, j => 'accountpost', 0 );
|
insert_ijump( $tableref->{POSTROUTING}, j => 'accountpost', 0 );
|
||||||
}
|
}
|
||||||
} elsif ( $tableref->{accounting} ) {
|
} elsif ( $tableref->{accounting} ) {
|
||||||
dont_optimize( 'accounting' );
|
set_optflags( 'accounting' , DONT_OPTIMIZE );
|
||||||
for my $chain ( qw/INPUT FORWARD OUTPUT/ ) {
|
for my $chain ( qw/INPUT FORWARD OUTPUT/ ) {
|
||||||
insert_ijump( $tableref->{$chain}, j => 'accounting', 0 );
|
insert_ijump( $tableref->{$chain}, j => 'accounting', 0 );
|
||||||
}
|
}
|
||||||
|
@@ -36,6 +36,10 @@ use strict;
|
|||||||
|
|
||||||
our @ISA = qw(Exporter);
|
our @ISA = qw(Exporter);
|
||||||
our @EXPORT = qw(
|
our @EXPORT = qw(
|
||||||
|
DONT_OPTIMIZE
|
||||||
|
DONT_DELETE
|
||||||
|
DONT_MOVE
|
||||||
|
|
||||||
add_rule
|
add_rule
|
||||||
add_irule
|
add_irule
|
||||||
add_jump
|
add_jump
|
||||||
@@ -62,6 +66,11 @@ our @EXPORT = qw(
|
|||||||
require_audit
|
require_audit
|
||||||
newlogchain
|
newlogchain
|
||||||
log_rule_limit
|
log_rule_limit
|
||||||
|
allow_optimize
|
||||||
|
allow_delete
|
||||||
|
allow_move
|
||||||
|
set_optflags
|
||||||
|
reset_optflags
|
||||||
dont_optimize
|
dont_optimize
|
||||||
dont_delete
|
dont_delete
|
||||||
dont_move
|
dont_move
|
||||||
@@ -182,6 +191,7 @@ our %EXPORT_TAGS = (
|
|||||||
do_time
|
do_time
|
||||||
do_user
|
do_user
|
||||||
do_length
|
do_length
|
||||||
|
decode_tos
|
||||||
do_tos
|
do_tos
|
||||||
do_connbytes
|
do_connbytes
|
||||||
do_helper
|
do_helper
|
||||||
@@ -189,6 +199,7 @@ our %EXPORT_TAGS = (
|
|||||||
do_headers
|
do_headers
|
||||||
do_probability
|
do_probability
|
||||||
do_condition
|
do_condition
|
||||||
|
do_dscp
|
||||||
have_ipset_rules
|
have_ipset_rules
|
||||||
record_runtime_address
|
record_runtime_address
|
||||||
conditional_rule
|
conditional_rule
|
||||||
@@ -228,6 +239,7 @@ our %EXPORT_TAGS = (
|
|||||||
create_chainlist_reload
|
create_chainlist_reload
|
||||||
create_stop_load
|
create_stop_load
|
||||||
%targets
|
%targets
|
||||||
|
%dscpmap
|
||||||
) ],
|
) ],
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -246,9 +258,7 @@ our $VERSION = 'MODULEVERSION';
|
|||||||
# builtin => undef|1 -- If 1, one of Netfilter's built-in chains.
|
# builtin => undef|1 -- If 1, one of Netfilter's built-in chains.
|
||||||
# manual => undef|1 -- If 1, a manual chain.
|
# manual => undef|1 -- If 1, a manual chain.
|
||||||
# accounting => undef|1 -- If 1, an accounting chain
|
# accounting => undef|1 -- If 1, an accounting chain
|
||||||
# dont_optimize=> undef|1 -- Don't optimize away if this chain is 'short'
|
# optflags => <optimization flags>
|
||||||
# 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
|
|
||||||
# log => <logging rule number for use when LOGRULENUMBERS>
|
# log => <logging rule number for use when LOGRULENUMBERS>
|
||||||
# policy => <policy>
|
# policy => <policy>
|
||||||
# policychain => <name of policy chain> -- self-reference if this is a policy chain
|
# 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 { 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
|
# 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( $$$;@ ) {
|
sub push_irule( $$$;@ ) {
|
||||||
@@ -1180,7 +1221,7 @@ sub push_irule( $$$;@ ) {
|
|||||||
$chainref->{referenced} = 1;
|
$chainref->{referenced} = 1;
|
||||||
|
|
||||||
unless ( $ruleref->{simple} = ! @matches ) {
|
unless ( $ruleref->{simple} = ! @matches ) {
|
||||||
$chainref->{dont_optimize} = 1 if push_matches( $ruleref, @matches );
|
$chainref->{optflags} |= push_matches( $ruleref, @matches );
|
||||||
}
|
}
|
||||||
|
|
||||||
push @{$chainref->{rules}}, $ruleref;
|
push @{$chainref->{rules}}, $ruleref;
|
||||||
@@ -1294,7 +1335,7 @@ sub insert_irule( $$$$;@ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
unless ( $ruleref->{simple} = ! @matches ) {
|
unless ( $ruleref->{simple} = ! @matches ) {
|
||||||
$chainref->{dont_optimize} = 1 if push_matches( $ruleref, @matches );
|
$chainref->{optflags} |= push_matches( $ruleref, @matches );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $comment ) {
|
if ( $comment ) {
|
||||||
@@ -1867,7 +1908,8 @@ sub new_chain($$)
|
|||||||
log => 1,
|
log => 1,
|
||||||
cmdlevel => 0,
|
cmdlevel => 0,
|
||||||
references => {},
|
references => {},
|
||||||
filtered => 0
|
filtered => 0,
|
||||||
|
optflags => 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
trace( $chainref, 'N', undef, '' ) if $debug;
|
trace( $chainref, 'N', undef, '' ) if $debug;
|
||||||
@@ -1928,7 +1970,7 @@ sub add_jump( $$$;$$$ ) {
|
|||||||
|
|
||||||
my $param = $goto_ok && $toref && have_capability( 'GOTO_TARGET' ) ? 'g' : 'j';
|
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 ) {
|
if ( defined $index ) {
|
||||||
assert( ! $expandports );
|
assert( ! $expandports );
|
||||||
@@ -2052,49 +2094,70 @@ sub delete_jumps ( $$ ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
sub reset_optflags( $$ ) {
|
||||||
# Set the dont_optimize flag for a chain
|
my ( $chain, $flags ) = @_;
|
||||||
#
|
|
||||||
sub dont_optimize( $ ) {
|
|
||||||
my $chain = shift;
|
|
||||||
|
|
||||||
my $chainref = reftype $chain ? $chain : $filter_table->{$chain};
|
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;
|
trace( $chainref, '!O', undef, '' ) if $debug;
|
||||||
|
|
||||||
$chainref;
|
$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
|
# Set the dont_optimize and dont_delete flags for a chain
|
||||||
#
|
#
|
||||||
sub dont_delete( $ ) {
|
sub dont_delete( $ ) {
|
||||||
my $chain = shift;
|
set_optflags( shift, DONT_OPTIMIZE | DONT_DELETE );
|
||||||
|
|
||||||
my $chainref = reftype $chain ? $chain : $filter_table->{$chain};
|
|
||||||
|
|
||||||
$chainref->{dont_optimize} = $chainref->{dont_delete} = 1;
|
|
||||||
|
|
||||||
trace( $chainref, '!OD', undef, '' ) if $debug;
|
|
||||||
|
|
||||||
$chainref;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Set the dont_move flag for a chain
|
# Set the dont_move flag for a chain
|
||||||
#
|
#
|
||||||
sub dont_move( $ ) {
|
sub dont_move( $ ) {
|
||||||
my $chain = shift;
|
set_optflags( shift, DONT_MOVE );
|
||||||
|
|
||||||
my $chainref = reftype $chain ? $chain : $filter_table->{$chain};
|
|
||||||
|
|
||||||
$chainref->{dont_move} = 1;
|
|
||||||
|
|
||||||
trace( $chainref, '!M', undef, '' ) if $debug;
|
|
||||||
|
|
||||||
$chainref;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -2136,7 +2199,7 @@ sub ensure_accounting_chain( $$$ )
|
|||||||
$chainref->{restriction} = $restriction;
|
$chainref->{restriction} = $restriction;
|
||||||
$chainref->{restricted} = NO_RESTRICT;
|
$chainref->{restricted} = NO_RESTRICT;
|
||||||
$chainref->{ipsec} = $ipsec;
|
$chainref->{ipsec} = $ipsec;
|
||||||
$chainref->{dont_optimize} = 1 unless $config{OPTIMIZE_ACCOUNTING};
|
$chainref->{optflags} |= DONT_OPTIMIZE unless $config{OPTIMIZE_ACCOUNTING};
|
||||||
|
|
||||||
unless ( $chain eq 'accounting' ) {
|
unless ( $chain eq 'accounting' ) {
|
||||||
my $file = find_file $chain;
|
my $file = find_file $chain;
|
||||||
@@ -2208,7 +2271,7 @@ sub new_builtin_chain($$$)
|
|||||||
$chainref->{referenced} = 1;
|
$chainref->{referenced} = 1;
|
||||||
$chainref->{policy} = $policy;
|
$chainref->{policy} = $policy;
|
||||||
$chainref->{builtin} = 1;
|
$chainref->{builtin} = 1;
|
||||||
$chainref->{dont_delete} = 1;
|
$chainref->{optflags} = DONT_DELETE;
|
||||||
$chainref;
|
$chainref;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2636,7 +2699,7 @@ sub conditionally_copy_rules( $$ ) {
|
|||||||
|
|
||||||
my $targetref = $chain_table{$chainref->{table}}{$basictarget};
|
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
|
# 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
|
# 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};
|
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
|
# When a chain with a single entry is found, replace it's references by its contents
|
||||||
#
|
#
|
||||||
# The search continues until no short chains remain
|
# 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 ) {
|
while ( $progress ) {
|
||||||
$progress = 0;
|
$progress = 0;
|
||||||
@@ -2708,15 +2771,16 @@ sub optimize_level4( $$ ) {
|
|||||||
progress_message "\n Table $table pass $passes, $chains referenced chains, level 4a...";
|
progress_message "\n Table $table pass $passes, $chains referenced chains, level 4a...";
|
||||||
|
|
||||||
for my $chainref ( @chains ) {
|
for my $chainref ( @chains ) {
|
||||||
|
my $optflags = $chainref->{optflags};
|
||||||
#
|
#
|
||||||
# If the chain isn't branched to, then delete it
|
# 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};
|
delete_chain $chainref if $chainref->{referenced};
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
unless ( $chainref->{dont_optimize} ) {
|
unless ( $optflags & DONT_OPTIMIZE ) {
|
||||||
my $numrules = @{$chainref->{rules}};
|
my $numrules = @{$chainref->{rules}};
|
||||||
|
|
||||||
if ( $numrules == 0 ) {
|
if ( $numrules == 0 ) {
|
||||||
@@ -2727,7 +2791,7 @@ sub optimize_level4( $$ ) {
|
|||||||
#
|
#
|
||||||
# Built-in -- mark it 'dont_optimize' so we ignore it in follow-on passes
|
# Built-in -- mark it 'dont_optimize' so we ignore it in follow-on passes
|
||||||
#
|
#
|
||||||
$chainref->{dont_optimize} = 1;
|
$chainref->{optflags} |= DONT_OPTIMIZE;
|
||||||
} else {
|
} else {
|
||||||
#
|
#
|
||||||
# Not a built-in -- we can delete it and it's references
|
# 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
|
# Target was a built-in. Ignore this chain in follow-on passes
|
||||||
#
|
#
|
||||||
$chainref->{dont_optimize} = 1;
|
$chainref->{optflags} |= DONT_OPTIMIZE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#
|
#
|
||||||
@@ -2774,9 +2838,9 @@ sub optimize_level4( $$ ) {
|
|||||||
if ( $chainref->{builtin} || ! $globals{KLUDGEFREE} ) {
|
if ( $chainref->{builtin} || ! $globals{KLUDGEFREE} ) {
|
||||||
#
|
#
|
||||||
# This case requires a new rule merging algorithm. Ignore this chain for
|
# This case requires a new rule merging algorithm. Ignore this chain for
|
||||||
# now.
|
# now on.
|
||||||
#
|
#
|
||||||
$chainref->{dont_optimize} = 1;
|
$chainref->{optflags} |= DONT_OPTIMIZE;
|
||||||
} else {
|
} else {
|
||||||
#
|
#
|
||||||
# Replace references to this chain with the target and add the matches
|
# Replace references to this chain with the target and add the matches
|
||||||
@@ -2866,7 +2930,7 @@ sub optimize_level8( $$$ ) {
|
|||||||
#
|
#
|
||||||
for my $chainref1 ( @chains1 ) {
|
for my $chainref1 ( @chains1 ) {
|
||||||
next unless @{$chainref1->{rules}};
|
next unless @{$chainref1->{rules}};
|
||||||
next if $chainref1->{dont_delete};
|
next if $chainref1->{optflags} & DONT_DELETE;
|
||||||
if ( $chainref->{digest} eq $chainref1->{digest} ) {
|
if ( $chainref->{digest} eq $chainref1->{digest} ) {
|
||||||
progress_message " Chain $chainref1->{name} combined with $chainref->{name}";
|
progress_message " Chain $chainref1->{name} combined with $chainref->{name}";
|
||||||
replace_references $chainref1, $chainref->{name}, undef;
|
replace_references $chainref1, $chainref->{name}, undef;
|
||||||
@@ -3190,6 +3254,16 @@ sub set_mss( $$$ ) {
|
|||||||
#
|
#
|
||||||
# Interate over all zones with 'mss=' settings adding TCPMSS rules as appropriate.
|
# Interate over all zones with 'mss=' settings adding TCPMSS rules as appropriate.
|
||||||
#
|
#
|
||||||
|
sub imatch_source_dev( $;$ );
|
||||||
|
sub imatch_dest_dev( $;$ );
|
||||||
|
sub imatch_source_net( $;$\$ );
|
||||||
|
sub imatch_dest_net( $ );
|
||||||
|
|
||||||
|
sub newmsschain( ) {
|
||||||
|
my $seq = $chainseq{filter}++;
|
||||||
|
"~mss${seq}";
|
||||||
|
}
|
||||||
|
|
||||||
sub setup_zone_mss() {
|
sub setup_zone_mss() {
|
||||||
for my $zone ( all_zones ) {
|
for my $zone ( all_zones ) {
|
||||||
my $zoneref = find_zone( $zone );
|
my $zoneref = find_zone( $zone );
|
||||||
@@ -3197,6 +3271,29 @@ sub setup_zone_mss() {
|
|||||||
set_mss( $zone, $zoneref->{options}{in_out}{mss}, '' ) if $zoneref->{options}{in_out}{mss};
|
set_mss( $zone, $zoneref->{options}{in_out}{mss}, '' ) if $zoneref->{options}{in_out}{mss};
|
||||||
set_mss( $zone, $zoneref->{options}{in}{mss}, '_in' ) if $zoneref->{options}{in}{mss};
|
set_mss( $zone, $zoneref->{options}{in}{mss}, '_in' ) if $zoneref->{options}{in}{mss};
|
||||||
set_mss( $zone, $zoneref->{options}{out}{mss}, '_out' ) if $zoneref->{options}{out}{mss};
|
set_mss( $zone, $zoneref->{options}{out}{mss}, '_out' ) if $zoneref->{options}{out}{mss};
|
||||||
|
|
||||||
|
my $hosts = find_zone_hosts_by_option( $zone, 'mss' );
|
||||||
|
|
||||||
|
for my $hostref ( @$hosts ) {
|
||||||
|
my $mss = $hostref->[4];
|
||||||
|
my @mssmatch = have_capability( 'TCPMSS_MATCH' ) ? ( tcpmss => "--mss $mss:" ) : ();
|
||||||
|
my @sourcedev = imatch_source_dev $hostref->[0];
|
||||||
|
my @destdev = imatch_dest_dev $hostref->[0];
|
||||||
|
my @source = imatch_source_net $hostref->[2];
|
||||||
|
my @dest = imatch_dest_net $hostref->[2];
|
||||||
|
my @ipsecin = (have_ipsec ? ( policy => "--pol $hostref->[1] --dir in" ) : () );
|
||||||
|
my @ipsecout = (have_ipsec ? ( policy => "--pol $hostref->[1] --dir out" ) : () );
|
||||||
|
|
||||||
|
my $chainref = new_chain 'filter', newmsschain;
|
||||||
|
my $target = source_exclusion( $hostref->[3], $chainref );
|
||||||
|
|
||||||
|
add_ijump $chainref, j => 'TCPMSS', targetopts => "--set-mss $mss", p => 'tcp --tcp-flags SYN,RST SYN';
|
||||||
|
|
||||||
|
for my $zone1 ( all_zones ) {
|
||||||
|
add_ijump ensure_chain( 'filter', rules_chain( $zone, $zone1 ) ), j => $target , @sourcedev, @source, p => 'tcp --tcp-flags SYN,RST SYN', @mssmatch, @ipsecin ;
|
||||||
|
add_ijump ensure_chain( 'filter', rules_chain( $zone1, $zone ) ), j => $target , @destdev, @dest, p => 'tcp --tcp-flags SYN,RST SYN', @mssmatch, @ipsecout ;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4011,13 +4108,56 @@ sub do_user( $ ) {
|
|||||||
$rule;
|
$rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Create a "-m tos" match for the passed TOS
|
# Create a "-m tos" match for the passed TOS
|
||||||
#
|
#
|
||||||
sub do_tos( $ ) {
|
# This helper is also used during tos file processing
|
||||||
my $tos = $_[0];
|
#
|
||||||
|
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 = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
fatal_error( [ 'Invalid TOS column value',
|
||||||
|
'Invalid TOS column value',
|
||||||
|
'Invalid TOS() parameter', ]->[$set] . " ($tos)" )
|
||||||
|
unless ( defined $value &&
|
||||||
|
$value <= 0xff &&
|
||||||
|
( $mask eq '' ||
|
||||||
|
( defined $mask &&
|
||||||
|
$mask <= 0xff ) ) );
|
||||||
|
|
||||||
|
unless ( $mask eq '' ) {
|
||||||
|
warning_message "Unmatchable TOS ($tos)" unless $set || $value & $mask;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tos = $mask ? in_hex( $value) . '/' . in_hex( $mask ) . ' ' : in_hex( $value ) . ' ';
|
||||||
|
|
||||||
|
$set ? " --set-tos $tos" : "-m tos --tos $tos ";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
sub do_tos( $ ) {
|
||||||
|
decode_tos( $_[0], 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
my %dir = ( O => 'original' ,
|
my %dir = ( O => 'original' ,
|
||||||
@@ -4098,8 +4238,17 @@ sub do_helper( $ ) {
|
|||||||
sub do_length( $ ) {
|
sub do_length( $ ) {
|
||||||
my $length = $_[0];
|
my $length = $_[0];
|
||||||
|
|
||||||
|
return '' if $length eq '-';
|
||||||
|
|
||||||
require_capability( 'LENGTH_MATCH' , 'A Non-empty LENGTH' , 's' );
|
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 +4335,26 @@ sub do_condition( $ ) {
|
|||||||
"-m condition ${invert}--condition $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
|
# Match Source Interface
|
||||||
#
|
#
|
||||||
@@ -4313,16 +4482,27 @@ sub get_set_flags( $$ ) {
|
|||||||
} elsif ( $setname =~ /^(.*)\[((src|dst)(,(src|dst))*)\]$/ ) {
|
} elsif ( $setname =~ /^(.*)\[((src|dst)(,(src|dst))*)\]$/ ) {
|
||||||
$setname = $1;
|
$setname = $1;
|
||||||
$options = $2;
|
$options = $2;
|
||||||
|
|
||||||
|
my @options = split /,/, $options;
|
||||||
|
my %typemap = ( src => 'Source', dst => 'Destination' );
|
||||||
|
|
||||||
|
if ( $config{IPSET_WARNINGS} ) {
|
||||||
|
for ( @options ) {
|
||||||
|
warning_message( "The '$_' ipset flag is used in a $typemap{$option} column" ), last unless $_ eq $option;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$setname =~ s/^\+//;
|
$setname =~ s/^\+//;
|
||||||
|
|
||||||
unless ( $export || $> != 0 ) {
|
if ( $config{IPSET_WARNINGS} ) {
|
||||||
unless ( $ipset_exists{$setname} ) {
|
unless ( $export || $> != 0 ) {
|
||||||
warning_message "Ipset $setname does not exist" unless qt "ipset -L $setname";
|
unless ( $ipset_exists{$setname} ) {
|
||||||
}
|
warning_message "Ipset $setname does not exist" unless qt "ipset -L $setname";
|
||||||
|
}
|
||||||
|
|
||||||
$ipset_exists{$setname} = 1; # Suppress subsequent checks/warnings
|
$ipset_exists{$setname} = 1; # Suppress subsequent checks/warnings
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fatal_error "Invalid ipset name ($setname)" unless $setname =~ /^(6_)?[a-zA-Z]\w*/;
|
fatal_error "Invalid ipset name ($setname)" unless $setname =~ /^(6_)?[a-zA-Z]\w*/;
|
||||||
@@ -4337,11 +4517,21 @@ sub have_ipset_rules() {
|
|||||||
|
|
||||||
sub get_interface_address( $ );
|
sub get_interface_address( $ );
|
||||||
|
|
||||||
sub record_runtime_address( $ ) {
|
sub record_runtime_address( $$;$ ) {
|
||||||
my $interface = shift;
|
my ( $addrtype, $interface, $protect ) = @_;
|
||||||
fatal_error "Unknown interface address variable (&$interface)" unless known_interface( $interface );
|
fatal_error "Unknown interface address variable (&$interface)" unless known_interface( $interface );
|
||||||
fatal_error "Invalid interface address variable (&$interface)" if $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 +4543,19 @@ sub record_runtime_address( $ ) {
|
|||||||
sub conditional_rule( $$ ) {
|
sub conditional_rule( $$ ) {
|
||||||
my ( $chainref, $address ) = @_;
|
my ( $chainref, $address ) = @_;
|
||||||
|
|
||||||
if ( $address =~ /^!?&(.+)$/ ) {
|
if ( $address =~ /^!?([&%])(.+)$/ ) {
|
||||||
my $interface = $1;
|
my ($type, $interface) = ($1, $2);
|
||||||
if ( my $ref = known_interface $interface ) {
|
if ( my $ref = known_interface $interface ) {
|
||||||
if ( $ref->{options}{optional} ) {
|
if ( $ref->{options}{optional} ) {
|
||||||
my $variable = get_interface_address( $interface );
|
my $variable;
|
||||||
add_commands( $chainref , "if [ $variable != " . NILIP . ' ]; then' );
|
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;
|
incr_cmd_level $chainref;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -4422,16 +4619,16 @@ sub match_source_net( $;$\$ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $net =~ s/^!// ) {
|
if ( $net =~ s/^!// ) {
|
||||||
if ( $net =~ /^&(.+)/ ) {
|
if ( $net =~ /^([&%])(.+)/ ) {
|
||||||
return '! -s ' . record_runtime_address $1;
|
return '! -s ' . record_runtime_address $1, $2;
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_net $net, 1;
|
validate_net $net, 1;
|
||||||
return "! -s $net ";
|
return "! -s $net ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $net =~ /^&(.+)/ ) {
|
if ( $net =~ /^([&%])(.+)/ ) {
|
||||||
return '-s ' . record_runtime_address $1;
|
return '-s ' . record_runtime_address $1, $2;
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_net $net, 1;
|
validate_net $net, 1;
|
||||||
@@ -4476,16 +4673,16 @@ sub imatch_source_net( $;$\$ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $net =~ s/^!// ) {
|
if ( $net =~ s/^!// ) {
|
||||||
if ( $net =~ /^&(.+)/ ) {
|
if ( $net =~ /^([&%])(.+)/ ) {
|
||||||
return ( s => '! ' . record_runtime_address $1 );
|
return ( s => '! ' . record_runtime_address( $1, $2, 1 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_net $net, 1;
|
validate_net $net, 1;
|
||||||
return ( s => "! $net " );
|
return ( s => "! $net " );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $net =~ /^&(.+)/ ) {
|
if ( $net =~ /^([&%])(.+)/ ) {
|
||||||
return ( s => record_runtime_address $1 );
|
return ( s => record_runtime_address( $1, $2, 1 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_net $net, 1;
|
validate_net $net, 1;
|
||||||
@@ -4525,16 +4722,16 @@ sub match_dest_net( $ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $net =~ s/^!// ) {
|
if ( $net =~ s/^!// ) {
|
||||||
if ( $net =~ /^&(.+)/ ) {
|
if ( $net =~ /^([&%])(.+)/ ) {
|
||||||
return '! -d ' . record_runtime_address $1;
|
return '! -d ' . record_runtime_address $1, $2;
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_net $net, 1;
|
validate_net $net, 1;
|
||||||
return "! -d $net ";
|
return "! -d $net ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $net =~ /^&(.+)/ ) {
|
if ( $net =~ /^([&%])(.+)/ ) {
|
||||||
return '-d ' . record_runtime_address $1;
|
return '-d ' . record_runtime_address $1, $2;
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_net $net, 1;
|
validate_net $net, 1;
|
||||||
@@ -4572,16 +4769,16 @@ sub imatch_dest_net( $ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $net =~ s/^!// ) {
|
if ( $net =~ s/^!// ) {
|
||||||
if ( $net =~ /^&(.+)/ ) {
|
if ( $net =~ /^([&%])(.+)/ ) {
|
||||||
return ( d => '! ' . record_runtime_address $1 );
|
return ( d => '! ' . record_runtime_address( $1, $2, 1 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_net $net, 1;
|
validate_net $net, 1;
|
||||||
return ( d => "! $net " );
|
return ( d => "! $net " );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $net =~ /^&(.+)/ ) {
|
if ( $net =~ /^([&%])(.+)/ ) {
|
||||||
return ( d => record_runtime_address $1 );
|
return ( d => record_runtime_address( $1, $2, 1 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_net $net, 1;
|
validate_net $net, 1;
|
||||||
@@ -4599,7 +4796,7 @@ sub match_orig_dest ( $ ) {
|
|||||||
|
|
||||||
if ( $net =~ s/^!// ) {
|
if ( $net =~ s/^!// ) {
|
||||||
if ( $net =~ /^&(.+)/ ) {
|
if ( $net =~ /^&(.+)/ ) {
|
||||||
$net = record_runtime_address $1;
|
$net = record_runtime_address '&', $1;
|
||||||
} else {
|
} else {
|
||||||
validate_net $net, 1;
|
validate_net $net, 1;
|
||||||
}
|
}
|
||||||
@@ -4607,7 +4804,7 @@ sub match_orig_dest ( $ ) {
|
|||||||
have_capability( 'OLD_CONNTRACK_MATCH' ) ? "-m conntrack --ctorigdst ! $net " : "-m conntrack ! --ctorigdst $net ";
|
have_capability( 'OLD_CONNTRACK_MATCH' ) ? "-m conntrack --ctorigdst ! $net " : "-m conntrack ! --ctorigdst $net ";
|
||||||
} else {
|
} else {
|
||||||
if ( $net =~ /^&(.+)/ ) {
|
if ( $net =~ /^&(.+)/ ) {
|
||||||
$net = record_runtime_address $1;
|
$net = record_runtime_address '&', $1;
|
||||||
} else {
|
} else {
|
||||||
validate_net $net, 1;
|
validate_net $net, 1;
|
||||||
}
|
}
|
||||||
@@ -4623,10 +4820,10 @@ sub match_ipsec_in( $$ ) {
|
|||||||
my ( $zone , $hostref ) = @_;
|
my ( $zone , $hostref ) = @_;
|
||||||
my @match;
|
my @match;
|
||||||
my $zoneref = find_zone( $zone );
|
my $zoneref = find_zone( $zone );
|
||||||
my $optionsref = $zoneref->{options};
|
|
||||||
|
|
||||||
unless ( $optionsref->{super} || $zoneref->{type} == VSERVER ) {
|
unless ( $zoneref->{super} || $zoneref->{type} == VSERVER ) {
|
||||||
my $match = '--dir in --pol ';
|
my $match = '--dir in --pol ';
|
||||||
|
my $optionsref = $zoneref->{options};
|
||||||
|
|
||||||
if ( $zoneref->{type} & IPSEC ) {
|
if ( $zoneref->{type} & IPSEC ) {
|
||||||
$match .= "ipsec $optionsref->{in_out}{ipsec}$optionsref->{in}{ipsec}";
|
$match .= "ipsec $optionsref->{in_out}{ipsec}$optionsref->{in}{ipsec}";
|
||||||
@@ -5055,8 +5252,8 @@ sub interface_gateway( $ ) {
|
|||||||
#
|
#
|
||||||
# Record that the ruleset requires the gateway address on the passed interface
|
# Record that the ruleset requires the gateway address on the passed interface
|
||||||
#
|
#
|
||||||
sub get_interface_gateway ( $ ) {
|
sub get_interface_gateway ( $;$ ) {
|
||||||
my ( $logical ) = $_[0];
|
my ( $logical, $protect ) = @_;
|
||||||
|
|
||||||
my $interface = get_physical $logical;
|
my $interface = get_physical $logical;
|
||||||
my $variable = interface_gateway( $interface );
|
my $variable = interface_gateway( $interface );
|
||||||
@@ -5073,7 +5270,7 @@ sub get_interface_gateway ( $ ) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
"\$$variable";
|
$protect ? "\${$variable:-" . NILIP . '}' : "\$$variable";
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -5383,7 +5580,7 @@ sub expand_rule( $$$$$$$$$$;$ )
|
|||||||
} else {
|
} else {
|
||||||
$inets = $source;
|
$inets = $source;
|
||||||
}
|
}
|
||||||
} elsif ( $source =~ /(?:\+|&|~|\..*\.)/ ) {
|
} elsif ( $source =~ /(?:\+|&|%|~|\..*\.)/ ) {
|
||||||
$inets = $source;
|
$inets = $source;
|
||||||
} else {
|
} else {
|
||||||
$iiface = $source;
|
$iiface = $source;
|
||||||
@@ -5468,7 +5665,7 @@ sub expand_rule( $$$$$$$$$$;$ )
|
|||||||
if ( $dest =~ /^(.+?):(.+)$/ ) {
|
if ( $dest =~ /^(.+?):(.+)$/ ) {
|
||||||
$diface = $1;
|
$diface = $1;
|
||||||
$dnets = $2;
|
$dnets = $2;
|
||||||
} elsif ( $dest =~ /\+|&|~|\..*\./ ) {
|
} elsif ( $dest =~ /\+|&|%|~|\..*\./ ) {
|
||||||
$dnets = $dest;
|
$dnets = $dest;
|
||||||
} else {
|
} else {
|
||||||
$diface = $dest;
|
$diface = $dest;
|
||||||
@@ -6413,7 +6610,7 @@ sub create_netfilter_load( $ ) {
|
|||||||
#
|
#
|
||||||
emit( 'exec 3>&-',
|
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..."',
|
'progress_message2 "Running $command..."',
|
||||||
'',
|
'',
|
||||||
|
@@ -709,10 +709,6 @@ sub compiler {
|
|||||||
# Proxy Arp/Ndp
|
# Proxy Arp/Ndp
|
||||||
#
|
#
|
||||||
setup_proxy_arp;
|
setup_proxy_arp;
|
||||||
#
|
|
||||||
# Handle MSS settings in the zones file
|
|
||||||
#
|
|
||||||
setup_zone_mss;
|
|
||||||
|
|
||||||
if ( $scriptfilename || $debug ) {
|
if ( $scriptfilename || $debug ) {
|
||||||
emit 'return 0';
|
emit 'return 0';
|
||||||
|
@@ -292,6 +292,8 @@ my %capdesc = ( NAT_ENABLED => 'NAT',
|
|||||||
STATISTIC_MATCH =>
|
STATISTIC_MATCH =>
|
||||||
'Statistics Match',
|
'Statistics Match',
|
||||||
IMQ_TARGET => 'IMQ Target',
|
IMQ_TARGET => 'IMQ Target',
|
||||||
|
DSCP_MATCH => 'DSCP Match',
|
||||||
|
DSCP_TARGET => 'DSCP Target',
|
||||||
CAPVERSION => 'Capability Version',
|
CAPVERSION => 'Capability Version',
|
||||||
KERNELVERSION => 'Kernel 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; # Name of product that will run the generated script
|
||||||
our $Product; # $product with initial cap.
|
our $Product; # $product with initial cap.
|
||||||
|
|
||||||
my $sillyname; # Name of temporary filter chains for testing capabilities
|
our $sillyname; # Name of temporary filter chains for testing capabilities
|
||||||
my $sillyname1;
|
our $sillyname1;
|
||||||
my $iptables; # Path to iptables/ip6tables
|
my $iptables; # Path to iptables/ip6tables
|
||||||
my $tc; # Path to tc
|
my $tc; # Path to tc
|
||||||
my $ip; # Path to ip
|
my $ip; # Path to ip
|
||||||
@@ -418,6 +420,18 @@ my %deprecated = ( LOGRATE => '' ,
|
|||||||
WIDE_TC_MARKS => 'no',
|
WIDE_TC_MARKS => 'no',
|
||||||
HIGH_ROUTE_MARKS => 'no'
|
HIGH_ROUTE_MARKS => 'no'
|
||||||
);
|
);
|
||||||
|
#
|
||||||
|
# Deprecated options that are eliminated via update
|
||||||
|
#
|
||||||
|
my %converted = ( WIDE_TC_MARKS => 1,
|
||||||
|
HIGH_ROUTE_MARKS => 1 );
|
||||||
|
#
|
||||||
|
# Variables involved in ?IF, ?ELSE ?ENDIF processing
|
||||||
|
#
|
||||||
|
my $omitting;
|
||||||
|
my @ifstack;
|
||||||
|
my $ifstack;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Rather than initializing globals in an INIT block or during declaration,
|
# Rather than initializing globals in an INIT block or during declaration,
|
||||||
# we initialize them in a function. This is done for two reasons:
|
# we initialize them in a function. This is done for two reasons:
|
||||||
@@ -451,6 +465,9 @@ sub initialize( $ ) {
|
|||||||
$tempfile = ''; # Temporary File Name
|
$tempfile = ''; # Temporary File Name
|
||||||
$sillyname =
|
$sillyname =
|
||||||
$sillyname1 = ''; # Temporary ipchains
|
$sillyname1 = ''; # Temporary ipchains
|
||||||
|
$omitting = 0;
|
||||||
|
$ifstack = 0;
|
||||||
|
@ifstack = ();
|
||||||
|
|
||||||
#
|
#
|
||||||
# Misc Globals
|
# Misc Globals
|
||||||
@@ -551,6 +568,7 @@ sub initialize( $ ) {
|
|||||||
MAPOLDACTIONS => undef,
|
MAPOLDACTIONS => undef,
|
||||||
FASTACCEPT => undef,
|
FASTACCEPT => undef,
|
||||||
IMPLICIT_CONTINUE => undef,
|
IMPLICIT_CONTINUE => undef,
|
||||||
|
IPSET_WARNINGS => undef,
|
||||||
HIGH_ROUTE_MARKS => undef,
|
HIGH_ROUTE_MARKS => undef,
|
||||||
USE_ACTIONS=> undef,
|
USE_ACTIONS=> undef,
|
||||||
OPTIMIZE => undef,
|
OPTIMIZE => undef,
|
||||||
@@ -692,6 +710,8 @@ sub initialize( $ ) {
|
|||||||
CT_TARGET => undef,
|
CT_TARGET => undef,
|
||||||
STATISTIC_MATCH => undef,
|
STATISTIC_MATCH => undef,
|
||||||
IMQ_TARGET => undef,
|
IMQ_TARGET => undef,
|
||||||
|
DSCP_MATCH => undef,
|
||||||
|
DSCP_TARGET => undef,
|
||||||
CAPVERSION => undef,
|
CAPVERSION => undef,
|
||||||
KERNELVERSION => undef,
|
KERNELVERSION => undef,
|
||||||
);
|
);
|
||||||
@@ -747,7 +767,7 @@ my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
|
|||||||
sub warning_message
|
sub warning_message
|
||||||
{
|
{
|
||||||
my $linenumber = $currentlinenumber || 1;
|
my $linenumber = $currentlinenumber || 1;
|
||||||
my $currentlineinfo = $currentfile ? " : $currentfilename (line $linenumber)" : '';
|
my $currentlineinfo = $currentfile ? " : $currentfilename " . ( $linenumber eq 'EOF' ? '(EOF)' : "(line $linenumber)" ) : '';
|
||||||
our @localtime;
|
our @localtime;
|
||||||
|
|
||||||
$| = 1; #Reset output buffering (flush any partially filled buffers).
|
$| = 1; #Reset output buffering (flush any partially filled buffers).
|
||||||
@@ -803,7 +823,7 @@ sub cleanup() {
|
|||||||
#
|
#
|
||||||
sub fatal_error {
|
sub fatal_error {
|
||||||
my $linenumber = $currentlinenumber || 1;
|
my $linenumber = $currentlinenumber || 1;
|
||||||
my $currentlineinfo = $currentfile ? " : $currentfilename (line $linenumber)" : '';
|
my $currentlineinfo = $currentfile ? " : $currentfilename " . ( $linenumber eq 'EOF' ? '(EOF)' : "(line $linenumber)" ) : '';
|
||||||
|
|
||||||
$| = 1; #Reset output buffering (flush any partially filled buffers).
|
$| = 1; #Reset output buffering (flush any partially filled buffers).
|
||||||
|
|
||||||
@@ -1450,6 +1470,7 @@ sub do_open_file( $ ) {
|
|||||||
my $fname = $_[0];
|
my $fname = $_[0];
|
||||||
open $currentfile, '<', $fname or fatal_error "Unable to open $fname: $!";
|
open $currentfile, '<', $fname or fatal_error "Unable to open $fname: $!";
|
||||||
$currentlinenumber = 0;
|
$currentlinenumber = 0;
|
||||||
|
$ifstack = @ifstack;
|
||||||
$currentfilename = $fname;
|
$currentfilename = $fname;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1462,6 +1483,7 @@ sub open_file( $ ) {
|
|||||||
$first_entry = 0;
|
$first_entry = 0;
|
||||||
do_open_file $fname;;
|
do_open_file $fname;;
|
||||||
} else {
|
} else {
|
||||||
|
$ifstack = @ifstack;
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1472,10 +1494,17 @@ sub open_file( $ ) {
|
|||||||
sub pop_include() {
|
sub pop_include() {
|
||||||
my $arrayref = pop @includestack;
|
my $arrayref = pop @includestack;
|
||||||
|
|
||||||
|
unless ( $ifstack == @ifstack ) {
|
||||||
|
my $lastref = $ifstack[-1];
|
||||||
|
$currentlinenumber = 'EOF';
|
||||||
|
fatal_error qq(Missing "?ENDIF" to match ?IF at line number $lastref->[2])
|
||||||
|
}
|
||||||
|
|
||||||
if ( $arrayref ) {
|
if ( $arrayref ) {
|
||||||
( $currentfile, $currentfilename, $currentlinenumber ) = @$arrayref;
|
( $currentfile, $currentfilename, $currentlinenumber, $ifstack ) = @$arrayref;
|
||||||
} else {
|
} else {
|
||||||
$currentfile = undef;
|
$currentfile = undef;
|
||||||
|
$currentlinenumber = 'EOF';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1496,6 +1525,53 @@ sub close_file() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub process_conditional( $$ ) {
|
||||||
|
my ( $omitting, $line ) = @_;
|
||||||
|
|
||||||
|
fatal_error "Invalid compiler directive ($line)" unless $line =~ /^\s*\?(IF\s+|ELSE|ENDIF)(.*)$/;
|
||||||
|
|
||||||
|
my ($keyword, $rest) = ( $1, $2 );
|
||||||
|
|
||||||
|
$rest = '' unless supplied $rest;
|
||||||
|
|
||||||
|
my ( $lastkeyword, $prioromit, $lastomit, $lastlinenumber ) = @ifstack ? @{$ifstack[-1]} : ('', 0, 0, 0 );
|
||||||
|
|
||||||
|
if ( $keyword =~ /^IF/ ) {
|
||||||
|
fatal_error "Missing IF variable" unless $rest;
|
||||||
|
my $invert = $rest =~ s/^!\s*//;
|
||||||
|
|
||||||
|
fatal_error "Invalid IF variable ($rest)" unless $rest =~ s/^\$// && $rest =~ /^\w+$/;
|
||||||
|
|
||||||
|
push @ifstack, [ 'IF', $lastomit, $omitting, $currentlinenumber ];
|
||||||
|
|
||||||
|
if ( $rest eq '__IPV6' ) {
|
||||||
|
$omitting = $family == F_IPV4;
|
||||||
|
} elsif ( $rest eq '__IPV4' ) {
|
||||||
|
$omitting = $family == F_IPV6;
|
||||||
|
} else {
|
||||||
|
$omitting = ! ( exists $ENV{$rest} ? $ENV{$rest} :
|
||||||
|
exists $params{$rest} ? $params{$rest} :
|
||||||
|
exists $config{$rest} ? $config{$rest} : 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
$omitting = ! $omitting if $invert;
|
||||||
|
|
||||||
|
$omitting ||= $lastomit; #?IF cannot transition from omitting -> not omitting
|
||||||
|
} elsif ( $keyword eq 'ELSE' ) {
|
||||||
|
fatal_error "Invalid ?ELSE" unless $rest eq '';
|
||||||
|
fatal_error "?ELSE has no matching ?IF" unless @ifstack > $ifstack && $lastkeyword eq 'IF';
|
||||||
|
$omitting = ! $omitting unless $lastomit;
|
||||||
|
$ifstack[-1] = [ 'ELSE', $prioromit, $omitting, $lastlinenumber ];
|
||||||
|
} else {
|
||||||
|
fatal_error "Invalid ?ENDIF" unless $rest eq '';
|
||||||
|
fatal_error q(Unexpected "?ENDIF" without matching ?IF or ?ELSE) if @ifstack <= $ifstack;
|
||||||
|
$omitting = $prioromit;
|
||||||
|
pop @ifstack;
|
||||||
|
}
|
||||||
|
|
||||||
|
$omitting;
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Functions for copying a file into the script
|
# Functions for copying a file into the script
|
||||||
#
|
#
|
||||||
@@ -1598,7 +1674,7 @@ sub copy1( $ ) {
|
|||||||
fatal_error "Directory ($filename) not allowed in INCLUDE" if -d _;
|
fatal_error "Directory ($filename) not allowed in INCLUDE" if -d _;
|
||||||
|
|
||||||
if ( -s _ ) {
|
if ( -s _ ) {
|
||||||
push @includestack, [ $currentfile, $currentfilename, $currentlinenumber ];
|
push @includestack, [ $currentfile, $currentfilename, $currentlinenumber, $ifstack ];
|
||||||
$currentfile = undef;
|
$currentfile = undef;
|
||||||
do_open_file $filename;
|
do_open_file $filename;
|
||||||
} else {
|
} else {
|
||||||
@@ -1714,7 +1790,7 @@ EOF
|
|||||||
#
|
#
|
||||||
sub push_open( $ ) {
|
sub push_open( $ ) {
|
||||||
|
|
||||||
push @includestack, [ $currentfile, $currentfilename, $currentlinenumber ];
|
push @includestack, [ $currentfile, $currentfilename, $currentlinenumber, $ifstack ];
|
||||||
my @a = @includestack;
|
my @a = @includestack;
|
||||||
push @openstack, \@a;
|
push @openstack, \@a;
|
||||||
@includestack = ();
|
@includestack = ();
|
||||||
@@ -1789,7 +1865,7 @@ sub embedded_shell( $ ) {
|
|||||||
|
|
||||||
while ( <$currentfile> ) {
|
while ( <$currentfile> ) {
|
||||||
$currentlinenumber++;
|
$currentlinenumber++;
|
||||||
last if $last = s/^\s*END(\s+SHELL)?\s*;?//;
|
last if $last = s/^\s*\??END(\s+SHELL)?\s*;?//;
|
||||||
$command .= $_;
|
$command .= $_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1799,12 +1875,13 @@ sub embedded_shell( $ ) {
|
|||||||
|
|
||||||
$command .= q(');
|
$command .= q(');
|
||||||
|
|
||||||
push @includestack, [ $currentfile, $currentfilename, $currentlinenumber ];
|
push @includestack, [ $currentfile, $currentfilename, $currentlinenumber, $ifstack ];
|
||||||
$currentfile = undef;
|
$currentfile = undef;
|
||||||
open $currentfile , '-|', $command or fatal_error qq(Shell Command failed);
|
open $currentfile , '-|', $command or fatal_error qq(Shell Command failed);
|
||||||
$currentfilename = "SHELL\@$currentfilename:$currentlinenumber";
|
$currentfilename = "SHELL\@$currentfilename:$currentlinenumber";
|
||||||
$currentline = '';
|
$currentline = '';
|
||||||
$currentlinenumber = 0;
|
$currentlinenumber = 0;
|
||||||
|
$ifstack = @ifstack;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub embedded_perl( $ ) {
|
sub embedded_perl( $ ) {
|
||||||
@@ -1823,7 +1900,7 @@ sub embedded_perl( $ ) {
|
|||||||
|
|
||||||
while ( <$currentfile> ) {
|
while ( <$currentfile> ) {
|
||||||
$currentlinenumber++;
|
$currentlinenumber++;
|
||||||
last if $last = s/^\s*END(\s+PERL)?\s*;?//;
|
last if $last = s/^\s*\??END(\s+PERL)?\s*;?//;
|
||||||
$command .= $_;
|
$command .= $_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1855,7 +1932,7 @@ sub embedded_perl( $ ) {
|
|||||||
|
|
||||||
$perlscript = undef;
|
$perlscript = undef;
|
||||||
|
|
||||||
push @includestack, [ $currentfile, $currentfilename, $currentlinenumber ];
|
push @includestack, [ $currentfile, $currentfilename, $currentlinenumber , $ifstack ];
|
||||||
$currentfile = undef;
|
$currentfile = undef;
|
||||||
|
|
||||||
open $currentfile, '<', $perlscriptname or fatal_error "Unable to open Perl Script $perlscriptname";
|
open $currentfile, '<', $perlscriptname or fatal_error "Unable to open Perl Script $perlscriptname";
|
||||||
@@ -1867,6 +1944,7 @@ sub embedded_perl( $ ) {
|
|||||||
$currentfilename = "PERL\@$currentfilename:$linenumber";
|
$currentfilename = "PERL\@$currentfilename:$linenumber";
|
||||||
$currentline = '';
|
$currentline = '';
|
||||||
$currentlinenumber = 0;
|
$currentlinenumber = 0;
|
||||||
|
$ifstack = @ifstack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1971,6 +2049,7 @@ sub expand_variables( \$ ) {
|
|||||||
# - Handle embedded SHELL and PERL scripts
|
# - Handle embedded SHELL and PERL scripts
|
||||||
# - Expand shell variables from %params and %ENV.
|
# - Expand shell variables from %params and %ENV.
|
||||||
# - Handle INCLUDE <filename>
|
# - Handle INCLUDE <filename>
|
||||||
|
# - Handle ?IF, ?ELSE, ?ENDIF
|
||||||
#
|
#
|
||||||
|
|
||||||
sub read_a_line(;$$$) {
|
sub read_a_line(;$$$) {
|
||||||
@@ -2010,6 +2089,20 @@ sub read_a_line(;$$$) {
|
|||||||
#
|
#
|
||||||
$currentline = '', $currentlinenumber = 0, next if $currentline =~ /^\s*$/;
|
$currentline = '', $currentlinenumber = 0, next if $currentline =~ /^\s*$/;
|
||||||
#
|
#
|
||||||
|
# Line not blank -- Handle conditionals
|
||||||
|
#
|
||||||
|
if ( $currentline =~ /^\s*\?/ ) {
|
||||||
|
$omitting = process_conditional( $omitting, $currentline);
|
||||||
|
$currentline='';
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $omitting ) {
|
||||||
|
progress_message " OMITTED: $currentline";
|
||||||
|
$currentline='';
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
#
|
||||||
# Line not blank -- Handle any first-entry message/capabilities check
|
# Line not blank -- Handle any first-entry message/capabilities check
|
||||||
#
|
#
|
||||||
if ( $first_entry ) {
|
if ( $first_entry ) {
|
||||||
@@ -2024,12 +2117,12 @@ sub read_a_line(;$$$) {
|
|||||||
# Must check for shell/perl before doing variable expansion
|
# Must check for shell/perl before doing variable expansion
|
||||||
#
|
#
|
||||||
if ( $embedded_enabled ) {
|
if ( $embedded_enabled ) {
|
||||||
if ( $currentline =~ s/^\s*(BEGIN\s+)?SHELL\s*;?// ) {
|
if ( $currentline =~ s/^\s*\??(BEGIN\s+)?SHELL\s*;?// ) {
|
||||||
embedded_shell( $1 );
|
embedded_shell( $1 );
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $currentline =~ s/^\s*(BEGIN\s+)?PERL\s*\;?// ) {
|
if ( $currentline =~ s/^\s*\??(BEGIN\s+)?PERL\s*\;?// ) {
|
||||||
embedded_perl( $1 );
|
embedded_perl( $1 );
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
@@ -2041,7 +2134,7 @@ sub read_a_line(;$$$) {
|
|||||||
#
|
#
|
||||||
expand_variables( $currentline ) if $expand_variables;
|
expand_variables( $currentline ) if $expand_variables;
|
||||||
|
|
||||||
if ( $currentline =~ /^\s*INCLUDE\s/ ) {
|
if ( $currentline =~ /^\s*\??INCLUDE\s/ ) {
|
||||||
|
|
||||||
my @line = split ' ', $currentline;
|
my @line = split ' ', $currentline;
|
||||||
|
|
||||||
@@ -2054,7 +2147,7 @@ sub read_a_line(;$$$) {
|
|||||||
fatal_error "Directory ($filename) not allowed in INCLUDE" if -d _;
|
fatal_error "Directory ($filename) not allowed in INCLUDE" if -d _;
|
||||||
|
|
||||||
if ( -s _ ) {
|
if ( -s _ ) {
|
||||||
push @includestack, [ $currentfile, $currentfilename, $currentlinenumber ];
|
push @includestack, [ $currentfile, $currentfilename, $currentlinenumber, $ifstack ];
|
||||||
$currentfile = undef;
|
$currentfile = undef;
|
||||||
do_open_file $filename;
|
do_open_file $filename;
|
||||||
} else {
|
} else {
|
||||||
@@ -2358,7 +2451,7 @@ sub load_kernel_modules( ) {
|
|||||||
|
|
||||||
my @suffixes = split /\s+/ , $config{MODULE_SUFFIX};
|
my @suffixes = split /\s+/ , $config{MODULE_SUFFIX};
|
||||||
|
|
||||||
while ( read_a_line ) {
|
while ( read_a_line1 ) {
|
||||||
fatal_error "Invalid modules file entry" unless ( $currentline =~ /^loadmodule\s+([a-zA-Z]\w*)\s*(.*)$/ );
|
fatal_error "Invalid modules file entry" unless ( $currentline =~ /^loadmodule\s+([a-zA-Z]\w*)\s*(.*)$/ );
|
||||||
my ( $module, $arguments ) = ( $1, $2 );
|
my ( $module, $arguments ) = ( $1, $2 );
|
||||||
unless ( $loadedmodules{ $module } ) {
|
unless ( $loadedmodules{ $module } ) {
|
||||||
@@ -2778,7 +2871,15 @@ sub Statistic_Match() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub Imq_Target() {
|
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 =
|
our %detect_capability =
|
||||||
@@ -2794,6 +2895,8 @@ our %detect_capability =
|
|||||||
CONNMARK_MATCH => \&Connmark_Match,
|
CONNMARK_MATCH => \&Connmark_Match,
|
||||||
CONNTRACK_MATCH => \&Conntrack_Match,
|
CONNTRACK_MATCH => \&Conntrack_Match,
|
||||||
CT_TARGET => \&Ct_Target,
|
CT_TARGET => \&Ct_Target,
|
||||||
|
DSCP_MATCH => \&Dscp_Match,
|
||||||
|
DSCP_TARGET => \&Dscp_Target,
|
||||||
ENHANCED_REJECT => \&Enhanced_Reject,
|
ENHANCED_REJECT => \&Enhanced_Reject,
|
||||||
EXMARK => \&Exmark,
|
EXMARK => \&Exmark,
|
||||||
FLOW_FILTER => \&Flow_Filter,
|
FLOW_FILTER => \&Flow_Filter,
|
||||||
@@ -2941,11 +3044,6 @@ sub determine_capabilities() {
|
|||||||
$capabilities{IPMARK_TARGET} = detect_capability( 'IPMARK_TARGET' );
|
$capabilities{IPMARK_TARGET} = detect_capability( 'IPMARK_TARGET' );
|
||||||
$capabilities{TPROXY_TARGET} = detect_capability( 'TPROXY_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{MANGLE_FORWARD} = detect_capability( 'MANGLE_FORWARD' );
|
||||||
$capabilities{RAW_TABLE} = detect_capability( 'RAW_TABLE' );
|
$capabilities{RAW_TABLE} = detect_capability( 'RAW_TABLE' );
|
||||||
$capabilities{RAWPOST_TABLE} = detect_capability( 'RAWPOST_TABLE' );
|
$capabilities{RAWPOST_TABLE} = detect_capability( 'RAWPOST_TABLE' );
|
||||||
@@ -2975,6 +3073,8 @@ sub determine_capabilities() {
|
|||||||
$capabilities{CT_TARGET} = detect_capability( 'CT_TARGET' );
|
$capabilities{CT_TARGET} = detect_capability( 'CT_TARGET' );
|
||||||
$capabilities{STATISTIC_MATCH} = detect_capability( 'STATISTIC_MATCH' );
|
$capabilities{STATISTIC_MATCH} = detect_capability( 'STATISTIC_MATCH' );
|
||||||
$capabilities{IMQ_TARGET} = detect_capability( 'IMQ_TARGET' );
|
$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" );
|
qt1( "$iptables -F $sillyname" );
|
||||||
@@ -2982,6 +3082,16 @@ sub determine_capabilities() {
|
|||||||
qt1( "$iptables -F $sillyname1" );
|
qt1( "$iptables -F $sillyname1" );
|
||||||
qt1( "$iptables -X $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;
|
$sillyname = $sillyname1 = undef;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3145,7 +3255,7 @@ sub update_config_file( $ ) {
|
|||||||
|
|
||||||
my $heading_printed;
|
my $heading_printed;
|
||||||
|
|
||||||
for ( keys %deprecated ) {
|
for ( grep ! $converted{$_} , keys %deprecated ) {
|
||||||
if ( supplied( my $val = $config{$_} ) ) {
|
if ( supplied( my $val = $config{$_} ) ) {
|
||||||
if ( lc $val ne $deprecated{$_} ) {
|
if ( lc $val ne $deprecated{$_} ) {
|
||||||
unless ( $heading_printed ) {
|
unless ( $heading_printed ) {
|
||||||
@@ -3181,7 +3291,7 @@ EOF
|
|||||||
progress_message3 "No update required to configuration file $configfile; $configfile.bak not saved";
|
progress_message3 "No update required to configuration file $configfile; $configfile.bak not saved";
|
||||||
} else {
|
} else {
|
||||||
warning_message "Unable to unlink $configfile.bak";
|
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';
|
exit 0 unless -f find_file 'blacklist';
|
||||||
@@ -3209,7 +3319,7 @@ sub process_shorewall_conf( $$ ) {
|
|||||||
#
|
#
|
||||||
# Don't expand shell variables or allow embedded scripting
|
# Don't expand shell variables or allow embedded scripting
|
||||||
#
|
#
|
||||||
while ( read_a_line( 0, 0 ) ) {
|
while ( read_a_line1 ) {
|
||||||
if ( $currentline =~ /^\s*([a-zA-Z]\w*)=(.*?)\s*$/ ) {
|
if ( $currentline =~ /^\s*([a-zA-Z]\w*)=(.*?)\s*$/ ) {
|
||||||
my ($var, $val) = ($1, $2);
|
my ($var, $val) = ($1, $2);
|
||||||
|
|
||||||
@@ -3355,6 +3465,8 @@ sub unsupported_yes_no_warning( $ ) {
|
|||||||
sub get_params() {
|
sub get_params() {
|
||||||
my $fn = find_file 'params';
|
my $fn = find_file 'params';
|
||||||
|
|
||||||
|
my %reserved = ( COMMAND => 1, CONFDIR => 1, SHAREDIR => 1, VARDIR => 1 );
|
||||||
|
|
||||||
if ( -f $fn ) {
|
if ( -f $fn ) {
|
||||||
progress_message2 "Processing $fn ...";
|
progress_message2 "Processing $fn ...";
|
||||||
|
|
||||||
@@ -3458,6 +3570,13 @@ sub get_params() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for ( keys %params ) {
|
||||||
|
unless ( $_ eq 'SHOREWALL_INIT_SCRIPT' ) {
|
||||||
|
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 ) {
|
if ( $debug ) {
|
||||||
print "PARAMS:\n";
|
print "PARAMS:\n";
|
||||||
my $value;
|
my $value;
|
||||||
@@ -3758,6 +3877,7 @@ sub get_configuration( $$$ ) {
|
|||||||
default_yes_no 'EXPORTMODULES' , '';
|
default_yes_no 'EXPORTMODULES' , '';
|
||||||
default_yes_no 'LEGACY_FASTSTART' , 'Yes';
|
default_yes_no 'LEGACY_FASTSTART' , 'Yes';
|
||||||
default_yes_no 'USE_PHYSICAL_NAMES' , '';
|
default_yes_no 'USE_PHYSICAL_NAMES' , '';
|
||||||
|
default_yes_no 'IPSET_WARNINGS' , 'Yes';
|
||||||
|
|
||||||
require_capability 'MARK' , 'FORWARD_CLEAR_MARK=Yes', 's', if $config{FORWARD_CLEAR_MARK};
|
require_capability 'MARK' , 'FORWARD_CLEAR_MARK=Yes', 's', if $config{FORWARD_CLEAR_MARK};
|
||||||
|
|
||||||
|
@@ -76,6 +76,7 @@ our @EXPORT = qw( ALLIPv4
|
|||||||
proto_name
|
proto_name
|
||||||
validate_port
|
validate_port
|
||||||
validate_portpair
|
validate_portpair
|
||||||
|
validate_portpair1
|
||||||
validate_port_list
|
validate_port_list
|
||||||
validate_icmp
|
validate_icmp
|
||||||
validate_icmp6
|
validate_icmp6
|
||||||
@@ -371,6 +372,7 @@ sub validate_port( $$ ) {
|
|||||||
|
|
||||||
sub validate_portpair( $$ ) {
|
sub validate_portpair( $$ ) {
|
||||||
my ($proto, $portpair) = @_;
|
my ($proto, $portpair) = @_;
|
||||||
|
my $what;
|
||||||
|
|
||||||
fatal_error "Invalid port range ($portpair)" if $portpair =~ tr/:/:/ > 1;
|
fatal_error "Invalid port range ($portpair)" if $portpair =~ tr/:/:/ > 1;
|
||||||
|
|
||||||
@@ -379,16 +381,57 @@ sub validate_portpair( $$ ) {
|
|||||||
|
|
||||||
my @ports = split /:/, $portpair, 2;
|
my @ports = split /:/, $portpair, 2;
|
||||||
|
|
||||||
$_ = validate_port( $proto, $_) for ( grep $_, @ports );
|
my $protonum = resolve_proto( $proto ) || 0;
|
||||||
|
|
||||||
|
$_ = validate_port( $protonum, $_) for grep $_, @ports;
|
||||||
|
|
||||||
if ( @ports == 2 ) {
|
if ( @ports == 2 ) {
|
||||||
|
$what = 'port range';
|
||||||
fatal_error "Invalid port range ($portpair)" unless $ports[0] < $ports[1];
|
fatal_error "Invalid port range ($portpair)" unless $ports[0] < $ports[1];
|
||||||
|
} else {
|
||||||
|
$what = 'port';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fatal_error "Using a $what ( $portpair ) requires PROTO TCP, UDP, SCTP or DCCP" unless
|
||||||
|
defined $protonum && ( $protonum == TCP ||
|
||||||
|
$protonum == UDP ||
|
||||||
|
$protonum == SCTP ||
|
||||||
|
$protonum == DCCP );
|
||||||
join ':', @ports;
|
join ':', @ports;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub validate_portpair1( $$ ) {
|
||||||
|
my ($proto, $portpair) = @_;
|
||||||
|
my $what;
|
||||||
|
|
||||||
|
fatal_error "Invalid port range ($portpair)" if $portpair =~ tr/-/-/ > 1;
|
||||||
|
|
||||||
|
$portpair = "0$portpair" if substr( $portpair, 0, 1 ) eq ':';
|
||||||
|
$portpair = "${portpair}65535" if substr( $portpair, -1, 1 ) eq ':';
|
||||||
|
|
||||||
|
my @ports = split /-/, $portpair, 2;
|
||||||
|
|
||||||
|
my $protonum = resolve_proto( $proto ) || 0;
|
||||||
|
|
||||||
|
$_ = validate_port( $protonum, $_) for grep $_, @ports;
|
||||||
|
|
||||||
|
if ( @ports == 2 ) {
|
||||||
|
$what = 'port range';
|
||||||
|
fatal_error "Invalid port range ($portpair)" unless $ports[0] < $ports[1];
|
||||||
|
} else {
|
||||||
|
$what = 'port';
|
||||||
|
}
|
||||||
|
|
||||||
|
fatal_error "Using a $what ( $portpair ) requires PROTO TCP, UDP, SCTP or DCCP" unless
|
||||||
|
defined $protonum && ( $protonum == TCP ||
|
||||||
|
$protonum == UDP ||
|
||||||
|
$protonum == SCTP ||
|
||||||
|
$protonum == DCCP );
|
||||||
|
join '-', @ports;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
sub validate_port_list( $$ ) {
|
sub validate_port_list( $$ ) {
|
||||||
my $result = '';
|
my $result = '';
|
||||||
my ( $proto, $list ) = @_;
|
my ( $proto, $list ) = @_;
|
||||||
|
@@ -67,18 +67,17 @@ sub process_tos() {
|
|||||||
my $chain = have_capability( 'MANGLE_FORWARD' ) ? 'fortos' : 'pretos';
|
my $chain = have_capability( 'MANGLE_FORWARD' ) ? 'fortos' : 'pretos';
|
||||||
my $stdchain = have_capability( 'MANGLE_FORWARD' ) ? 'FORWARD' : 'PREROUTING';
|
my $stdchain = have_capability( 'MANGLE_FORWARD' ) ? 'FORWARD' : 'PREROUTING';
|
||||||
|
|
||||||
my %tosoptions = ( 'minimize-delay' => 0x10 ,
|
if ( my $fn = open_file 'tos' ) {
|
||||||
'maximize-throughput' => 0x08 ,
|
|
||||||
'maximize-reliability' => 0x04 ,
|
|
||||||
'minimize-cost' => 0x02 ,
|
|
||||||
'normal-service' => 0x00 );
|
|
||||||
|
|
||||||
if ( my $fn = open_file 'tos' ) {
|
|
||||||
my $first_entry = 1;
|
my $first_entry = 1;
|
||||||
|
|
||||||
my ( $pretosref, $outtosref );
|
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 ) {
|
while ( read_a_line ) {
|
||||||
|
|
||||||
@@ -86,14 +85,7 @@ sub process_tos() {
|
|||||||
|
|
||||||
$first_entry = 0;
|
$first_entry = 0;
|
||||||
|
|
||||||
fatal_error 'A value must be supplied in the TOS column' if $tos eq '-';
|
$tos = decode_tos( $tos , 1 );
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $chainref;
|
my $chainref;
|
||||||
|
|
||||||
@@ -129,7 +121,7 @@ sub process_tos() {
|
|||||||
$src ,
|
$src ,
|
||||||
$dst ,
|
$dst ,
|
||||||
'' ,
|
'' ,
|
||||||
"TOS --set-tos $tos" ,
|
'TOS' . $tos ,
|
||||||
'' ,
|
'' ,
|
||||||
'TOS' ,
|
'TOS' ,
|
||||||
'';
|
'';
|
||||||
@@ -216,8 +208,8 @@ sub setup_blacklist() {
|
|||||||
# for 'refresh' to work properly.
|
# for 'refresh' to work properly.
|
||||||
#
|
#
|
||||||
if ( @$zones || @$zones1 ) {
|
if ( @$zones || @$zones1 ) {
|
||||||
$chainref = dont_delete new_standard_chain 'blacklst' if @$zones;
|
$chainref = set_optflags( new_standard_chain( 'blacklst' ), DONT_OPTIMIZE | DONT_DELETE ) if @$zones;
|
||||||
$chainref1 = dont_delete new_standard_chain 'blackout' if @$zones1;
|
$chainref1 = set_optflags( new_standard_chain( 'blackout' ), DONT_OPTIMIZE | DONT_DELETE ) if @$zones1;
|
||||||
|
|
||||||
if ( supplied $level ) {
|
if ( supplied $level ) {
|
||||||
$target = ensure_blacklog_chain ( $target, $disposition, $level, $audit );
|
$target = ensure_blacklog_chain ( $target, $disposition, $level, $audit );
|
||||||
@@ -695,9 +687,9 @@ sub add_common_rules ( $ ) {
|
|||||||
my $rejectref = $filter_table->{reject};
|
my $rejectref = $filter_table->{reject};
|
||||||
|
|
||||||
if ( $config{DYNAMIC_BLACKLIST} ) {
|
if ( $config{DYNAMIC_BLACKLIST} ) {
|
||||||
add_rule_pair dont_delete( new_standard_chain( 'logdrop' ) ), '' , 'DROP' , $level ;
|
add_rule_pair( set_optflags( new_standard_chain( 'logdrop' ) , DONT_OPTIMIZE | DONT_DELETE ), '' , 'DROP' , $level );
|
||||||
add_rule_pair dont_delete( new_standard_chain( 'logreject' ) ), '' , 'reject' , $level ;
|
add_rule_pair( set_optflags( new_standard_chain( 'logreject' ), DONT_OPTIMIZE | DONT_DELETE ), '' , 'reject' , $level );
|
||||||
$dynamicref = dont_optimize( new_standard_chain( 'dynamic' ) );
|
$dynamicref = set_optflags( new_standard_chain( 'dynamic' ) , DONT_OPTIMIZE );
|
||||||
add_commands( $dynamicref, '[ -f ${VARDIR}/.dynamic ] && cat ${VARDIR}/.dynamic >&3' );
|
add_commands( $dynamicref, '[ -f ${VARDIR}/.dynamic ] && cat ${VARDIR}/.dynamic >&3' );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -994,7 +986,7 @@ sub add_common_rules ( $ ) {
|
|||||||
if ( @$list ) {
|
if ( @$list ) {
|
||||||
progress_message2 "$doing UPnP";
|
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' );
|
add_commands( $chainref, '[ -s /${VARDIR}/.UPnP ] && cat ${VARDIR}/.UPnP >&3' );
|
||||||
|
|
||||||
@@ -1013,9 +1005,10 @@ sub add_common_rules ( $ ) {
|
|||||||
for $interface ( @$list ) {
|
for $interface ( @$list ) {
|
||||||
my $chainref = $filter_table->{input_option_chain $interface};
|
my $chainref = $filter_table->{input_option_chain $interface};
|
||||||
my $base = uc chain_base get_physical $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,
|
add_commands( $chainref,
|
||||||
qq(if [ -n "SW_\$${base}_IS_USABLE" -a -n "$variable" ]; then) );
|
qq(if [ -n "SW_\$${base}_IS_USABLE" -a -n "$variable" ]; then) );
|
||||||
incr_cmd_level( $chainref );
|
incr_cmd_level( $chainref );
|
||||||
@@ -1481,7 +1474,7 @@ sub generate_matrix() {
|
|||||||
for my $zone ( @zones ) {
|
for my $zone ( @zones ) {
|
||||||
my $zoneref = find_zone( $zone );
|
my $zoneref = find_zone( $zone );
|
||||||
|
|
||||||
next if @zones <= 2 && ! $zoneref->{options}{complex};
|
next if @zones <= 2 && ! $zoneref->{complex};
|
||||||
#
|
#
|
||||||
# Complex zone or we have more than one non-firewall zone -- process_rules created a zone forwarding chain
|
# Complex zone or we have more than one non-firewall zone -- process_rules created a zone forwarding chain
|
||||||
#
|
#
|
||||||
@@ -1560,13 +1553,12 @@ sub generate_matrix() {
|
|||||||
my $source_hosts_ref = $zoneref->{hosts};
|
my $source_hosts_ref = $zoneref->{hosts};
|
||||||
my $chain1 = rules_target firewall_zone , $zone;
|
my $chain1 = rules_target firewall_zone , $zone;
|
||||||
my $chain2 = rules_target $zone, firewall_zone;
|
my $chain2 = rules_target $zone, firewall_zone;
|
||||||
my $complex = $zoneref->{options}{complex} || 0;
|
|
||||||
my $type = $zoneref->{type};
|
my $type = $zoneref->{type};
|
||||||
my $frwd_ref = $filter_table->{zone_forward_chain $zone};
|
my $frwd_ref = $filter_table->{zone_forward_chain $zone};
|
||||||
my $chain = 0;
|
my $chain = 0;
|
||||||
my $dnatref = ensure_chain 'nat' , dnat_chain( $zone );
|
my $dnatref = ensure_chain 'nat' , dnat_chain( $zone );
|
||||||
my $notrackref = ensure_chain 'raw' , notrack_chain( $zone );
|
my $notrackref = ensure_chain 'raw' , notrack_chain( $zone );
|
||||||
my $nested = $zoneref->{options}{nested};
|
my $nested = @{$zoneref->{parents}};
|
||||||
my $parenthasnat = 0;
|
my $parenthasnat = 0;
|
||||||
my $parenthasnotrack = 0;
|
my $parenthasnotrack = 0;
|
||||||
|
|
||||||
|
@@ -54,8 +54,8 @@ sub initialize() {
|
|||||||
#
|
#
|
||||||
sub process_one_masq( )
|
sub process_one_masq( )
|
||||||
{
|
{
|
||||||
my ($interfacelist, $networks, $addresses, $proto, $ports, $ipsec, $mark, $user ) =
|
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 };
|
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' ) {
|
if ( $interfacelist eq 'COMMENT' ) {
|
||||||
process_comment;
|
process_comment;
|
||||||
@@ -88,7 +88,7 @@ sub process_one_masq( )
|
|||||||
$interfacelist = $1;
|
$interfacelist = $1;
|
||||||
} elsif ( $interfacelist =~ /^([^:]+):([^:]*)$/ ) {
|
} elsif ( $interfacelist =~ /^([^:]+):([^:]*)$/ ) {
|
||||||
my ( $one, $two ) = ( $1, $2 );
|
my ( $one, $two ) = ( $1, $2 );
|
||||||
if ( $2 =~ /\./ ) {
|
if ( $2 =~ /\./ || $2 =~ /^%/ ) {
|
||||||
$interfacelist = $one;
|
$interfacelist = $one;
|
||||||
$destnets = $two;
|
$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
|
# Handle Mark
|
||||||
#
|
#
|
||||||
@@ -195,7 +195,7 @@ sub process_one_masq( )
|
|||||||
if ( $conditional = conditional_rule( $chainref, $addr ) ) {
|
if ( $conditional = conditional_rule( $chainref, $addr ) ) {
|
||||||
$addrlist .= '--to-source ' . get_interface_address $1;
|
$addrlist .= '--to-source ' . get_interface_address $1;
|
||||||
} else {
|
} else {
|
||||||
$addrlist .= '--to-source ' . record_runtime_address $1;
|
$addrlist .= '--to-source ' . record_runtime_address( '&', $1 );
|
||||||
}
|
}
|
||||||
} elsif ( $addr =~ /^.*\..*\..*\./ ) {
|
} elsif ( $addr =~ /^.*\..*\..*\./ ) {
|
||||||
$target = 'SNAT ';
|
$target = 'SNAT ';
|
||||||
@@ -210,9 +210,7 @@ sub process_one_masq( )
|
|||||||
} else {
|
} else {
|
||||||
my $ports = $addr;
|
my $ports = $addr;
|
||||||
$ports =~ s/^://;
|
$ports =~ s/^://;
|
||||||
my $portrange = $ports;
|
validate_portpair1( $proto, $ports );
|
||||||
$portrange =~ s/-/:/;
|
|
||||||
validate_portpair( $proto, $portrange );
|
|
||||||
$addrlist .= "--to-ports $ports ";
|
$addrlist .= "--to-ports $ports ";
|
||||||
$exceptionrule = do_proto( $proto, '', '' );
|
$exceptionrule = do_proto( $proto, '', '' );
|
||||||
}
|
}
|
||||||
|
@@ -160,9 +160,7 @@ sub setup_route_marking() {
|
|||||||
|
|
||||||
my $chainref2 = new_chain( 'mangle', load_chain( $physical ) );
|
my $chainref2 = new_chain( 'mangle', load_chain( $physical ) );
|
||||||
|
|
||||||
dont_optimize $chainref2;
|
set_optflags( $chainref2, DONT_OPTIMIZE | DONT_MOVE | DONT_DELETE );
|
||||||
dont_move $chainref2;
|
|
||||||
dont_delete $chainref2;
|
|
||||||
|
|
||||||
add_ijump ( $chainref1,
|
add_ijump ( $chainref1,
|
||||||
j => $chainref2 ,
|
j => $chainref2 ,
|
||||||
@@ -918,7 +916,7 @@ sub add_an_rtrule( ) {
|
|||||||
if ( $source eq '-' ) {
|
if ( $source eq '-' ) {
|
||||||
$source = 'from ' . ALLIP;
|
$source = 'from ' . ALLIP;
|
||||||
} elsif ( $source =~ s/^&// ) {
|
} elsif ( $source =~ s/^&// ) {
|
||||||
$source = 'from ' . record_runtime_address $source;
|
$source = 'from ' . record_runtime_address '&', $source;
|
||||||
} elsif ( $family == F_IPV4 ) {
|
} elsif ( $family == F_IPV4 ) {
|
||||||
if ( $source =~ /:/ ) {
|
if ( $source =~ /:/ ) {
|
||||||
( my $interface, $source , my $remainder ) = split( /:/, $source, 3 );
|
( my $interface, $source , my $remainder ) = split( /:/, $source, 3 );
|
||||||
|
@@ -963,7 +963,7 @@ sub createlogactionchain( $$$$$ ) {
|
|||||||
|
|
||||||
unless ( $targets{$action} & BUILTIN ) {
|
unless ( $targets{$action} & BUILTIN ) {
|
||||||
|
|
||||||
dont_optimize $chainref;
|
set_optflags( $chainref, DONT_OPTIMIZE );
|
||||||
|
|
||||||
my $file = find_file $chain;
|
my $file = find_file $chain;
|
||||||
|
|
||||||
@@ -997,7 +997,7 @@ sub createsimpleactionchain( $ ) {
|
|||||||
|
|
||||||
unless ( $targets{$action} & BUILTIN ) {
|
unless ( $targets{$action} & BUILTIN ) {
|
||||||
|
|
||||||
dont_optimize $chainref;
|
set_optflags( $chainref, DONT_OPTIMIZE );
|
||||||
|
|
||||||
my $file = find_file $action;
|
my $file = find_file $action;
|
||||||
|
|
||||||
@@ -1306,7 +1306,7 @@ sub allowInvalid ( $$$$ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub forwardUPnP ( $$$$ ) {
|
sub forwardUPnP ( $$$$ ) {
|
||||||
my $chainref = dont_optimize 'forwardUPnP';
|
my $chainref = set_optflags( 'forwardUPnP', DONT_OPTIMIZE );
|
||||||
|
|
||||||
add_commands( $chainref , '[ -f ${VARDIR}/.forwardUPnP ] && cat ${VARDIR}/.forwardUPnP >&3' );
|
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 ,
|
expand_rule( $nonat_chain ,
|
||||||
PREROUTE_RESTRICT ,
|
PREROUTE_RESTRICT ,
|
||||||
@@ -2262,7 +2262,7 @@ sub process_rule1 ( $$$$$$$$$$$$$$$$ $) {
|
|||||||
$action = $usedactions{$normalized_target}{name};
|
$action = $usedactions{$normalized_target}{name};
|
||||||
$loglevel = '';
|
$loglevel = '';
|
||||||
} else {
|
} else {
|
||||||
dont_move( dont_optimize ( $chainref ) ) if $action eq 'RETURN';
|
set_optflags( $chainref , DONT_MOVE | DONT_OPTIMIZE ) if $action eq 'RETURN';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $origdest ) {
|
if ( $origdest ) {
|
||||||
@@ -2458,6 +2458,12 @@ sub process_rule ( ) {
|
|||||||
progress_message qq( Rule "$thisline" $done);
|
progress_message qq( Rule "$thisline" $done);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub intrazone_allowed( $$ ) {
|
||||||
|
my ( $zone, $zoneref ) = @_;
|
||||||
|
|
||||||
|
$zoneref->{complex} && $filter_table->{rules_chain( $zone, $zone )}{policy} ne 'NONE';
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Add jumps to the blacklst and blackout chains
|
# Add jumps to the blacklst and blackout chains
|
||||||
#
|
#
|
||||||
@@ -2470,7 +2476,7 @@ sub classic_blacklist() {
|
|||||||
|
|
||||||
for my $zone ( @zones ) {
|
for my $zone ( @zones ) {
|
||||||
my $zoneref = find_zone( $zone );
|
my $zoneref = find_zone( $zone );
|
||||||
my $simple = @zones <= 2 && ! $zoneref->{options}{complex};
|
my $simple = @zones <= 2 && ! $zoneref->{complex};
|
||||||
|
|
||||||
if ( $zoneref->{options}{in}{blacklist} ) {
|
if ( $zoneref->{options}{in}{blacklist} ) {
|
||||||
my $blackref = $filter_table->{blacklst};
|
my $blackref = $filter_table->{blacklst};
|
||||||
@@ -2484,7 +2490,7 @@ sub classic_blacklist() {
|
|||||||
my $ruleschain = rules_chain( $zone, $zone1 );
|
my $ruleschain = rules_chain( $zone, $zone1 );
|
||||||
my $ruleschainref = $filter_table->{$ruleschain};
|
my $ruleschainref = $filter_table->{$ruleschain};
|
||||||
|
|
||||||
if ( ( $zone ne $zone1 || $ruleschainref->{referenced} ) && $ruleschainref->{policy} ne 'NONE' ) {
|
if ( $zone ne $zone1 || intrazone_allowed( $zone, $zoneref ) ) {
|
||||||
add_ijump( ensure_rules_chain( $ruleschain ), j => $blackref, @state );
|
add_ijump( ensure_rules_chain( $ruleschain ), j => $blackref, @state );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2501,7 +2507,7 @@ sub classic_blacklist() {
|
|||||||
my $ruleschain = rules_chain( $zone1, $zone );
|
my $ruleschain = rules_chain( $zone1, $zone );
|
||||||
my $ruleschainref = $filter_table->{$ruleschain};
|
my $ruleschainref = $filter_table->{$ruleschain};
|
||||||
|
|
||||||
if ( ( $zone ne $zone1 || $ruleschainref->{referenced} ) && $ruleschainref->{policy} ne 'NONE' ) {
|
if ( ( $zone ne $zone1 || intrazone_allowed( $zone, $zoneref ) ) ) {
|
||||||
add_ijump( ensure_rules_chain( $ruleschain ), j => $blackref, @state );
|
add_ijump( ensure_rules_chain( $ruleschain ), j => $blackref, @state );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2568,6 +2574,11 @@ sub process_rules( $ ) {
|
|||||||
|
|
||||||
add_interface_options( $blrules );
|
add_interface_options( $blrules );
|
||||||
|
|
||||||
|
#
|
||||||
|
# Handle MSS settings in the zones file
|
||||||
|
#
|
||||||
|
setup_zone_mss;
|
||||||
|
|
||||||
$fn = open_file 'rules';
|
$fn = open_file 'rules';
|
||||||
|
|
||||||
if ( $fn ) {
|
if ( $fn ) {
|
||||||
|
@@ -194,14 +194,14 @@ sub initialize( $ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub process_tc_rule( ) {
|
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 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
( $originalmark, $source, $dest, $proto, $ports, $sports, $user, $testval, $length, $tos , $connbytes, $helper, $probability ) =
|
( $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 };
|
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 = '-';
|
$headers = '-';
|
||||||
} else {
|
} else {
|
||||||
( $originalmark, $source, $dest, $proto, $ports, $sports, $user, $testval, $length, $tos , $connbytes, $helper, $headers, $probability ) =
|
( $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 };
|
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;
|
our @tccmd;
|
||||||
@@ -239,6 +239,157 @@ sub process_tc_rule( ) {
|
|||||||
my $device = '';
|
my $device = '';
|
||||||
my $fw = firewall_zone;
|
my $fw = firewall_zone;
|
||||||
my $list;
|
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 ) {
|
||||||
if ( $source eq $fw ) {
|
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 = '';
|
$list = '';
|
||||||
|
|
||||||
my $restriction = 0;
|
|
||||||
|
|
||||||
unless ( $classid ) {
|
unless ( $classid ) {
|
||||||
MARK:
|
MARK:
|
||||||
{
|
{
|
||||||
@@ -336,134 +490,8 @@ sub process_tc_rule( ) {
|
|||||||
$mark =~ s/^[|&]//;
|
$mark =~ s/^[|&]//;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $target eq 'sticky' ) {
|
if ( my $f = $processtcc{$target} ) {
|
||||||
if ( $chain eq 'tcout' ) {
|
$f->();
|
||||||
$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 ( $rest ) {
|
if ( $rest ) {
|
||||||
@@ -510,7 +538,8 @@ sub process_tc_rule( ) {
|
|||||||
do_connbytes( $connbytes ) .
|
do_connbytes( $connbytes ) .
|
||||||
do_helper( $helper ) .
|
do_helper( $helper ) .
|
||||||
do_headers( $headers ) .
|
do_headers( $headers ) .
|
||||||
do_probability( $probability ) ,
|
do_probability( $probability ) .
|
||||||
|
do_dscp( $dscp ),
|
||||||
$source ,
|
$source ,
|
||||||
$dest ,
|
$dest ,
|
||||||
'' ,
|
'' ,
|
||||||
@@ -855,7 +884,7 @@ sub validate_tc_device( ) {
|
|||||||
pfifo => $pfifo,
|
pfifo => $pfifo,
|
||||||
tablenumber => 1 ,
|
tablenumber => 1 ,
|
||||||
redirected => \@redirected,
|
redirected => \@redirected,
|
||||||
default => 0,
|
default => undef,
|
||||||
nextclass => 2,
|
nextclass => 2,
|
||||||
qdisc => $qdisc,
|
qdisc => $qdisc,
|
||||||
guarantee => 0,
|
guarantee => 0,
|
||||||
@@ -998,6 +1027,7 @@ sub validate_tc_class( ) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fatal_error "Duplicate Class NUMBER ($classnumber)" if $tcref->{$classnumber};
|
fatal_error "Duplicate Class NUMBER ($classnumber)" if $tcref->{$classnumber};
|
||||||
|
$markval = '-';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $parentclass != 1 ) {
|
if ( $parentclass != 1 ) {
|
||||||
@@ -1114,8 +1144,10 @@ sub validate_tc_class( ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
unless ( $devref->{classify} || $occurs > 1 ) {
|
unless ( $devref->{classify} || $occurs > 1 ) {
|
||||||
fatal_error "Missing MARK" if $mark eq '-';
|
if ( $mark ne '-' ) {
|
||||||
warning_message "Class NUMBER ignored -- INTERFACE $device does not have the 'classify' option" if $devclass =~ /:/;
|
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};
|
$tcref->{flow} = $devref->{flow} unless $tcref->{flow};
|
||||||
@@ -1596,7 +1628,7 @@ sub process_traffic_shaping() {
|
|||||||
my $devnum = in_hexp $devref->{number};
|
my $devnum = in_hexp $devref->{number};
|
||||||
my $r2q = int calculate_r2q $devref->{out_bandwidth};
|
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;
|
my $device = physical_name $devname;
|
||||||
|
|
||||||
@@ -1708,7 +1740,7 @@ sub process_traffic_shaping() {
|
|||||||
#
|
#
|
||||||
# add filters
|
# 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;
|
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 => '',
|
mask => '',
|
||||||
connmark => 0
|
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' ) {
|
if ( my $fn = open_file 'tcrules' ) {
|
||||||
|
@@ -83,6 +83,7 @@ our @EXPORT = qw( NOTHING
|
|||||||
compile_updown
|
compile_updown
|
||||||
validate_hosts_file
|
validate_hosts_file
|
||||||
find_hosts_by_option
|
find_hosts_by_option
|
||||||
|
find_zone_hosts_by_option
|
||||||
find_zones_by_option
|
find_zones_by_option
|
||||||
all_ipsets
|
all_ipsets
|
||||||
have_ipsec
|
have_ipsec
|
||||||
@@ -113,11 +114,10 @@ use constant { IN_OUT => 1,
|
|||||||
#
|
#
|
||||||
# @zones contains the ordered list of zones with sub-zones appearing before their parents.
|
# @zones contains the ordered list of zones with sub-zones appearing before their parents.
|
||||||
#
|
#
|
||||||
# %zones{<zone1> => {type = > <zone type> FIREWALL, IP, IPSEC, BPORT;
|
# %zones{<zone1> => {type => <zone type> FIREWALL, IP, IPSEC, BPORT;
|
||||||
# options => { complex => 0|1
|
# complex => 0|1
|
||||||
# nested => 0|1
|
# super => 0|1
|
||||||
# super => 0|1
|
# options => { in_out => < policy match string >
|
||||||
# in_out => < policy match string >
|
|
||||||
# in => < policy match string >
|
# in => < policy match string >
|
||||||
# out => < policy match string >
|
# out => < policy match string >
|
||||||
# }
|
# }
|
||||||
@@ -227,6 +227,25 @@ my %maxoptionvalue = ( routefilter => 2, mss => 100000 , wait => 120 );
|
|||||||
|
|
||||||
my %validhostoptions;
|
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,
|
# Rather than initializing globals in an INIT block or during declaration,
|
||||||
# we initialize them in a function. This is done for two reasons:
|
# we initialize them in a function. This is done for two reasons:
|
||||||
@@ -290,6 +309,7 @@ sub initialize( $$ ) {
|
|||||||
broadcast => 1,
|
broadcast => 1,
|
||||||
destonly => 1,
|
destonly => 1,
|
||||||
sourceonly => 1,
|
sourceonly => 1,
|
||||||
|
mss => 1,
|
||||||
);
|
);
|
||||||
%zonetypes = ( 1 => 'firewall', 2 => 'ipv4', 4 => 'bport4', 8 => 'ipsec4', 16 => 'vserver' );
|
%zonetypes = ( 1 => 'firewall', 2 => 'ipv4', 4 => 'bport4', 8 => 'ipsec4', 16 => 'vserver' );
|
||||||
} else {
|
} else {
|
||||||
@@ -316,6 +336,7 @@ sub initialize( $$ ) {
|
|||||||
maclist => 1,
|
maclist => 1,
|
||||||
routeback => 1,
|
routeback => 1,
|
||||||
tcpflags => 1,
|
tcpflags => 1,
|
||||||
|
mss => 1,
|
||||||
);
|
);
|
||||||
%zonetypes = ( 1 => 'firewall', 2 => 'ipv6', 4 => 'bport6', 8 => 'ipsec4', 16 => 'vserver' );
|
%zonetypes = ( 1 => 'firewall', 2 => 'ipv6', 4 => 'bport6', 8 => 'ipsec4', 16 => 'vserver' );
|
||||||
}
|
}
|
||||||
@@ -329,25 +350,6 @@ sub initialize( $$ ) {
|
|||||||
#
|
#
|
||||||
sub parse_zone_option_list($$\$$)
|
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 ( $list, $zonetype, $complexref, $column ) = @_;
|
||||||
my %h;
|
my %h;
|
||||||
my $options = '';
|
my $options = '';
|
||||||
@@ -367,7 +369,7 @@ sub parse_zone_option_list($$\$$)
|
|||||||
$e = $1;
|
$e = $1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$fmt = $validoptions{$e};
|
$fmt = $validzoneoptions{$e};
|
||||||
|
|
||||||
fatal_error "Invalid Option ($e)" unless $fmt;
|
fatal_error "Invalid Option ($e)" unless $fmt;
|
||||||
|
|
||||||
@@ -378,7 +380,7 @@ sub parse_zone_option_list($$\$$)
|
|||||||
fatal_error "Invalid value ($val) for option \"$e\"" unless $val =~ /^($fmt)$/;
|
fatal_error "Invalid value ($val) for option \"$e\"" unless $val =~ /^($fmt)$/;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $key = $key{$e};
|
my $key = $zonekey{$e};
|
||||||
|
|
||||||
if ( $key ) {
|
if ( $key ) {
|
||||||
fatal_error "Option '$e' not permitted with this zone type " if $key & NOFW && ($zonetype & ( FIREWALL | VSERVER) );
|
fatal_error "Option '$e' not permitted with this zone type " if $key & NOFW && ($zonetype & ( FIREWALL | VSERVER) );
|
||||||
@@ -403,13 +405,13 @@ sub parse_zone_option_list($$\$$)
|
|||||||
#
|
#
|
||||||
# Set the super option on the passed zoneref and propagate to its parents
|
# 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( $ ) {
|
sub set_super( $ ) {
|
||||||
my $zoneref = shift;
|
my $zoneref = shift;
|
||||||
|
|
||||||
unless ( $zoneref->{options}{super} ) {
|
unless ( $zoneref->{super} ) {
|
||||||
$zoneref->{options}{super} = 1;
|
$zoneref->{super} = 1;
|
||||||
set_super( $zones{$_} ) for @{$zoneref->{parents}};
|
set_super( $zones{$_} ) for @{$zoneref->{parents}};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -487,10 +489,9 @@ sub process_zone( \$ ) {
|
|||||||
options => { in_out => parse_zone_option_list( $options , $type, $complex , IN_OUT ) ,
|
options => { in_out => parse_zone_option_list( $options , $type, $complex , IN_OUT ) ,
|
||||||
in => parse_zone_option_list( $in_options , $type , $complex , IN ) ,
|
in => parse_zone_option_list( $in_options , $type , $complex , IN ) ,
|
||||||
out => parse_zone_option_list( $out_options , $type , $complex , OUT ) ,
|
out => parse_zone_option_list( $out_options , $type , $complex , OUT ) ,
|
||||||
complex => ( $type & IPSEC || $complex ) ,
|
|
||||||
nested => @parents > 0 ,
|
|
||||||
super => 0 ,
|
|
||||||
} ,
|
} ,
|
||||||
|
super => 0 ,
|
||||||
|
complex => ( $type & IPSEC || $complex ) ,
|
||||||
interfaces => {} ,
|
interfaces => {} ,
|
||||||
children => [] ,
|
children => [] ,
|
||||||
hosts => {}
|
hosts => {}
|
||||||
@@ -506,7 +507,7 @@ sub process_zone( \$ ) {
|
|||||||
fatal_error "Zone mark overflow - please increase the setting of ZONE_BITS" if $zonemark >= $zonemarklimit;
|
fatal_error "Zone mark overflow - please increase the setting of ZONE_BITS" if $zonemark >= $zonemarklimit;
|
||||||
$mark = $zonemark;
|
$mark = $zonemark;
|
||||||
$zonemark += $zonemarkincr;
|
$zonemark += $zonemarkincr;
|
||||||
$zoneref->{options}{complex} = 1;
|
$zoneref->{complex} = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -517,7 +518,6 @@ sub process_zone( \$ ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( $zoneref->{options}{in_out}{blacklist} ) {
|
if ( $zoneref->{options}{in_out}{blacklist} ) {
|
||||||
for ( qw/in out/ ) {
|
for ( qw/in out/ ) {
|
||||||
unless ( $zoneref->{options}{$_}{blacklist} ) {
|
unless ( $zoneref->{options}{$_}{blacklist} ) {
|
||||||
@@ -769,13 +769,13 @@ sub add_group_to_zone($$$$$)
|
|||||||
|
|
||||||
my $gtype = $type & IPSEC ? 'ipsec' : 'ip';
|
my $gtype = $type & IPSEC ? 'ipsec' : 'ip';
|
||||||
|
|
||||||
$hostsref = ( $zoneref->{hosts} || ( $zoneref->{hosts} = {} ) );
|
$hostsref = ( $zoneref->{hosts} ||= {} );
|
||||||
$typeref = ( $hostsref->{$gtype} || ( $hostsref->{$gtype} = {} ) );
|
$typeref = ( $hostsref->{$gtype} ||= {} );
|
||||||
$interfaceref = ( $typeref->{$interface} || ( $typeref->{$interface} = [] ) );
|
$interfaceref = ( $typeref->{$interface} ||= [] );
|
||||||
|
|
||||||
fatal_error "Duplicate Host Group ($interface:" . ALLIP . ") in zone $zone" if $allip && @$interfaceref;
|
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->{complex} = 1 if @$interfaceref || @newnetworks > 1 || @exclusions || $options->{routeback};
|
||||||
|
|
||||||
push @{$interfaceref}, { options => $options,
|
push @{$interfaceref}, { options => $options,
|
||||||
hosts => \@newnetworks,
|
hosts => \@newnetworks,
|
||||||
@@ -838,7 +838,7 @@ sub all_parent_zones() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub complex_zones() {
|
sub complex_zones() {
|
||||||
grep( $zones{$_}{options}{complex} , @zones );
|
grep( $zones{$_}{complex} , @zones );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub vserver_zones() {
|
sub vserver_zones() {
|
||||||
@@ -912,9 +912,26 @@ sub process_interface( $$ ) {
|
|||||||
my ( $nextinum, $export ) = @_;
|
my ( $nextinum, $export ) = @_;
|
||||||
my $netsref = '';
|
my $netsref = '';
|
||||||
my $filterref = [];
|
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 $zoneref;
|
||||||
my $bridge = '';
|
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 '-' ) {
|
if ( $zone eq '-' ) {
|
||||||
$zone = '';
|
$zone = '';
|
||||||
@@ -1185,7 +1202,8 @@ sub process_interface( $$ ) {
|
|||||||
# Parse the interfaces file.
|
# Parse the interfaces file.
|
||||||
#
|
#
|
||||||
sub validate_interfaces_file( $ ) {
|
sub validate_interfaces_file( $ ) {
|
||||||
my $export = shift;
|
my $export = shift;
|
||||||
|
our $format = 1;
|
||||||
|
|
||||||
my @ifaces;
|
my @ifaces;
|
||||||
my $nextinum = 1;
|
my $nextinum = 1;
|
||||||
@@ -1820,7 +1838,7 @@ sub process_host( ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $hosts =~ /^!?\+/ ) {
|
if ( $hosts =~ /^!?\+/ ) {
|
||||||
$zoneref->{options}{complex} = 1;
|
$zoneref->{complex} = 1;
|
||||||
fatal_error "ipset name qualification is disallowed in this file" if $hosts =~ /[\[\]]/;
|
fatal_error "ipset name qualification is disallowed in this file" if $hosts =~ /[\[\]]/;
|
||||||
fatal_error "Invalid ipset name ($hosts)" unless $hosts =~ /^!?\+[a-zA-Z][-\w]*$/;
|
fatal_error "Invalid ipset name ($hosts)" unless $hosts =~ /^!?\+[a-zA-Z][-\w]*$/;
|
||||||
}
|
}
|
||||||
@@ -1844,12 +1862,16 @@ sub process_host( ) {
|
|||||||
if ( $option eq 'ipsec' ) {
|
if ( $option eq 'ipsec' ) {
|
||||||
require_capability 'POLICY_MATCH' , q(The 'ipsec' option), 's';
|
require_capability 'POLICY_MATCH' , q(The 'ipsec' option), 's';
|
||||||
$type = IPSEC;
|
$type = IPSEC;
|
||||||
$zoneref->{options}{complex} = 1;
|
$zoneref->{complex} = 1;
|
||||||
$ipsec = $interfaceref->{ipsec} = 1;
|
$ipsec = $interfaceref->{ipsec} = 1;
|
||||||
} elsif ( $option eq 'norfc1918' ) {
|
} elsif ( $option eq 'norfc1918' ) {
|
||||||
warning_message "The 'norfc1918' host option is no longer supported"
|
warning_message "The 'norfc1918' host option is no longer supported"
|
||||||
} elsif ( $option eq 'blacklist' ) {
|
} elsif ( $option eq 'blacklist' ) {
|
||||||
$zoneref->{options}{in}{blacklist} = 1;
|
$zoneref->{options}{in}{blacklist} = 1;
|
||||||
|
} elsif ( $option =~ /^mss=(\d+)$/ ) {
|
||||||
|
fatal_error "Invalid mss ($1)" unless $1 >= 500;
|
||||||
|
$options{mss} = $1;
|
||||||
|
$zoneref->{options}{complex} = 1;
|
||||||
} elsif ( $validhostoptions{$option}) {
|
} elsif ( $validhostoptions{$option}) {
|
||||||
fatal_error qq(The "$option" option is not allowed with Vserver zones) if $type & VSERVER && ! ( $validhostoptions{$option} & IF_OPTION_VSERVER );
|
fatal_error qq(The "$option" option is not allowed with Vserver zones) if $type & VSERVER && ! ( $validhostoptions{$option} & IF_OPTION_VSERVER );
|
||||||
$options{$option} = 1;
|
$options{$option} = 1;
|
||||||
@@ -1914,8 +1936,7 @@ sub validate_hosts_file()
|
|||||||
|
|
||||||
$have_ipsec = $ipsec || haveipseczones;
|
$have_ipsec = $ipsec || haveipseczones;
|
||||||
|
|
||||||
$_->{options}{complex} ||= ( keys %{$_->{interfaces}} > 1 ) for values %zones;
|
$_->{complex} ||= ( keys %{$_->{interfaces}} > 1 ) for values %zones;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -1927,7 +1948,7 @@ sub have_ipsec() {
|
|||||||
|
|
||||||
#
|
#
|
||||||
# Returns a reference to a array of host entries. Each entry is a
|
# Returns a reference to a array of host entries. Each entry is a
|
||||||
# reference to an array containing ( interface , polciy match type {ipsec|none} , network , exclusions );
|
# reference to an array containing ( interface , polciy match type {ipsec|none} , network , exclusions, value );
|
||||||
#
|
#
|
||||||
sub find_hosts_by_option( $ ) {
|
sub find_hosts_by_option( $ ) {
|
||||||
my $option = $_[0];
|
my $option = $_[0];
|
||||||
@@ -1937,9 +1958,9 @@ sub find_hosts_by_option( $ ) {
|
|||||||
while ( my ($type, $interfaceref) = each %{$zones{$zone}{hosts}} ) {
|
while ( my ($type, $interfaceref) = each %{$zones{$zone}{hosts}} ) {
|
||||||
while ( my ( $interface, $arrayref) = ( each %{$interfaceref} ) ) {
|
while ( my ( $interface, $arrayref) = ( each %{$interfaceref} ) ) {
|
||||||
for my $host ( @{$arrayref} ) {
|
for my $host ( @{$arrayref} ) {
|
||||||
if ( $host->{options}{$option} ) {
|
if ( my $value = $host->{options}{$option} ) {
|
||||||
for my $net ( @{$host->{hosts}} ) {
|
for my $net ( @{$host->{hosts}} ) {
|
||||||
push @hosts, [ $interface, $host->{ipsec} , $net , $host->{exclusions}];
|
push @hosts, [ $interface, $host->{ipsec} , $net , $host->{exclusions}, $value ];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1956,6 +1977,30 @@ sub find_hosts_by_option( $ ) {
|
|||||||
\@hosts;
|
\@hosts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# As above but for a single zone
|
||||||
|
#
|
||||||
|
sub find_zone_hosts_by_option( $$ ) {
|
||||||
|
my ($zone, $option ) = @_;
|
||||||
|
my @hosts;
|
||||||
|
|
||||||
|
unless ( $zones{$zone}{type} & FIREWALL ) {
|
||||||
|
while ( my ($type, $interfaceref) = each %{$zones{$zone}{hosts}} ) {
|
||||||
|
while ( my ( $interface, $arrayref) = ( each %{$interfaceref} ) ) {
|
||||||
|
for my $host ( @{$arrayref} ) {
|
||||||
|
if ( my $value = $host->{options}{$option} ) {
|
||||||
|
for my $net ( @{$host->{hosts}} ) {
|
||||||
|
push @hosts, [ $interface, $host->{ipsec} , $net , $host->{exclusions}, $value ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
\@hosts;
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Returns a reference to a list of zones with the passed in/out option
|
# Returns a reference to a list of zones with the passed in/out option
|
||||||
#
|
#
|
||||||
|
@@ -62,12 +62,14 @@ checkkernelversion() {
|
|||||||
#
|
#
|
||||||
# Start trace if first arg is "debug" or "trace"
|
# Start trace if first arg is "debug" or "trace"
|
||||||
#
|
#
|
||||||
|
g_debug_iptables=
|
||||||
|
|
||||||
if [ $# -gt 1 ]; then
|
if [ $# -gt 1 ]; then
|
||||||
if [ "x$1" = "xtrace" ]; then
|
if [ "x$1" = "xtrace" ]; then
|
||||||
set -x
|
set -x
|
||||||
shift
|
shift
|
||||||
elif [ "x$1" = "xdebug" ]; then
|
elif [ "x$1" = "xdebug" ]; then
|
||||||
DEBUG=Yes
|
g_debug_iptables=Yes
|
||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@@ -138,6 +138,8 @@ FORWARD_CLEAR_MARK=
|
|||||||
|
|
||||||
IMPLICIT_CONTINUE=No
|
IMPLICIT_CONTINUE=No
|
||||||
|
|
||||||
|
IPSET_WARNINGS=Yes
|
||||||
|
|
||||||
IP_FORWARDING=On
|
IP_FORWARDING=On
|
||||||
|
|
||||||
KEEP_RT_TABLES=No
|
KEEP_RT_TABLES=No
|
||||||
|
@@ -149,6 +149,8 @@ FORWARD_CLEAR_MARK=
|
|||||||
|
|
||||||
IMPLICIT_CONTINUE=No
|
IMPLICIT_CONTINUE=No
|
||||||
|
|
||||||
|
IPSET_WARNINGS=Yes
|
||||||
|
|
||||||
IP_FORWARDING=Off
|
IP_FORWARDING=Off
|
||||||
|
|
||||||
KEEP_RT_TABLES=No
|
KEEP_RT_TABLES=No
|
||||||
|
@@ -147,6 +147,8 @@ FORWARD_CLEAR_MARK=
|
|||||||
|
|
||||||
IMPLICIT_CONTINUE=No
|
IMPLICIT_CONTINUE=No
|
||||||
|
|
||||||
|
IPSET_WARNINGS=Yes
|
||||||
|
|
||||||
IP_FORWARDING=On
|
IP_FORWARDING=On
|
||||||
|
|
||||||
KEEP_RT_TABLES=No
|
KEEP_RT_TABLES=No
|
||||||
|
@@ -150,6 +150,8 @@ FORWARD_CLEAR_MARK=
|
|||||||
|
|
||||||
IMPLICIT_CONTINUE=No
|
IMPLICIT_CONTINUE=No
|
||||||
|
|
||||||
|
IPSET_WARNINGS=Yes
|
||||||
|
|
||||||
IP_FORWARDING=On
|
IP_FORWARDING=On
|
||||||
|
|
||||||
KEEP_RT_TABLES=No
|
KEEP_RT_TABLES=No
|
||||||
|
@@ -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 '';
|
log_rule_limit $level, $chainref, 'Invalid' , $action, '', $tag, 'add', "$globals{STATEMATCH} INVALID " if $level ne '';
|
||||||
add_jump $chainref , $target, 0, "$globals{STATEMATCH} INVALID ";
|
add_jump $chainref , $target, 0, "$globals{STATEMATCH} INVALID ";
|
||||||
|
|
||||||
$chainref->{dont_optimize} = 0;
|
allow_optimize( $chainref );
|
||||||
|
|
||||||
1;
|
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 '';
|
log_rule_limit $level, $chainref, 'NotSyn' , $action, '', $tag, 'add', '-p 6 ! --syn ' if $level ne '';
|
||||||
add_jump $chainref , $target, 0, '-p 6 ! --syn ';
|
add_jump $chainref , $target, 0, '-p 6 ! --syn ';
|
||||||
|
|
||||||
$chainref->{dont_optimize} = 0;
|
allow_optimize( $chainref );
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
|
@@ -7,4 +7,8 @@
|
|||||||
# http://www.shorewall.net/manpages/shorewall-interfaces.html
|
# http://www.shorewall.net/manpages/shorewall-interfaces.html
|
||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
FORMAT 1
|
||||||
#ZONE INTERFACE BROADCAST OPTIONS
|
#ZONE INTERFACE BROADCAST OPTIONS
|
||||||
|
|
||||||
|
FORMAT 2
|
||||||
|
#ZONE INTERFACE OPTIONS
|
||||||
|
@@ -6,6 +6,6 @@
|
|||||||
# The manpage is also online at
|
# The manpage is also online at
|
||||||
# http://www.shorewall.net/manpages/shorewall-masq.html
|
# 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
|
# GROUP
|
||||||
|
@@ -138,6 +138,8 @@ FORWARD_CLEAR_MARK=
|
|||||||
|
|
||||||
IMPLICIT_CONTINUE=No
|
IMPLICIT_CONTINUE=No
|
||||||
|
|
||||||
|
IPSET_WARNINGS=Yes
|
||||||
|
|
||||||
IP_FORWARDING=On
|
IP_FORWARDING=On
|
||||||
|
|
||||||
KEEP_RT_TABLES=No
|
KEEP_RT_TABLES=No
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
#
|
#
|
||||||
# See http://shorewall.net/PacketMarking.html for a detailed description of
|
# See http://shorewall.net/PacketMarking.html for a detailed description of
|
||||||
# the Netfilter/Shorewall packet marking mechanism.
|
# the Netfilter/Shorewall packet marking mechanism.
|
||||||
######################################################################################################################################
|
##########################################################################################################################################
|
||||||
#MARK SOURCE DEST PROTO DEST SOURCE USER TEST LENGTH TOS CONNBYTES HELPER PROBABILITY
|
#ACTION SOURCE DEST PROTO DEST SOURCE USER TEST LENGTH TOS CONNBYTES HELPER PROBABILITY DSCP
|
||||||
# PORT(S) PORT(S)
|
# PORT(S) PORT(S)
|
||||||
|
|
||||||
|
@@ -4,5 +4,5 @@
|
|||||||
# For information about entries in this file, type "man shorewall-tos"
|
# 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
|
# PORTS PORTS
|
||||||
|
@@ -78,13 +78,13 @@ shift
|
|||||||
|
|
||||||
case "$command" in
|
case "$command" in
|
||||||
start)
|
start)
|
||||||
exec /sbin/shorewall $OPTIONS start $STARTOPTIONS $@
|
exec /sbin/shorewall $OPTIONS start $STARTOPTIONS
|
||||||
;;
|
;;
|
||||||
restart|reload)
|
restart|reload)
|
||||||
exec /sbin/shorewall $OPTIONS restart $RESTARTOPTIONS $@
|
exec /sbin/shorewall $OPTIONS restart $RESTARTOPTIONS
|
||||||
;;
|
;;
|
||||||
status|stop)
|
status|stop)
|
||||||
exec /sbin/shorewall $OPTIONS $command $@
|
exec /sbin/shorewall $OPTIONS $command
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
usage
|
usage
|
||||||
|
@@ -92,6 +92,11 @@ install_file() # $1 = source $2 = target $3 = mode
|
|||||||
|
|
||||||
cd "$(dirname $0)"
|
cd "$(dirname $0)"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Load packager's settings if any
|
||||||
|
#
|
||||||
|
[ -f ../shorewall-pkg.config ] && . ../shorewall-pkg.config
|
||||||
|
|
||||||
if [ -f shorewall ]; then
|
if [ -f shorewall ]; then
|
||||||
PRODUCT=shorewall
|
PRODUCT=shorewall
|
||||||
Product=Shorewall
|
Product=Shorewall
|
||||||
@@ -105,26 +110,15 @@ fi
|
|||||||
#
|
#
|
||||||
# Parse the run line
|
# Parse the run line
|
||||||
#
|
#
|
||||||
# DEST is the SysVInit script directory
|
|
||||||
# INIT is the name of the script in the $DEST directory
|
|
||||||
#
|
#
|
||||||
T="-T"
|
T="-T"
|
||||||
|
|
||||||
if [ -z "$DEST" ] ; then
|
|
||||||
DEST="/etc/init.d"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$INIT" ] ; then
|
|
||||||
INIT="$PRODUCT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
ANNOTATED=
|
ANNOTATED=
|
||||||
CYGWIN=
|
|
||||||
MAC=
|
|
||||||
MACHOST=
|
|
||||||
MANDIR=${MANDIR:-"/usr/share/man"}
|
MANDIR=${MANDIR:-"/usr/share/man"}
|
||||||
SPARSE=
|
SPARSE=
|
||||||
INSTALLD='-D'
|
INSTALLD='-D'
|
||||||
|
INITFILE="$PRODUCT"
|
||||||
|
|
||||||
[ -n "${LIBEXEC:=/usr/share}" ]
|
[ -n "${LIBEXEC:=/usr/share}" ]
|
||||||
[ -n "${PERLLIB:=/usr/share/shorewall}" ]
|
[ -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
|
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
|
esac
|
||||||
|
|
||||||
case $(uname) in
|
if [ -z "$BUILD" ]; then
|
||||||
CYGWIN*)
|
case $(uname) in
|
||||||
if [ -z "$DESTDIR" ]; then
|
cygwin*)
|
||||||
DEST=
|
BUILD=cygwin
|
||||||
INIT=
|
;;
|
||||||
fi
|
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)
|
OWNER=$(id -un)
|
||||||
GROUP=$(id -gn)
|
GROUP=$(id -gn)
|
||||||
CYGWIN=Yes
|
|
||||||
SPARSE=Yes
|
|
||||||
;;
|
;;
|
||||||
Darwin)
|
apple)
|
||||||
if [ -z "$DESTDIR" ]; then
|
|
||||||
DEST=
|
|
||||||
INIT=
|
|
||||||
SPARSE=Yes
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -z "$OWNER" ] && OWNER=root
|
[ -z "$OWNER" ] && OWNER=root
|
||||||
[ -z "$GROUP" ] && GROUP=wheel
|
[ -z "$GROUP" ] && GROUP=wheel
|
||||||
MAC=Yes
|
|
||||||
MACHOST=Yes
|
|
||||||
INSTALLD=
|
INSTALLD=
|
||||||
T=
|
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
|
# 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 [ -n "$DESTDIR" ]; then
|
||||||
if [ -z "$CYGWIN" ]; then
|
if [ $BUILD != cygwin ]; then
|
||||||
if [ `id -u` != 0 ] ; then
|
if [ `id -u` != 0 ] ; then
|
||||||
echo "Not setting file owner/group permissions, not running as root."
|
echo "Not setting file owner/group permissions, not running as root."
|
||||||
OWNERSHIP=""
|
OWNERSHIP=""
|
||||||
@@ -238,58 +301,20 @@ if [ -n "$DESTDIR" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
|
install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
|
||||||
install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
|
install -d $OWNERSHIP -m 755 ${DESTDIR}${INITDIR}
|
||||||
|
elif [ $PRODUCT != shorewall ]; then
|
||||||
CYGWIN=
|
[ -x ${LIBEXEC}/shorewall/compiler.pl ] || \
|
||||||
MAC=
|
{ echo " ERROR: Shorewall >= 4.5.0 is not installed" >&2; exit 1; }
|
||||||
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
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$DESTDIR" ]; then
|
if [ -z "$DESTDIR" ]; then
|
||||||
if [ -f /lib/systemd/system ]; then
|
if [ -f /lib/systemd/system ]; then
|
||||||
SYSTEMD=Yes
|
SYSTEMD=Yes
|
||||||
|
INITFILE=
|
||||||
fi
|
fi
|
||||||
elif [ -n "$SYSTEMD" ]; then
|
elif [ -n "$SYSTEMD" ]; then
|
||||||
mkdir -p ${DESTDIR}/lib/systemd/system
|
mkdir -p ${DESTDIR}/lib/systemd/system
|
||||||
|
INITFILE=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing $Product Version $VERSION"
|
echo "Installing $Product Version $VERSION"
|
||||||
@@ -308,7 +333,7 @@ if [ -z "${DESTDIR}" -a $PRODUCT = shorewall -a ! -f /usr/share/$PRODUCT/corever
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$CYGWIN" ]; then
|
if [ $HOST != cygwin ]; then
|
||||||
install_file $PRODUCT ${DESTDIR}/sbin/$PRODUCT 0755
|
install_file $PRODUCT ${DESTDIR}/sbin/$PRODUCT 0755
|
||||||
echo "$PRODUCT control program installed in ${DESTDIR}/sbin/$PRODUCT"
|
echo "$PRODUCT control program installed in ${DESTDIR}/sbin/$PRODUCT"
|
||||||
else
|
else
|
||||||
@@ -319,20 +344,27 @@ fi
|
|||||||
#
|
#
|
||||||
# Install the Firewall Script
|
# Install the Firewall Script
|
||||||
#
|
#
|
||||||
if [ -n "$DEBIAN" ]; then
|
if [ -n "$INITFILE" ]; then
|
||||||
install_file init.debian.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544
|
case $HOST in
|
||||||
elif [ -n "$FEDORA" ]; then
|
debian)
|
||||||
install_file init.fedora.sh ${DESTDIR}/etc/init.d/$PRODUCT 0544
|
install_file init.debian.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
||||||
elif [ -n "$ARCHLINUX" ]; then
|
;;
|
||||||
install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544
|
redhat)
|
||||||
elif [ -n "$SLACKWARE" -a $PRODUCT = shorewall ]; then
|
install_file init.fedora.sh ${DESTDIR}${INITDIR}/${INITFILE} 0544
|
||||||
install_file init.slackware.firewall.sh ${DESTDIR}${DEST}/rc.firewall 0644
|
;;
|
||||||
install_file init.slackware.$PRODUCT.sh ${DESTDIR}${DEST}/rc.$PRODUCT 0644
|
slackware)
|
||||||
elif [ -n "$INIT" ]; then
|
if [ $PRODUCT = shorewall ]; then
|
||||||
install_file init.sh ${DESTDIR}${DEST}/$INIT 0544
|
install_file init.slackware.firewall.sh ${DESTDIR}${DEST}/rc.firewall 0644
|
||||||
fi
|
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
|
# Create /etc/$PRODUCT and /var/lib/$PRODUCT if needed
|
||||||
@@ -427,7 +459,7 @@ run_install $OWNERSHIP -m 0644 $PRODUCT.conf.annotated ${DESTDIR}/usr/share/$PRO
|
|||||||
if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
|
if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
|
||||||
run_install $OWNERSHIP -m 0644 $PRODUCT.conf${suffix} ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
|
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
|
# Make a Debian-like $PRODUCT.conf
|
||||||
#
|
#
|
||||||
@@ -438,7 +470,7 @@ if [ ! -f ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf ]; then
|
|||||||
fi
|
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
|
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/$PRODUCT/$PRODUCT.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -582,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
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/$PRODUCT/maclist ]; then
|
||||||
run_install $OWNERSHIP -m 0600 maclist${suffix} ${DESTDIR}/etc/$PRODUCT/maclist
|
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
|
fi
|
||||||
|
|
||||||
if [ -f masq ]; then
|
if [ -f masq ]; then
|
||||||
@@ -888,11 +920,6 @@ fi
|
|||||||
# Install the Isusable file
|
# Install the Isusable file
|
||||||
#
|
#
|
||||||
run_install $OWNERSHIP -m 0644 isusable ${DESTDIR}/usr/share/$PRODUCT/configfiles/isusable
|
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
|
# Install the Refresh file
|
||||||
#
|
#
|
||||||
@@ -1048,7 +1075,7 @@ chmod 644 ${DESTDIR}/usr/share/$PRODUCT/version
|
|||||||
|
|
||||||
if [ -z "$DESTDIR" ]; then
|
if [ -z "$DESTDIR" ]; then
|
||||||
rm -f /usr/share/$PRODUCT/init
|
rm -f /usr/share/$PRODUCT/init
|
||||||
ln -s ${DEST}/${INIT} /usr/share/$PRODUCT/init
|
ln -s ${INITDIR}/${INITFILE} /usr/share/$PRODUCT/init
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -1080,8 +1107,8 @@ if [ -d ${DESTDIR}/etc/logrotate.d ]; then
|
|||||||
echo "Logrotate file installed as ${DESTDIR}/etc/logrotate.d/$PRODUCT"
|
echo "Logrotate file installed as ${DESTDIR}/etc/logrotate.d/$PRODUCT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${CYGWIN}${MAC}" ]; then
|
if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then
|
||||||
if [ -n "$DEBIAN" ]; then
|
if [ $HOST = debian ]; then
|
||||||
run_install $OWNERSHIP -m 0644 default.debian /etc/default/$PRODUCT
|
run_install $OWNERSHIP -m 0644 default.debian /etc/default/$PRODUCT
|
||||||
|
|
||||||
update-rc.d $PRODUCT defaults
|
update-rc.d $PRODUCT defaults
|
||||||
@@ -1117,7 +1144,7 @@ if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${CYGWIN}${MAC}" ]; then
|
|||||||
else
|
else
|
||||||
cant_autostart
|
cant_autostart
|
||||||
fi
|
fi
|
||||||
elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically
|
elif [ "$INITFILE" != rc.f ]; then #Slackware starts this automatically
|
||||||
cant_autostart
|
cant_autostart
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@@ -239,7 +239,7 @@ get_config() {
|
|||||||
LOG_VERBOSITY=-1
|
LOG_VERBOSITY=-1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$SHOREWALL_SHELL" ]; then
|
if [ -n "$SHOREWALL_SHELL" -a -z "$g_export" ]; then
|
||||||
if [ ! -x "$SHOREWALL_SHELL" ]; then
|
if [ ! -x "$SHOREWALL_SHELL" ]; then
|
||||||
echo " WARNING: The program specified in SHOREWALL_SHELL does not exist or is not executable; falling back to /bin/sh" >&2
|
echo " WARNING: The program specified in SHOREWALL_SHELL does not exist or is not executable; falling back to /bin/sh" >&2
|
||||||
SHOREWALL_SHELL=/bin/sh
|
SHOREWALL_SHELL=/bin/sh
|
||||||
|
@@ -510,6 +510,20 @@ debug_restore_input() {
|
|||||||
qt1 $g_tool -t raw -P $chain ACCEPT
|
qt1 $g_tool -t raw -P $chain ACCEPT
|
||||||
done
|
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 -F
|
||||||
qt1 $g_tool -t filter -X
|
qt1 $g_tool -t filter -X
|
||||||
|
|
||||||
|
@@ -75,12 +75,9 @@
|
|||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>A jump to a user-defined accounting chain before entries that
|
<para>A jump to a user-defined accounting chain must appear before
|
||||||
add rules to that chain.</para>
|
entries that add rules to that chain. This eliminates loops and
|
||||||
</listitem>
|
unreferenced chains.</para>
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>This eliminates loops and unreferenced chains.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
|
@@ -118,32 +118,6 @@
|
|||||||
must have no embedded white space.</para>
|
must have no embedded white space.</para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">maclist</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Connection requests from these hosts are compared
|
|
||||||
against the contents of <ulink
|
|
||||||
url="shorewall-maclist.html">shorewall-maclist</ulink>(5). If
|
|
||||||
this option is specified, the interface must be an ethernet
|
|
||||||
NIC or equivalent and must be up before Shorewall is
|
|
||||||
started.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">routeback</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Shorewall should set up the infrastructure to pass
|
|
||||||
packets from this/these address(es) back to themselves. This
|
|
||||||
is necessary if hosts in this group use the services of a
|
|
||||||
transparent proxy that is a member of the group or if DNAT is
|
|
||||||
used to send requests originating from this group to a server
|
|
||||||
in the group.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">blacklist</emphasis></term>
|
<term><emphasis role="bold">blacklist</emphasis></term>
|
||||||
|
|
||||||
@@ -154,48 +128,6 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">tcpflags</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Packets arriving from these hosts are checked for
|
|
||||||
certain illegal combinations of TCP flags. Packets found to
|
|
||||||
have such a combination of flags are handled according to the
|
|
||||||
setting of TCP_FLAGS_DISPOSITION after having been logged
|
|
||||||
according to the setting of TCP_FLAGS_LOG_LEVEL.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">nosmurfs</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>This option only makes sense for ports on a
|
|
||||||
bridge.</para>
|
|
||||||
|
|
||||||
<para>Filter packets for smurfs (packets with a broadcast
|
|
||||||
address as the source).</para>
|
|
||||||
|
|
||||||
<para>Smurfs will be optionally logged based on the setting of
|
|
||||||
SMURF_LOG_LEVEL in <ulink
|
|
||||||
url="shorewall.conf.html">shorewall.conf</ulink>(5). After
|
|
||||||
logging, the packets are dropped.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">ipsec</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>The zone is accessed via a kernel 2.6 ipsec SA. Note
|
|
||||||
that if the zone named in the ZONE column is specified as an
|
|
||||||
IPSEC zone in the <ulink
|
|
||||||
url="shorewall-zones.html">shorewall-zones</ulink>(5) file
|
|
||||||
then you do NOT need to specify the 'ipsec' option
|
|
||||||
here.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">broadcast</emphasis></term>
|
<term><emphasis role="bold">broadcast</emphasis></term>
|
||||||
|
|
||||||
@@ -229,6 +161,86 @@
|
|||||||
net(s).</para>
|
net(s).</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><emphasis role="bold">ipsec</emphasis></term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>The zone is accessed via a kernel 2.6 ipsec SA. Note
|
||||||
|
that if the zone named in the ZONE column is specified as an
|
||||||
|
IPSEC zone in the <ulink
|
||||||
|
url="shorewall-zones.html">shorewall-zones</ulink>(5) file
|
||||||
|
then you do NOT need to specify the 'ipsec' option
|
||||||
|
here.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><emphasis role="bold">maclist</emphasis></term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Connection requests from these hosts are compared
|
||||||
|
against the contents of <ulink
|
||||||
|
url="shorewall-maclist.html">shorewall-maclist</ulink>(5). If
|
||||||
|
this option is specified, the interface must be an ethernet
|
||||||
|
NIC or equivalent and must be up before Shorewall is
|
||||||
|
started.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><emphasis
|
||||||
|
role="bold">mss</emphasis>=<replaceable>mss</replaceable></term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Added in Shorewall 4.5.2. When present, causes the TCP
|
||||||
|
mss for new connections to/from the hosts given in the HOST(S)
|
||||||
|
column to be clamped at the specified
|
||||||
|
<replaceable>mss</replaceable>.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><emphasis role="bold">nosmurfs</emphasis></term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>This option only makes sense for ports on a
|
||||||
|
bridge.</para>
|
||||||
|
|
||||||
|
<para>Filter packets for smurfs (packets with a broadcast
|
||||||
|
address as the source).</para>
|
||||||
|
|
||||||
|
<para>Smurfs will be optionally logged based on the setting of
|
||||||
|
SMURF_LOG_LEVEL in <ulink
|
||||||
|
url="shorewall.conf.html">shorewall.conf</ulink>(5). After
|
||||||
|
logging, the packets are dropped.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><emphasis role="bold">routeback</emphasis></term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Shorewall should set up the infrastructure to pass
|
||||||
|
packets from this/these address(es) back to themselves. This
|
||||||
|
is necessary if hosts in this group use the services of a
|
||||||
|
transparent proxy that is a member of the group or if DNAT is
|
||||||
|
used to send requests originating from this group to a server
|
||||||
|
in the group.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><emphasis role="bold">tcpflags</emphasis></term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Packets arriving from these hosts are checked for
|
||||||
|
certain illegal combinations of TCP flags. Packets found to
|
||||||
|
have such a combination of flags are handled according to the
|
||||||
|
setting of TCP_FLAGS_DISPOSITION after having been logged
|
||||||
|
according to the setting of TCP_FLAGS_LOG_LEVEL.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@@ -35,8 +35,8 @@
|
|||||||
<para>If you have more than one ISP link, adding entries to this file
|
<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
|
will <emphasis role="bold">not</emphasis> force connections to go out
|
||||||
through a particular link. You must use entries in <ulink
|
through a particular link. You must use entries in <ulink
|
||||||
url="shorewall-rtrules.html">shorewall-rtrules</ulink>(5) or
|
url="shorewall-rtrules.html">shorewall-rtrules</ulink>(5) or PREROUTING
|
||||||
PREROUTING entries in <ulink
|
entries in <ulink
|
||||||
url="shorewall-tcrules.html">shorewall-tcrules</ulink>(5) to do
|
url="shorewall-tcrules.html">shorewall-tcrules</ulink>(5) to do
|
||||||
that.</para>
|
that.</para>
|
||||||
</warning>
|
</warning>
|
||||||
@@ -88,7 +88,8 @@
|
|||||||
addresses to indicate that you only want to change the source IP
|
addresses to indicate that you only want to change the source IP
|
||||||
address for packets being sent to those particular destinations.
|
address for packets being sent to those particular destinations.
|
||||||
Exclusion is allowed (see <ulink
|
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
|
<para>If you wish to inhibit the action of ADD_SNAT_ALIASES for this
|
||||||
entry then include the ":" but omit the digit:</para>
|
entry then include the ":" but omit the digit:</para>
|
||||||
@@ -149,6 +150,10 @@
|
|||||||
|
|
||||||
<para>In that example traffic from eth1 would be masqueraded unless
|
<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>
|
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>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -467,6 +472,43 @@
|
|||||||
</variablelist>
|
</variablelist>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</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>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
@@ -548,6 +590,19 @@
|
|||||||
</warning>
|
</warning>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</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>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
@@ -23,7 +23,11 @@
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
|
|
||||||
<para>Assign any shell variables that you need in this file.</para>
|
<para>Assign any shell variables that you need in this file. The file is
|
||||||
|
always processed by <filename>/bin/sh</filename> or by the shell specified
|
||||||
|
through SHOREWALL_SHELL in <ulink
|
||||||
|
url="shorewall.conf.html">shorewall.conf</ulink> (5) so the full range of
|
||||||
|
shell capabilities may be used.</para>
|
||||||
|
|
||||||
<para>It is suggested that variable names begin with an upper case letter
|
<para>It is suggested that variable names begin with an upper case letter
|
||||||
to distinguish them from variables used internally within the Shorewall
|
to distinguish them from variables used internally within the Shorewall
|
||||||
@@ -128,12 +132,13 @@ net eth0 130.252.100.255 routefilter,norfc1918</programlisting>
|
|||||||
url="http://www.shorewall.net/configuration_file_basics.htm#Variables?">http://www.shorewall.net/configuration_file_basics.htm#Variables</ulink></para>
|
url="http://www.shorewall.net/configuration_file_basics.htm#Variables?">http://www.shorewall.net/configuration_file_basics.htm#Variables</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5), shorewall-ipsets(5),
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
shorewall-maclist(5), shorewall-masq(5), shorewall-nat(5),
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
shorewall-netmap(5), shorewall-policy(5), shorewall-providers(5),
|
shorewall-nat(5), shorewall-netmap(5), shorewall-policy(5),
|
||||||
shorewall-proxyarp(5), shorewall-rtrules(5),
|
shorewall-providers(5), shorewall-proxyarp(5), shorewall-rtrules(5),
|
||||||
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5), shorewall-secmarks(5),
|
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
shorewall-tcclasses(5), shorewall-tcdevices(5), shorewall-tcrules(5),
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
shorewall-tos(5), shorewall-tunnels(5), shorewall-zones(5)</para>
|
shorewall-tcrules(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">MARK/CLASSIFY</emphasis> (mark) -
|
<term><emphasis role="bold">ACTION</emphasis> (mark) -
|
||||||
<replaceable>mark</replaceable></term>
|
<replaceable>mark</replaceable></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -271,8 +271,8 @@
|
|||||||
target allows you to work around that problem. SAME may be used
|
target allows you to work around that problem. SAME may be used
|
||||||
in the PREROUTING and OUTPUT chains. When used in PREROUTING, it
|
in the PREROUTING and OUTPUT chains. When used in PREROUTING, it
|
||||||
causes matching connections from an individual local system to
|
causes matching connections from an individual local system to
|
||||||
all use the same provider. For example: <programlisting>#MARK/ SOURCE DEST PROTO DEST
|
all use the same provider. For example: <programlisting>#ACTION SOURCE DEST PROTO DEST
|
||||||
#CLASSIFY PORT(S)
|
# PORT(S)
|
||||||
SAME:P 192.168.1.0/24 0.0.0.0/0 tcp 80,443</programlisting>
|
SAME:P 192.168.1.0/24 0.0.0.0/0 tcp 80,443</programlisting>
|
||||||
If a host in 192.168.1.0/24 attempts a connection on TCP port 80
|
If a host in 192.168.1.0/24 attempts a connection on TCP port 80
|
||||||
or 443 and it has sent a packet on either of those ports in the
|
or 443 and it has sent a packet on either of those ports in the
|
||||||
@@ -282,8 +282,8 @@ SAME:P 192.168.1.0/24 0.0.0.0/0 tcp 80,443</programlisting>
|
|||||||
|
|
||||||
<para>When used in the OUTPUT chain, it causes all matching
|
<para>When used in the OUTPUT chain, it causes all matching
|
||||||
connections to an individual remote system to all use the same
|
connections to an individual remote system to all use the same
|
||||||
provider. For example:<programlisting>#MARK/ SOURCE DEST PROTO DEST
|
provider. For example:<programlisting>#ACTION SOURCE DEST PROTO DEST
|
||||||
#CLASSIFY PORT(S)
|
# PORT(S)
|
||||||
SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
||||||
If the firewall attempts a connection on TCP port 80 or 443 and
|
If the firewall attempts a connection on TCP port 80 or 443 and
|
||||||
it has sent a packet on either of those ports in the last five
|
it has sent a packet on either of those ports in the last five
|
||||||
@@ -468,6 +468,112 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
|||||||
<replaceable>number</replaceable>. Requires IMQ Target support
|
<replaceable>number</replaceable>. Requires IMQ Target support
|
||||||
in your kernel and iptables.</para>
|
in your kernel and iptables.</para>
|
||||||
</listitem>
|
</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>
|
</orderedlist>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -494,7 +600,7 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
|||||||
MAC addresses. <emphasis role="bold">This form will not match
|
MAC addresses. <emphasis role="bold">This form will not match
|
||||||
traffic that originates on the firewall itself unless either
|
traffic that originates on the firewall itself unless either
|
||||||
<major><minor> or the :T chain qualifier is used in
|
<major><minor> or the :T chain qualifier is used in
|
||||||
the MARK column.</emphasis></para>
|
the ACTION column.</emphasis></para>
|
||||||
|
|
||||||
<para>Examples:<simplelist>
|
<para>Examples:<simplelist>
|
||||||
<member>0.0.0.0/0</member>
|
<member>0.0.0.0/0</member>
|
||||||
@@ -516,7 +622,7 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
|||||||
<para>$FW optionally followed by a colon (":") and a
|
<para>$FW optionally followed by a colon (":") and a
|
||||||
comma-separated list of host or network IP addresses. Matches
|
comma-separated list of host or network IP addresses. Matches
|
||||||
packets originating on the firewall. May not be used with a
|
packets originating on the firewall. May not be used with a
|
||||||
chain qualifier (:P, :F, etc.) in the MARK column.</para>
|
chain qualifier (:P, :F, etc.) in the ACTION column.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</orderedlist>
|
</orderedlist>
|
||||||
|
|
||||||
@@ -832,15 +938,15 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
|||||||
original connection was made on.</para>
|
original connection was made on.</para>
|
||||||
|
|
||||||
<para>Example: Mark all FTP data connections with mark
|
<para>Example: Mark all FTP data connections with mark
|
||||||
4:<programlisting>#MARK/ SOURCE DEST PROTO PORT(S) SOURCE USER TEST LENGTH TOS CONNBYTES HELPER
|
4:<programlisting>#ACTION SOURCE DEST PROTO PORT(S) SOURCE USER TEST LENGTH TOS CONNBYTES HELPER
|
||||||
#CLASSIFY PORT(S)
|
# PORT(S)
|
||||||
4:T 0.0.0.0/0 0.0.0.0/0 TCP - - - - - - - ftp</programlisting></para>
|
4:T 0.0.0.0/0 0.0.0.0/0 TCP - - - - - - - ftp</programlisting></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">PROBABILITY</emphasis> -
|
<term><emphasis role="bold">PROBABILITY</emphasis> -
|
||||||
[probability]</term>
|
[<replaceable>probability</replaceable>]</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Added in Shorewall 4.5.0. When non-empty, requires the
|
<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>
|
at up to 8 decimal points of precision.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</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>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
@@ -873,8 +1017,8 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
|||||||
|
|
||||||
<para>We assume packet/connection mark 0 means unclassified.</para>
|
<para>We assume packet/connection mark 0 means unclassified.</para>
|
||||||
|
|
||||||
<programlisting> #MARK/ SOURCE DEST PROTO PORT(S) SOURCE USER TEST
|
<programlisting> #ACTION SOURCE DEST PROTO PORT(S) SOURCE USER TEST
|
||||||
#CLASSIFY PORT(S)
|
# PORT(S)
|
||||||
1:T 0.0.0.0/0 0.0.0.0/0 icmp echo-request
|
1:T 0.0.0.0/0 0.0.0.0/0 icmp echo-request
|
||||||
1:T 0.0.0.0/0 0.0.0.0/0 icmp echo-reply
|
1:T 0.0.0.0/0 0.0.0.0/0 icmp echo-reply
|
||||||
RESTORE:T 0.0.0.0/0 0.0.0.0/0 all - - - 0
|
RESTORE:T 0.0.0.0/0 0.0.0.0/0 all - - - 0
|
||||||
|
@@ -23,7 +23,9 @@
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Description</title>
|
<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
|
<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
|
followed by a different name in parentheses, the different name is used in
|
||||||
|
@@ -848,6 +848,29 @@ net all DROP info</programlisting>then the chain name is 'net2all'
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><emphasis role="bold">IPSET_WARNINGS=</emphasis>{<emphasis
|
||||||
|
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>}</term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Added in Shorewall 4.5.2. Default is Yes. When set, causes the
|
||||||
|
rules compiler to issue a warning when:</para>
|
||||||
|
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>The compiler is being run by root and an ipset specified
|
||||||
|
in the configuration does not exists. Only one warning is issued
|
||||||
|
for each missing ipset.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>When [src] is specified in a destination column and when
|
||||||
|
[dst] is specified in a source column.</para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis
|
<term><emphasis
|
||||||
role="bold">IPTABLES=</emphasis>[<emphasis>pathname</emphasis>]</term>
|
role="bold">IPTABLES=</emphasis>[<emphasis>pathname</emphasis>]</term>
|
||||||
@@ -2092,14 +2115,14 @@ net all DROP info</programlisting>then the chain name is 'net2all'
|
|||||||
tcrules. This was done so that tcrules could reset the packet mark
|
tcrules. This was done so that tcrules could reset the packet mark
|
||||||
to zero, thus allowing the packet to be routed using the 'main'
|
to zero, thus allowing the packet to be routed using the 'main'
|
||||||
routing table. Using the main table allowed dynamic routes (such as
|
routing table. Using the main table allowed dynamic routes (such as
|
||||||
those added for VPNs) to be effective. The rtrules file was
|
those added for VPNs) to be effective. The rtrules file was created
|
||||||
created to provide a better alternative to clearing the packet mark.
|
to provide a better alternative to clearing the packet mark. As a
|
||||||
As a consequence, passing these packets to PREROUTING complicates
|
consequence, passing these packets to PREROUTING complicates things
|
||||||
things without providing any real benefit. Beginning with Shorewall
|
without providing any real benefit. Beginning with Shorewall 4.4.6,
|
||||||
4.4.6, when TRACK_PROVIDERS=Yes and TC_EXPERT=No, packets arriving
|
when TRACK_PROVIDERS=Yes and TC_EXPERT=No, packets arriving through
|
||||||
through 'tracked' interfaces will not be passed to the PREROUTING
|
'tracked' interfaces will not be passed to the PREROUTING rules.
|
||||||
rules. Since TRACK_PROVIDERS was just introduced in 4.4.3, this
|
Since TRACK_PROVIDERS was just introduced in 4.4.3, this change
|
||||||
change should be transparent to most, if not all, users.</para>
|
should be transparent to most, if not all, users.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
@@ -1243,7 +1243,7 @@
|
|||||||
directory is given, then Shorewall will look in that directory first
|
directory is given, then Shorewall will look in that directory first
|
||||||
when opening configuration files.</para>
|
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
|
<replaceable>timeout</replaceable> value using the
|
||||||
<option>-t</option> option. The numeric
|
<option>-t</option> option. The numeric
|
||||||
<replaceable>timeout</replaceable> may optionally be followed by an
|
<replaceable>timeout</replaceable> may optionally be followed by an
|
||||||
@@ -1265,7 +1265,7 @@
|
|||||||
Shorewall will look in that directory first when opening
|
Shorewall will look in that directory first when opening
|
||||||
configuration files.</para>
|
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
|
<replaceable>timeout</replaceable> value using the
|
||||||
<option>-t</option> option. The numeric
|
<option>-t</option> option. The numeric
|
||||||
<replaceable>timeout</replaceable> may optionally be followed by an
|
<replaceable>timeout</replaceable> may optionally be followed by an
|
||||||
@@ -1600,7 +1600,7 @@
|
|||||||
role="bold">restore</emphasis> is performed after
|
role="bold">restore</emphasis> is performed after
|
||||||
<replaceable>timeout</replaceable> seconds.</para>
|
<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
|
<replaceable>timeout</replaceable> may optionally be followed by an
|
||||||
<option>s</option>, <option>m</option> or <option>h</option> suffix
|
<option>s</option>, <option>m</option> or <option>h</option> suffix
|
||||||
(e.g., 5m) to specify seconds, minutes or hours respectively. If the
|
(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 /etc/shorewall-*.bkout
|
||||||
rm -rf /var/lib/shorewall
|
rm -rf /var/lib/shorewall
|
||||||
rm -rf /var/lib/shorewall-*.bkout
|
rm -rf /var/lib/shorewall-*.bkout
|
||||||
rm -rf $PERLLIB}/Shorewall/*
|
rm -rf ${PERLLIB}/Shorewall/*
|
||||||
rm -rf ${LIBEXEC}/shorewall
|
rm -rf ${LIBEXEC}/shorewall
|
||||||
rm -rf /usr/share/shorewall/configfiles/
|
rm -rf /usr/share/shorewall/configfiles/
|
||||||
rm -rf /usr/share/shorewall/Samples/
|
rm -rf /usr/share/shorewall/Samples/
|
||||||
|
@@ -12,7 +12,7 @@ $(VARDIR)/${RESTOREFILE}: $(VARDIR)/firewall
|
|||||||
then \
|
then \
|
||||||
/sbin/shorewall6-lite -q save >/dev/null; \
|
/sbin/shorewall6-lite -q save >/dev/null; \
|
||||||
else \
|
else \
|
||||||
/sbin/shorewall6-lite -q restart 2>&1 | tail >&2; \
|
/sbin/shorewall6-lite -q restart 2>&1 | tail >&2; exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# EOF
|
# EOF
|
||||||
|
@@ -76,10 +76,10 @@ command="$1"
|
|||||||
|
|
||||||
case "$command" in
|
case "$command" in
|
||||||
start)
|
start)
|
||||||
exec /sbin/shorewall6-lite $OPTIONS start $STARTOPTIONS $@
|
exec /sbin/shorewall6-lite $OPTIONS start $STARTOPTIONS
|
||||||
;;
|
;;
|
||||||
restart|reload)
|
restart|reload)
|
||||||
exec /sbin/shorewall6-lite $OPTIONS restart $RESTARTOPTIONS $@
|
exec /sbin/shorewall6-lite $OPTIONS restart $RESTARTOPTIONS
|
||||||
;;
|
;;
|
||||||
status|stop)
|
status|stop)
|
||||||
exec /sbin/shorewall6-lite $OPTIONS $command $@
|
exec /sbin/shorewall6-lite $OPTIONS $command $@
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
VARDIR=$(shell /sbin/shorewall6 show vardir)
|
VARDIR=$(shell /sbin/shorewall6 show vardir)
|
||||||
CONFDIR=/etc/shorewall6
|
CONFDIR=/etc/shorewall6
|
||||||
RESTOREFILE?=firewall
|
RESTOREFILE?=firewall
|
||||||
|
|
||||||
all: $(VARDIR)/${RESTOREFILE}
|
all: $(VARDIR)/${RESTOREFILE}
|
||||||
|
|
||||||
$(VARDIR)/${RESTOREFILE}: $(CONFDIR)/*
|
$(VARDIR)/${RESTOREFILE}: $(CONFDIR)/*
|
||||||
@@ -11,11 +12,12 @@ $(VARDIR)/${RESTOREFILE}: $(CONFDIR)/*
|
|||||||
then \
|
then \
|
||||||
/sbin/shorewall6 -q save >/dev/null; \
|
/sbin/shorewall6 -q save >/dev/null; \
|
||||||
else \
|
else \
|
||||||
/sbin/shorewall6 -q restart 2>&1 | tail >&2; \
|
/sbin/shorewall6 -q restart 2>&1 | tail >&2; exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -f $(CONFDIR)/*~ $(CONFDIR)/.*~
|
@rm -f $(CONFDIR)/*~ $(CONFDIR)/.*~
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
# EOF
|
# EOF
|
||||||
|
@@ -129,6 +129,8 @@ FORWARD_CLEAR_MARK=
|
|||||||
|
|
||||||
IMPLICIT_CONTINUE=No
|
IMPLICIT_CONTINUE=No
|
||||||
|
|
||||||
|
IPSET_WARNINGS=Yes
|
||||||
|
|
||||||
IP_FORWARDING=Off
|
IP_FORWARDING=Off
|
||||||
|
|
||||||
KEEP_RT_TABLES=Yes
|
KEEP_RT_TABLES=Yes
|
||||||
|
@@ -129,6 +129,8 @@ FORWARD_CLEAR_MARK=
|
|||||||
|
|
||||||
IMPLICIT_CONTINUE=No
|
IMPLICIT_CONTINUE=No
|
||||||
|
|
||||||
|
IPSET_WARNINGS=Yes
|
||||||
|
|
||||||
IP_FORWARDING=Off
|
IP_FORWARDING=Off
|
||||||
|
|
||||||
KEEP_RT_TABLES=Yes
|
KEEP_RT_TABLES=Yes
|
||||||
|
@@ -129,6 +129,8 @@ FORWARD_CLEAR_MARK=
|
|||||||
|
|
||||||
IMPLICIT_CONTINUE=No
|
IMPLICIT_CONTINUE=No
|
||||||
|
|
||||||
|
IPSET_WARNINGS=Yes
|
||||||
|
|
||||||
IP_FORWARDING=On
|
IP_FORWARDING=On
|
||||||
|
|
||||||
KEEP_RT_TABLES=Yes
|
KEEP_RT_TABLES=Yes
|
||||||
|
@@ -129,6 +129,8 @@ FORWARD_CLEAR_MARK=
|
|||||||
|
|
||||||
IMPLICIT_CONTINUE=No
|
IMPLICIT_CONTINUE=No
|
||||||
|
|
||||||
|
IPSET_WARNINGS=Yes
|
||||||
|
|
||||||
IP_FORWARDING=On
|
IP_FORWARDING=On
|
||||||
|
|
||||||
KEEP_RT_TABLES=Yes
|
KEEP_RT_TABLES=Yes
|
||||||
|
@@ -7,4 +7,8 @@
|
|||||||
# http://www.shorewall.net/manpages6/shorewall6-interfaces.html
|
# http://www.shorewall.net/manpages6/shorewall6-interfaces.html
|
||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
FORMAT 1
|
||||||
#ZONE INTERFACE ANYCAST OPTIONS
|
#ZONE INTERFACE ANYCAST OPTIONS
|
||||||
|
|
||||||
|
FORMAT 2
|
||||||
|
#ZONE INTERFACE OPTIONS
|
||||||
|
@@ -8,13 +8,15 @@
|
|||||||
#
|
#
|
||||||
# The script is invoked inside a function that accepts an interface
|
# The script is invoked inside a function that accepts an interface
|
||||||
# name as a single argument. The file below is designed to work with
|
# 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
|
# See http://shorewall.net/shorewall_extension_scripts.htm for additional
|
||||||
# information.
|
# information.
|
||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
local status=0
|
local status
|
||||||
|
status=0
|
||||||
|
|
||||||
[ -f ${VARDIR}/${1}.status ] && status=$(cat ${VARDIR}/${1}.status)
|
[ -f ${VARDIR}/${1}.status ] && status=$(cat ${VARDIR}/${1}.status)
|
||||||
|
|
||||||
|
@@ -129,6 +129,8 @@ FORWARD_CLEAR_MARK=Yes
|
|||||||
|
|
||||||
IMPLICIT_CONTINUE=No
|
IMPLICIT_CONTINUE=No
|
||||||
|
|
||||||
|
IPSET_WARNINGS=Yes
|
||||||
|
|
||||||
IP_FORWARDING=Off
|
IP_FORWARDING=Off
|
||||||
|
|
||||||
KEEP_RT_TABLES=Yes
|
KEEP_RT_TABLES=Yes
|
||||||
|
@@ -9,6 +9,6 @@
|
|||||||
#
|
#
|
||||||
# See http://shorewall.net/PacketMarking.html for a detailed description of
|
# See http://shorewall.net/PacketMarking.html for a detailed description of
|
||||||
# the Netfilter/Shorewall packet marking mechanism.
|
# the Netfilter/Shorewall packet marking mechanism.
|
||||||
##############################################################################################################################################
|
###################################################################################################################################################
|
||||||
#MARK SOURCE DEST PROTO DEST SOURCE USER TEST LENGTH TOS CONNBYTES HELPER HEADERS PROBABILITY
|
#ACTION SOURCE DEST PROTO DEST SOURCE USER TEST LENGTH TOS CONNBYTES HELPER HEADERS PROBABILITY DSCP
|
||||||
# PORT(S) PORT(S)
|
# PORT(S) PORT(S)
|
||||||
|
@@ -4,5 +4,5 @@
|
|||||||
# For information about entries in this file, type "man shorewall6-tos"
|
# 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
|
# PORTS PORTS
|
||||||
|
@@ -77,10 +77,10 @@ command="$1"
|
|||||||
|
|
||||||
case "$command" in
|
case "$command" in
|
||||||
start)
|
start)
|
||||||
exec /sbin/shorewall6 $OPTIONS start $STARTOPTIONS $@
|
exec /sbin/shorewall6 $OPTIONS start $STARTOPTIONS
|
||||||
;;
|
;;
|
||||||
restart|reload)
|
restart|reload)
|
||||||
exec /sbin/shorewall6 $OPTIONS restart $RESTARTOPTIONS $@
|
exec /sbin/shorewall6 $OPTIONS restart $RESTARTOPTIONS
|
||||||
;;
|
;;
|
||||||
status|stop)
|
status|stop)
|
||||||
exec /sbin/shorewall6 $OPTIONS $command $@
|
exec /sbin/shorewall6 $OPTIONS $command $@
|
||||||
|
@@ -75,12 +75,9 @@
|
|||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>A jump to a user-defined accounting chain before entries that
|
<para>A jump to a user-defined accounting chain must appear before
|
||||||
add rules to that chain.</para>
|
entries that add rules to that chain. This eliminates loops and
|
||||||
</listitem>
|
unreferenced chains.</para>
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>This eliminates loops and unreferenced chains.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
|
@@ -120,19 +120,6 @@
|
|||||||
the list must have no embedded white space.</para>
|
the list must have no embedded white space.</para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">routeback</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>shorewall6 should set up the infrastructure to pass
|
|
||||||
packets from this/these address(es) back to themselves. This
|
|
||||||
is necessary if hosts in this group use the services of a
|
|
||||||
transparent proxy that is a member of the group or if DNAT is
|
|
||||||
used to send requests originating from this group to a server
|
|
||||||
in the group.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">blacklist</emphasis></term>
|
<term><emphasis role="bold">blacklist</emphasis></term>
|
||||||
|
|
||||||
@@ -143,18 +130,6 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">tcpflags</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Packets arriving from these hosts are checked for
|
|
||||||
certain illegal combinations of TCP flags. Packets found to
|
|
||||||
have such a combination of flags are handled according to the
|
|
||||||
setting of TCP_FLAGS_DISPOSITION after having been logged
|
|
||||||
according to the setting of TCP_FLAGS_LOG_LEVEL.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">ipsec</emphasis></term>
|
<term><emphasis role="bold">ipsec</emphasis></term>
|
||||||
|
|
||||||
@@ -167,6 +142,43 @@
|
|||||||
here.</para>
|
here.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><emphasis
|
||||||
|
role="bold">mss</emphasis>=<replaceable>mss</replaceable></term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Added in Shorewall 4.5.2. When present, causes the TCP
|
||||||
|
mss for new connections to/from the hosts given in the HOST(S)
|
||||||
|
column to be clamped at the specified
|
||||||
|
<replaceable>mss</replaceable>.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><emphasis role="bold">routeback</emphasis></term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>shorewall6 should set up the infrastructure to pass
|
||||||
|
packets from this/these address(es) back to themselves. This
|
||||||
|
is necessary if hosts in this group use the services of a
|
||||||
|
transparent proxy that is a member of the group or if DNAT is
|
||||||
|
used to send requests originating from this group to a server
|
||||||
|
in the group.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><emphasis role="bold">tcpflags</emphasis></term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Packets arriving from these hosts are checked for
|
||||||
|
certain illegal combinations of TCP flags. Packets found to
|
||||||
|
have such a combination of flags are handled according to the
|
||||||
|
setting of TCP_FLAGS_DISPOSITION after having been logged
|
||||||
|
according to the setting of TCP_FLAGS_LOG_LEVEL.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@@ -23,7 +23,11 @@
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
|
|
||||||
<para>Assign any shell variables that you need in this file.</para>
|
<para>Assign any shell variables that you need in this file. The file is
|
||||||
|
always processed by <filename>/bin/sh</filename> or by the shell specified
|
||||||
|
through SHOREWALL_SHELL in <ulink
|
||||||
|
url="shorewall6.conf.html">shorewall6.conf</ulink> (5) so the full range
|
||||||
|
of shell capabilities may be used.</para>
|
||||||
|
|
||||||
<para>It is suggested that variable names begin with an upper case letter
|
<para>It is suggested that variable names begin with an upper case letter
|
||||||
to distinguish them from variables used internally within the Shorewall
|
to distinguish them from variables used internally within the Shorewall
|
||||||
@@ -130,8 +134,8 @@ net eth0 - dhcp,nosmurfs</programlisting>
|
|||||||
<para>shorewall6(8), shorewall6-accounting(5), shorewall6-actions(5),
|
<para>shorewall6(8), shorewall6-accounting(5), shorewall6-actions(5),
|
||||||
shorewall6-blacklist(5), shorewall6-hosts(5), shorewall6-interfaces(5),
|
shorewall6-blacklist(5), shorewall6-hosts(5), shorewall6-interfaces(5),
|
||||||
shorewall6-maclist(5), shorewall6-policy(5), shorewall6-providers(5),
|
shorewall6-maclist(5), shorewall6-policy(5), shorewall6-providers(5),
|
||||||
shorewall6-rtrules(5), shorewall6-routestopped(5),
|
shorewall6-rtrules(5), shorewall6-routestopped(5), shorewall6-rules(5),
|
||||||
shorewall6-rules(5), shorewall6.conf(5), shorewall6-secmarks(5), shorewall6-tcclasses(5),
|
shorewall6.conf(5), shorewall6-secmarks(5), shorewall6-tcclasses(5),
|
||||||
shorewall6-tcdevices(5), shorewall6-tcrules(5), shorewall6-tos(5),
|
shorewall6-tcdevices(5), shorewall6-tcrules(5), shorewall6-tos(5),
|
||||||
shorewall6-tunnels(5), shorewall6-zones(5)</para>
|
shorewall6-tunnels(5), shorewall6-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
@@ -44,11 +44,11 @@
|
|||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">MARK/CLASSIFY</emphasis> -
|
<term><emphasis role="bold">ACTION</emphasis> -
|
||||||
<replaceable>mark</replaceable></term>
|
<replaceable>action</replaceable></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><replaceable>mark</replaceable> may assume one of the
|
<para><replaceable>action</replaceable> may assume one of the
|
||||||
following values.</para>
|
following values.</para>
|
||||||
|
|
||||||
<orderedlist numeration="arabic">
|
<orderedlist numeration="arabic">
|
||||||
@@ -272,8 +272,8 @@
|
|||||||
SAME may be used in the PREROUTING and OUTPUT chains. When used
|
SAME may be used in the PREROUTING and OUTPUT chains. When used
|
||||||
in PREROUTING, it causes matching connections from an individual
|
in PREROUTING, it causes matching connections from an individual
|
||||||
local system to all use the same provider. For example:
|
local system to all use the same provider. For example:
|
||||||
<programlisting>#MARK/ SOURCE DEST PROTO DEST
|
<programlisting>#ACTION SOURCE DEST PROTO DEST
|
||||||
#CLASSIFY PORT(S)
|
# PORT(S)
|
||||||
SAME:P 192.168.1.0/24 0.0.0.0/0 tcp 80,443</programlisting>
|
SAME:P 192.168.1.0/24 0.0.0.0/0 tcp 80,443</programlisting>
|
||||||
If a host in 192.168.1.0/24 attempts a connection on TCP port 80
|
If a host in 192.168.1.0/24 attempts a connection on TCP port 80
|
||||||
or 443 and it has sent a packet on either of those ports in the
|
or 443 and it has sent a packet on either of those ports in the
|
||||||
@@ -283,8 +283,8 @@ SAME:P 192.168.1.0/24 0.0.0.0/0 tcp 80,443</programlisting>
|
|||||||
|
|
||||||
<para>When used in the OUTPUT chain, it causes all matching
|
<para>When used in the OUTPUT chain, it causes all matching
|
||||||
connections to an individual remote system to all use the same
|
connections to an individual remote system to all use the same
|
||||||
provider. For example:<programlisting>#MARK/ SOURCE DEST PROTO DEST
|
provider. For example:<programlisting>#ACTION SOURCE DEST PROTO DEST
|
||||||
#CLASSIFY PORT(S)
|
# PORT(S)
|
||||||
SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
||||||
If the firewall attempts a connection on TCP port 80 or 443 and
|
If the firewall attempts a connection on TCP port 80 or 443 and
|
||||||
it has sent a packet on either of those ports in the last five
|
it has sent a packet on either of those ports in the last five
|
||||||
@@ -365,6 +365,112 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
|||||||
<replaceable>number</replaceable>. Requires IMQ Target support
|
<replaceable>number</replaceable>. Requires IMQ Target support
|
||||||
in your kernel and ip6tables.</para>
|
in your kernel and ip6tables.</para>
|
||||||
</listitem>
|
</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>
|
</orderedlist>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -389,7 +495,7 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
|||||||
|
|
||||||
<para>Accordingly, use $<emphasis role="bold">FW</emphasis> in its
|
<para>Accordingly, use $<emphasis role="bold">FW</emphasis> in its
|
||||||
own separate rule for packets originating on the firewall. In such a
|
own separate rule for packets originating on the firewall. In such a
|
||||||
rule, the MARK column may NOT specify either <emphasis
|
rule, the ACTION column may NOT specify either <emphasis
|
||||||
role="bold">:P</emphasis> or <emphasis role="bold">:F</emphasis>
|
role="bold">:P</emphasis> or <emphasis role="bold">:F</emphasis>
|
||||||
because marking for firewall-originated packets always occurs in the
|
because marking for firewall-originated packets always occurs in the
|
||||||
OUTPUT chain.</para>
|
OUTPUT chain.</para>
|
||||||
@@ -420,7 +526,7 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
|||||||
iprange match support, IP address ranges are also allowed. List
|
iprange match support, IP address ranges are also allowed. List
|
||||||
elements may also consist of an interface name followed by ":" and
|
elements may also consist of an interface name followed by ":" and
|
||||||
an address (e.g., eth1:<2002:ce7c:92b4::/48>). If the
|
an address (e.g., eth1:<2002:ce7c:92b4::/48>). If the
|
||||||
<emphasis role="bold">MARK</emphasis> column specificies a
|
<emphasis role="bold">ACTION</emphasis> column specificies a
|
||||||
classification of the form
|
classification of the form
|
||||||
<emphasis>major</emphasis>:<emphasis>minor</emphasis> then this
|
<emphasis>major</emphasis>:<emphasis>minor</emphasis> then this
|
||||||
column may also contain an interface name.</para>
|
column may also contain an interface name.</para>
|
||||||
@@ -689,8 +795,8 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
|||||||
that the original connection was made on.</para>
|
that the original connection was made on.</para>
|
||||||
|
|
||||||
<para>Example: Mark all FTP data connections with mark
|
<para>Example: Mark all FTP data connections with mark
|
||||||
4:<programlisting>#MARK/ SOURCE DEST PROTO PORT(S) SOURCE USER TEST LENGTH TOS CONNBYTES HELPER
|
4:<programlisting>#ACTION SOURCE DEST PROTO PORT(S) SOURCE USER TEST LENGTH TOS CONNBYTES HELPER
|
||||||
#CLASSIFY PORT(S)
|
# PORT(S)
|
||||||
4 ::/0 ::/0 TCP - - - - - - - ftp</programlisting></para>
|
4 ::/0 ::/0 TCP - - - - - - - ftp</programlisting></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -824,8 +930,8 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
|||||||
|
|
||||||
<para>We assume packet/connection mark 0 means unclassified.</para>
|
<para>We assume packet/connection mark 0 means unclassified.</para>
|
||||||
|
|
||||||
<programlisting> #MARK/ SOURCE DEST PROTO PORT(S) SOURCE USER TEST
|
<programlisting> #ACTION SOURCE DEST PROTO PORT(S) SOURCE USER TEST
|
||||||
#CLASSIFY PORT(S)
|
# PORT(S)
|
||||||
1 ::/0 ::/0 icmp echo-request
|
1 ::/0 ::/0 icmp echo-request
|
||||||
1 ::/0 ::/0 icmp echo-reply
|
1 ::/0 ::/0 icmp echo-reply
|
||||||
RESTORE ::/0 ::/0 all - - - 0
|
RESTORE ::/0 ::/0 all - - - 0
|
||||||
|
@@ -23,7 +23,10 @@
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Description</title>
|
<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>
|
<para>The columns in the file are as follows.</para>
|
||||||
|
|
||||||
|
@@ -756,6 +756,29 @@ net all DROP info</programlisting>then the chain name is 'net2all'
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><emphasis role="bold">IPSET_WARNINGS=</emphasis>{<emphasis
|
||||||
|
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>}</term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Added in Shorewall 4.5.2. Default is Yes. When set, causes the
|
||||||
|
rules compiler to issue a warning when:</para>
|
||||||
|
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>The compiler is being run by root and an ipset specified
|
||||||
|
in the configuration does not exists. Only one warning is issued
|
||||||
|
for each missing ipset.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>When [src] is specified in a destination column and when
|
||||||
|
[dst] is specified in a source column.</para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">KEEP_RT_TABLES=</emphasis>{<emphasis
|
<term><emphasis role="bold">KEEP_RT_TABLES=</emphasis>{<emphasis
|
||||||
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>}</term>
|
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>}</term>
|
||||||
@@ -1809,15 +1832,14 @@ net all DROP info</programlisting>then the chain name is 'net2all'
|
|||||||
to zero, thus allowing the packet to be routed using the 'main'
|
to zero, thus allowing the packet to be routed using the 'main'
|
||||||
routing table. Using the main table allowed dynamic routes (such as
|
routing table. Using the main table allowed dynamic routes (such as
|
||||||
those added for VPNs) to be effective. The <ulink
|
those added for VPNs) to be effective. The <ulink
|
||||||
url="shorewall6-rtrules.html">shorewall6-rtrules</ulink>(5)
|
url="shorewall6-rtrules.html">shorewall6-rtrules</ulink>(5) file was
|
||||||
file was created to provide a better alternative to clearing the
|
created to provide a better alternative to clearing the packet mark.
|
||||||
packet mark. As a consequence, passing these packets to PREROUTING
|
As a consequence, passing these packets to PREROUTING complicates
|
||||||
complicates things without providing any real benefit. Beginning
|
things without providing any real benefit. Beginning with Shorewall
|
||||||
with Shorewall 4.4.6, when TRACK_PROVIDERS=Yes and TC_EXPERT=No,
|
4.4.6, when TRACK_PROVIDERS=Yes and TC_EXPERT=No, packets arriving
|
||||||
packets arriving through 'tracked' interfaces will not be passed to
|
through 'tracked' interfaces will not be passed to the PREROUTING
|
||||||
the PREROUTING rules. Since TRACK_PROVIDERS was just introduced in
|
rules. Since TRACK_PROVIDERS was just introduced in 4.4.3, this
|
||||||
4.4.3, this change should be transparent to most, if not all,
|
change should be transparent to most, if not all, users.</para>
|
||||||
users.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -1977,10 +1999,9 @@ net all DROP info</programlisting>then the chain name is 'net2all'
|
|||||||
shorewall6-ipsec(5), shorewall6-maclist(5), shorewall6-masq(5),
|
shorewall6-ipsec(5), shorewall6-maclist(5), shorewall6-masq(5),
|
||||||
shorewall6-nat(5), shorewall6-netmap(5),
|
shorewall6-nat(5), shorewall6-netmap(5),
|
||||||
shoewall6-netmap(5),shorewall6-params(5), shorewall6-policy(5),
|
shoewall6-netmap(5),shorewall6-params(5), shorewall6-policy(5),
|
||||||
shorewall6-providers(5), shorewall6-proxyarp(5),
|
shorewall6-providers(5), shorewall6-proxyarp(5), shorewall6-rtrules(5),
|
||||||
shorewall6-rtrules(5), shorewall6-routestopped(5),
|
shorewall6-routestopped(5), shorewall6-rules(5), shorewall6-tcclasses(5),
|
||||||
shorewall6-rules(5), shorewall6-tcclasses(5), shorewall6-tcdevices(5),
|
shorewall6-tcdevices(5), shorewall6-tcrules(5), shorewall6-tos(5),
|
||||||
shorewall6-tcrules(5), shorewall6-tos(5), shorewall6-tunnels(5),
|
shorewall6-tunnels(5), shorewall6-zones(5)</para>
|
||||||
shorewall6-zones(5)</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -1108,7 +1108,7 @@
|
|||||||
directory is given, then Shorewall6 will look in that directory
|
directory is given, then Shorewall6 will look in that directory
|
||||||
first when opening configuration files.</para>
|
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
|
<replaceable>timeout</replaceable> value using the
|
||||||
<option>-t</option> option. The numeric
|
<option>-t</option> option. The numeric
|
||||||
<replaceable>timeout</replaceable> may optionally be followed by an
|
<replaceable>timeout</replaceable> may optionally be followed by an
|
||||||
@@ -1130,7 +1130,7 @@
|
|||||||
Shorewall6 will look in that directory first when opening
|
Shorewall6 will look in that directory first when opening
|
||||||
configuration files.</para>
|
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
|
<replaceable>timeout</replaceable> value using the
|
||||||
<option>-t</option> option. The numeric
|
<option>-t</option> option. The numeric
|
||||||
<replaceable>timeout</replaceable> may optionally be followed by an
|
<replaceable>timeout</replaceable> may optionally be followed by an
|
||||||
@@ -1422,7 +1422,7 @@
|
|||||||
role="bold">restore</emphasis> is performed after
|
role="bold">restore</emphasis> is performed after
|
||||||
<replaceable>timeout</replaceable> seconds.</para>
|
<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
|
<replaceable>timeout</replaceable> may optionally be followed by an
|
||||||
<option>s</option>, <option>m</option> or <option>h</option> suffix
|
<option>s</option>, <option>m</option> or <option>h</option> suffix
|
||||||
(e.g., 5m) to specify seconds, minutes or hours respectively. If the
|
(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
|
<para>The <filename>/sbin/shorewall</filename> shell program is used to
|
||||||
interact with Shorewall. See <ulink
|
interact with Shorewall. See <ulink
|
||||||
url="manpages/shorewall.html">shorewall</ulink>(8). </para>
|
url="manpages/shorewall.html">shorewall</ulink>(8).</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="share-shorewall">
|
<section id="share-shorewall">
|
||||||
|
@@ -223,8 +223,8 @@
|
|||||||
|
|
||||||
<entry><ulink url="OpenVZ.html">OpenVZ</ulink></entry>
|
<entry><ulink url="OpenVZ.html">OpenVZ</ulink></entry>
|
||||||
|
|
||||||
<entry><ulink url="LennyToSqueeze.html">Upgrading to Shorewall 4.4
|
<entry><ulink url="upgrade_issues.htm">Upgrade
|
||||||
(Upgrading Debian Lenny to Squeeze)</ulink></entry>
|
Issues</ulink></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@@ -234,7 +234,8 @@
|
|||||||
<entry><ulink url="starting_and_stopping_shorewall.htm">Operating
|
<entry><ulink url="starting_and_stopping_shorewall.htm">Operating
|
||||||
Shorewall</ulink></entry>
|
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>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@@ -245,7 +246,7 @@
|
|||||||
<entry><ulink url="PacketMarking.html">Packet
|
<entry><ulink url="PacketMarking.html">Packet
|
||||||
Marking</ulink></entry>
|
Marking</ulink></entry>
|
||||||
|
|
||||||
<entry><ulink url="VPN.htm">VPN Passthrough</ulink></entry>
|
<entry><ulink url="VPNBasics.html">VPN</ulink></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@@ -255,8 +256,7 @@
|
|||||||
<entry><ulink url="PacketHandling.html">Packet Processing in a
|
<entry><ulink url="PacketHandling.html">Packet Processing in a
|
||||||
Shorewall-based Firewall</ulink></entry>
|
Shorewall-based Firewall</ulink></entry>
|
||||||
|
|
||||||
<entry><ulink url="blacklisting_support.htm#whitelisting">White
|
<entry><ulink url="VPN.htm">VPN Passthrough</ulink></entry>
|
||||||
List Creation</ulink></entry>
|
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@@ -264,8 +264,8 @@
|
|||||||
|
|
||||||
<entry><ulink url="ping.html">'Ping' Management</ulink></entry>
|
<entry><ulink url="ping.html">'Ping' Management</ulink></entry>
|
||||||
|
|
||||||
<entry><ulink url="XenMyWay.html">Xen - Shorewall in a Bridged Xen
|
<entry><ulink url="blacklisting_support.htm#whitelisting">White
|
||||||
DomU</ulink></entry>
|
List Creation</ulink></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@@ -275,8 +275,8 @@
|
|||||||
<entry><ulink url="two-interface.htm#DNAT">Port
|
<entry><ulink url="two-interface.htm#DNAT">Port
|
||||||
Forwarding</ulink></entry>
|
Forwarding</ulink></entry>
|
||||||
|
|
||||||
<entry><ulink url="XenMyWay-Routed.html">Xen - Shorewall in Routed
|
<entry><ulink url="XenMyWay.html">Xen - Shorewall in a Bridged Xen
|
||||||
Xen Dom0</ulink></entry>
|
DomU</ulink></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@@ -285,7 +285,8 @@
|
|||||||
|
|
||||||
<entry><ulink url="ports.htm">Port Information</ulink></entry>
|
<entry><ulink url="ports.htm">Port Information</ulink></entry>
|
||||||
|
|
||||||
<entry/>
|
<entry><ulink url="XenMyWay-Routed.html">Xen - Shorewall in Routed
|
||||||
|
Xen Dom0</ulink></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
|
52
docs/FAQ.xml
52
docs/FAQ.xml
@@ -247,7 +247,7 @@ DNAT net:<emphasis>address</emphasis> loc:<emphasis>local-IP-address</empha
|
|||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You are trying to test from inside your firewall (no, that
|
<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>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -2837,7 +2837,7 @@ Shorewall has detected the following iptables/netfilter capabilities:
|
|||||||
Persistent SNAT: Available
|
Persistent SNAT: Available
|
||||||
gateway:~# </programlisting>
|
gateway:~# </programlisting>
|
||||||
|
|
||||||
<para></para>
|
<para/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="faq19">
|
<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>
|
examples, macros, etc. easier.</para>
|
||||||
</section>
|
</section>
|
||||||
</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>
|
</section>
|
||||||
</article>
|
</article>
|
||||||
|
352
docs/Install.xml
352
docs/Install.xml
@@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
<year>2009</year>
|
<year>2009</year>
|
||||||
|
|
||||||
|
<year>2012</year>
|
||||||
|
|
||||||
<holder>Thomas M. Eastep</holder>
|
<holder>Thomas M. Eastep</holder>
|
||||||
</copyright>
|
</copyright>
|
||||||
|
|
||||||
@@ -135,11 +137,31 @@
|
|||||||
<section id="Install_Tarball">
|
<section id="Install_Tarball">
|
||||||
<title>Install using tarball</title>
|
<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>
|
<para>To install Shorewall using the tarball and install script:</para>
|
||||||
|
|
||||||
<orderedlist>
|
<orderedlist>
|
||||||
<listitem>
|
<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>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -241,6 +263,9 @@
|
|||||||
<para>Beginning with Shorewall 4.4.20, you can specify an absolute
|
<para>Beginning with Shorewall 4.4.20, you can specify an absolute
|
||||||
path name for LIBEXEC, in which case the listed executables will
|
path name for LIBEXEC, in which case the listed executables will
|
||||||
be installed in ${LIBEXEC}/shorewall*.</para>
|
be installed in ${LIBEXEC}/shorewall*.</para>
|
||||||
|
|
||||||
|
<para>Beginning with Shorewall 4.5.1, you must specify an absolute
|
||||||
|
pathname for LIBEXEC.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -258,10 +283,311 @@
|
|||||||
<para>Beginning with Shorewall 4.4.20, you can specify an absolute
|
<para>Beginning with Shorewall 4.4.20, you can specify an absolute
|
||||||
path name for PERLLIB, in which case the Shorewall Perl modules
|
path name for PERLLIB, in which case the Shorewall Perl modules
|
||||||
will be installed in ${PERLLIB}/Shorewall/.</para>
|
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>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>MANDIR</term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Determines where the man pages are installed. Default is
|
||||||
|
distribution-dependent as shown below.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section id="Locations">
|
||||||
|
<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>
|
||||||
|
|
||||||
<section id="Debian">
|
<section id="Debian">
|
||||||
@@ -406,17 +732,37 @@ Pin-Priority: 700</programlisting><emphasis role="bold"><emphasis>Then
|
|||||||
issues</ulink> for specific instructions.</para>
|
issues</ulink> for specific instructions.</para>
|
||||||
</important></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
|
<para>If you already have Shorewall installed and are upgrading to a new
|
||||||
version using the tarball:</para>
|
version using the tarball:</para>
|
||||||
|
|
||||||
<orderedlist>
|
<orderedlist>
|
||||||
<listitem>
|
<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>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>cd to the shorewall-perl directory (the version is encoded in
|
<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>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
<pubdate><?dbtimestamp format="Y/m/d"?></pubdate>
|
<pubdate><?dbtimestamp format="Y/m/d"?></pubdate>
|
||||||
|
|
||||||
<copyright>
|
<copyright>
|
||||||
<year>2003-2009</year>
|
<year>2003-2012</year>
|
||||||
|
|
||||||
<holder>Thomas M. Eastep</holder>
|
<holder>Thomas M. Eastep</holder>
|
||||||
</copyright>
|
</copyright>
|
||||||
@@ -385,9 +385,14 @@ ACCEPT net $FW tcp 22</programlisting>
|
|||||||
<section id="Packages">
|
<section id="Packages">
|
||||||
<title>Shorewall Packages</title>
|
<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>
|
<orderedlist>
|
||||||
|
<listitem>
|
||||||
|
<para><emphasis role="bold">Shorewall-core</emphasis>. All of the
|
||||||
|
other packages depend on this one.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><emphasis role="bold">Shorewall</emphasis>. This package must be
|
<para><emphasis role="bold">Shorewall</emphasis>. This package must be
|
||||||
installed on at least one system in your network. It contains
|
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
|
scripts are generated. These scripts are copied to the firewall
|
||||||
systems where they run under the control of Shorewall6-lite.</para>
|
systems where they run under the control of Shorewall6-lite.</para>
|
||||||
</listitem>
|
</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>
|
</orderedlist>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
@@ -117,7 +117,7 @@
|
|||||||
ISP.</para>
|
ISP.</para>
|
||||||
</footnote> as in the following diagram.</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>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -1578,8 +1578,11 @@ DOWN_COUNT=2</programlisting>
|
|||||||
return $status</programlisting></para>
|
return $status</programlisting></para>
|
||||||
|
|
||||||
<para>The above script is installed in <filename
|
<para>The above script is installed in <filename
|
||||||
class="directory">/etc/shorewall</filename>, beginning with Shorewall
|
class="directory">/etc/shorewall</filename> in Shorewall releases
|
||||||
4.3.11.</para>
|
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
|
<para>Also included is a sample init script
|
||||||
(<filename>swping.init</filename>) to start the monitoring daemon.
|
(<filename>swping.init</filename>) to start the monitoring daemon.
|
||||||
@@ -2088,7 +2091,7 @@ exit 0
|
|||||||
on ursa that I will describe here</emphasis>.</para>
|
on ursa that I will describe here</emphasis>.</para>
|
||||||
|
|
||||||
<para>Below is a diagram of our network:<graphic align="center"
|
<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
|
<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
|
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>
|
<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
|
<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
|
provider unless there is a specific need for the traffic to use the DSL
|
||||||
|
@@ -117,7 +117,7 @@ tcp 6 19 TIME_WAIT src=206.124.146.176 dst=192.136.34.98 sport=58597 dport=
|
|||||||
<para>PREROUTING program — If MARK_IN_FORWARD_CHAIN=No in
|
<para>PREROUTING program — If MARK_IN_FORWARD_CHAIN=No in
|
||||||
<filename>shorewall.conf</filename>, then by default entries in
|
<filename>shorewall.conf</filename>, then by default entries in
|
||||||
<filename>/etc/shorewall/tcrules</filename> are part of the PREROUTING
|
<filename>/etc/shorewall/tcrules</filename> are part of the PREROUTING
|
||||||
program. Entries specifying the ":P" suffix in the MARK column are
|
program. Entries specifying the ":P" suffix in the ACTION column are
|
||||||
also part of the PREROUTING program. The PREROUTING program gets
|
also part of the PREROUTING program. The PREROUTING program gets
|
||||||
executed for each packet entering the firewall.</para>
|
executed for each packet entering the firewall.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@@ -126,7 +126,7 @@ tcp 6 19 TIME_WAIT src=206.124.146.176 dst=192.136.34.98 sport=58597 dport=
|
|||||||
<para>FORWARD program — If MARK_IN_FORWARD_CHAIN=Yes in
|
<para>FORWARD program — If MARK_IN_FORWARD_CHAIN=Yes in
|
||||||
<filename>shorewall.conf</filename>, then by default entries in
|
<filename>shorewall.conf</filename>, then by default entries in
|
||||||
<filename>/etc/shorewall/tcrules</filename> are part of the FORWARD
|
<filename>/etc/shorewall/tcrules</filename> are part of the FORWARD
|
||||||
program. Entries specifying the ":F" suffix in the MARK column are
|
program. Entries specifying the ":F" suffix in the ACTION column are
|
||||||
also part of the FORWARD program. The FORWARD program gets executed
|
also part of the FORWARD program. The FORWARD program gets executed
|
||||||
for each packet forwarded by the firewall.</para>
|
for each packet forwarded by the firewall.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@@ -138,12 +138,12 @@ tcp 6 19 TIME_WAIT src=206.124.146.176 dst=192.136.34.98 sport=58597 dport=
|
|||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>POSTROUTING program — Entries with a class-id in the MARK column
|
<para>POSTROUTING program — Entries with a class-id in the ACTION
|
||||||
(and that don't specify $FW in the SOURCE column) are part of the
|
column (and that don't specify $FW in the SOURCE column) are part of
|
||||||
POSTROUTING program. These rules are executed for each packet leaving
|
the POSTROUTING program. These rules are executed for each packet
|
||||||
the firewall. Entries specifying the ":T" suffix in the MARK column
|
leaving the firewall. Entries specifying the ":T" suffix in the ACTION
|
||||||
are also part of the POSTROUTING program (Shorewall version 3.4.0 and
|
column are also part of the POSTROUTING program (Shorewall version
|
||||||
later).</para>
|
3.4.0 and later).</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -180,25 +180,25 @@ tcp 6 19 TIME_WAIT src=206.124.146.176 dst=192.136.34.98 sport=58597 dport=
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>the connection to which the current packet belongs receives
|
<para>the connection to which the current packet belongs receives
|
||||||
a new mark value (":C", ":CF" or ":CP" suffix in the MARK column);
|
a new mark value (":C", ":CF" or ":CP" suffix in the ACTION
|
||||||
or</para>
|
column); or</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>the packet is classified for traffic shaping (class-id in
|
<para>the packet is classified for traffic shaping (class-id in
|
||||||
the MARK column); or</para>
|
the ACTION column); or</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>the packet mark in the current packet is moved to the
|
<para>the packet mark in the current packet is moved to the
|
||||||
connection mark for the connection that the current packet is part
|
connection mark for the connection that the current packet is part
|
||||||
of ("SAVE" in the MARK column); or</para>
|
of ("SAVE" in the ACTION column); or</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>the connection mark value for the connection that the
|
<para>the connection mark value for the connection that the
|
||||||
current packet is part of is moved to the current packet's mark
|
current packet is part of is moved to the current packet's mark
|
||||||
("RESTORE" in the MARK column); or</para>
|
("RESTORE" in the ACTION column); or</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -207,7 +207,7 @@ tcp 6 19 TIME_WAIT src=206.124.146.176 dst=192.136.34.98 sport=58597 dport=
|
|||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>exit the current subroutine ("CONTINUE" in the MARK
|
<para>exit the current subroutine ("CONTINUE" in the ACTION
|
||||||
column).</para>
|
column).</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</orderedlist>
|
</orderedlist>
|
||||||
@@ -339,9 +339,9 @@ tcp 6 19 TIME_WAIT src=206.124.146.176 dst=192.136.34.98 sport=58597 dport=
|
|||||||
<para>The relationship between these options is shown in this
|
<para>The relationship between these options is shown in this
|
||||||
diagram.</para>
|
diagram.</para>
|
||||||
|
|
||||||
<graphic align="left" fileref="images/MarkGeometry.png" valign="top" />
|
<graphic align="left" fileref="images/MarkGeometry.png" valign="top"/>
|
||||||
|
|
||||||
<para></para>
|
<para/>
|
||||||
|
|
||||||
<para>The default values of these options are determined by the settings
|
<para>The default values of these options are determined by the settings
|
||||||
of other options as follows:</para>
|
of other options as follows:</para>
|
||||||
@@ -455,7 +455,7 @@ tcp 6 19 TIME_WAIT src=206.124.146.176 dst=192.136.34.98 sport=58597 dport=
|
|||||||
<para>Here's the example (slightly expanded) from the comments at the top
|
<para>Here's the example (slightly expanded) from the comments at the top
|
||||||
of the <filename>/etc/shorewall/tcrules</filename> file.</para>
|
of the <filename>/etc/shorewall/tcrules</filename> file.</para>
|
||||||
|
|
||||||
<programlisting>#MARK SOURCE DEST PROTO PORT(S) CLIENT USER TEST LENGTH TOS
|
<programlisting>#ACTION SOURCE DEST PROTO PORT(S) CLIENT USER TEST LENGTH TOS
|
||||||
# PORT(S)
|
# PORT(S)
|
||||||
1 0.0.0.0/0 0.0.0.0/0 icmp echo-request #Rule 1
|
1 0.0.0.0/0 0.0.0.0/0 icmp echo-request #Rule 1
|
||||||
1 0.0.0.0/0 0.0.0.0/0 icmp echo-reply #Rule 2
|
1 0.0.0.0/0 0.0.0.0/0 icmp echo-reply #Rule 2
|
||||||
@@ -539,7 +539,7 @@ Blarg 1 0x100 main eth3 206.124.146.254 track,ba
|
|||||||
|
|
||||||
<para>Here is <filename>/etc/shorewall/tcrules</filename>:</para>
|
<para>Here is <filename>/etc/shorewall/tcrules</filename>:</para>
|
||||||
|
|
||||||
<programlisting>#MARK SOURCE DEST PROTO PORT(S) CLIENT USER TEST
|
<programlisting>#ACTION SOURCE DEST PROTO PORT(S) CLIENT USER TEST
|
||||||
# PORT(S)
|
# PORT(S)
|
||||||
1:110 192.168.0.0/22 eth3 #Our internal nets get priority
|
1:110 192.168.0.0/22 eth3 #Our internal nets get priority
|
||||||
#over the server
|
#over the server
|
||||||
|
@@ -32,6 +32,8 @@
|
|||||||
|
|
||||||
<year>2010</year>
|
<year>2010</year>
|
||||||
|
|
||||||
|
<year>2012</year>
|
||||||
|
|
||||||
<holder>Thomas M. Eastep</holder>
|
<holder>Thomas M. Eastep</holder>
|
||||||
</copyright>
|
</copyright>
|
||||||
|
|
||||||
@@ -52,81 +54,64 @@
|
|||||||
<orderedlist>
|
<orderedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Releases have a three-level identification
|
<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>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>The first two levels (<emphasis>x.y</emphasis>) designate the
|
<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>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>The third level (<emphasis>z</emphasis>) designates the
|
<para>The third level (<emphasis>y</emphasis>) designates the
|
||||||
<firstterm>Minor Release Number</firstterm>.</para>
|
<firstterm>minor release Number</firstterm>.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Even numbered major releases (e.g., 1.4, 2.0, 2.2, ...) are
|
<para>Installing a new minor release involves no migration issues
|
||||||
<firstterm>Stable Releases</firstterm>. No major new features are
|
unless you want to take advantage of an enhancement. For example, if
|
||||||
added to stable releases and new minor releases of a stable release
|
you are running 4.5.0 and I release 4.5.1, your current configuration
|
||||||
will only contain bug fixes and simple low-risk enhancements.
|
is 100% compatible with the new release.</para>
|
||||||
Installing a new minor release for the major release that you are
|
</listitem>
|
||||||
currently running involves no migration issues unless you want to take
|
|
||||||
advantage of an enhancement (for example, if you are running 1.4.10
|
<listitem>
|
||||||
and I release 1.4.11, your current configuration is 100% compatible
|
<para>A major release may have migration issues. These are listed in
|
||||||
with the new release).</para>
|
the release notes and on the <ulink url="upgrade_issues.htm">upgrade
|
||||||
|
issues page</ulink>.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Support is available through the <ulink
|
<para>Support is available through the <ulink
|
||||||
url="http://sourceforge.net/mail/?group_id=22587">Mailing List</ulink>
|
url="http://sourceforge.net/mail/?group_id=22587">Mailing List</ulink>
|
||||||
for the two or three most recent Stable Releases. Three releases are
|
for the two most recent Major Releases. Fixes will only be provided
|
||||||
supported when the Shorewall release in the Stable Debian distribution
|
for the last minor release in the previous Major Release. For example,
|
||||||
is two releases behind the current Shorewall development. In that
|
only 4.5.0 was released, the only fixes for major issues with 4.4.27
|
||||||
case, only the minor release in Stable is supported.</para>
|
would be released for the 4.4 series.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Odd numbered major releases (e.g., 2.1, 2.3, ...) are
|
<para>Once a minor release has been announced, work begins on the next
|
||||||
<firstterm>Development Releases</firstterm>. Development releases are
|
minor release. Periodic Beta releases are made available through
|
||||||
where new functionality is introduced. Documentation for new features
|
announcements on the Shorewall Development and Shorewall User mailing
|
||||||
will be available but it may not be up to the standards of the stable
|
lists. Those Beta releases are numberd w.x.y-Beta1, ...Beta2, etc.
|
||||||
release documentation. Sites running Development Releases should be
|
Support for the Beta releases is offered through the Shorewall
|
||||||
prepared to play an active role in testing new features. Bug fixes and
|
Development mailing list in the form of emailed patches. There is no
|
||||||
problem resolution for the development release take a back seat to
|
guarantee of compatability between one Beta release and the next as
|
||||||
support of the stable releases. Problem reports for the current
|
features are tweaked.</para>
|
||||||
development release should be sent to the <ulink
|
|
||||||
url="mailto:shorewall-devel@lists.shorewall.net">Shorewall Development
|
|
||||||
Mailing List</ulink>.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>When the level of functionality of the current development
|
<para>When the next minor release is functionally complete, one or
|
||||||
release is judged adequate, the <firstterm>Beta period</firstterm> for
|
more <firstterm>release candidates</firstterm> are announced on the
|
||||||
a new Stable release will begin. Beta releases have identifications of
|
Shorewall Development and Shorewall User mailing lists. These release
|
||||||
the form <emphasis>x.y.0-BetaN</emphasis> where
|
candidates are numbered w.x.y-RC1, ...-RC2, etc.</para>
|
||||||
<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>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>What does it mean for a major release to be
|
<para>What does it mean for a major release to be
|
||||||
<firstterm>supported</firstterm>? It means that I will answer
|
<firstterm>supported</firstterm>? It means that that if a bug is
|
||||||
questions about the release and that if a bug is found, I will fix the
|
found, we will fix the bug and include the fix in the next minor
|
||||||
bug and include the fix in the next minor release.</para>
|
release.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -135,16 +120,8 @@
|
|||||||
four-level identification <emphasis>x.y.z.N</emphasis> where x.y.z is
|
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>
|
the minor release being fixed and N = 1.2.3...</para>
|
||||||
</listitem>
|
</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>
|
</orderedlist>
|
||||||
|
|
||||||
<para>The currently-supported major releases are and 4.0.10., 4.2.x. and
|
<para>The currently-supported major releases are 4.4 and 4.5.</para>
|
||||||
4.4.x.</para>
|
|
||||||
</section>
|
</section>
|
||||||
</article>
|
</article>
|
||||||
|
@@ -70,7 +70,10 @@
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><filename>/etc/shorewall/params</filename> - use this file to
|
<para><filename>/etc/shorewall/params</filename> - use this file to
|
||||||
set shell variables that you will expand in other files.</para>
|
set shell variables that you will expand in other files. It is
|
||||||
|
always processed by /bin/sh or by the shell specified through
|
||||||
|
SHOREWALL_SHELL in
|
||||||
|
<filename>/etc/shorewall/shorewall.conf.</filename></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -190,9 +193,9 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><filename>/etc/shorewall/rtrules</filename> - Defines
|
<para><filename>/etc/shorewall/rtrules</filename> - Defines routing
|
||||||
routing rules to be used in conjunction with the routing tables
|
rules to be used in conjunction with the routing tables defined in
|
||||||
defined in <filename>/etc/shorewall/providers</filename>.</para>
|
<filename>/etc/shorewall/providers</filename>.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -1044,6 +1047,16 @@ SHELL cat /etc/shorewall/rules.d/*.rules</programlisting></para>
|
|||||||
|
|
||||||
<programlisting>SECTION NEW
|
<programlisting>SECTION NEW
|
||||||
SHELL cat /etc/shorewall/rules.d/*.rules 2> /dev/null || true</programlisting>
|
SHELL cat /etc/shorewall/rules.d/*.rules 2> /dev/null || true</programlisting>
|
||||||
|
|
||||||
|
<para>Beginning with Shorewall 4.5.2, in files other than
|
||||||
|
<filename>/etc/shorewall/params</filename> and
|
||||||
|
<filename>/etc/shorewall/conf</filename>, INCLUDE may be immediately
|
||||||
|
preceeded with '?' to signal that the line is a compiler directive and
|
||||||
|
not configuration data.</para>
|
||||||
|
|
||||||
|
<para>Example:</para>
|
||||||
|
|
||||||
|
<programlisting>?INCLUDE common.rules</programlisting>
|
||||||
</example>
|
</example>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -1287,6 +1300,11 @@ SHELL cat /etc/shorewall/rules.d/*.rules 2> /dev/null || true</programlisting
|
|||||||
<para><ulink url="Macros.html">Macro</ulink> files</para>
|
<para><ulink url="Macros.html">Macro</ulink> files</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para><ulink
|
||||||
|
url="manpages/shorewall-nat.html">shorewall-nat</ulink>(5)</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><ulink
|
<para><ulink
|
||||||
url="manpages/shorewall-rules.html">shorewall-rules</ulink> (5)</para>
|
url="manpages/shorewall-rules.html">shorewall-rules</ulink> (5)</para>
|
||||||
@@ -1324,8 +1342,88 @@ SHELL cat /etc/shorewall/rules.d/*.rules 2> /dev/null || true</programlisting
|
|||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
<para>For optional interfaces, if the interface is not usable at the time
|
<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
|
that the firewall starts, one of two approaches are taken, depending on
|
||||||
IPv4 and :: in IPv6), resulting in no packets matching the rule.</para>
|
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
|
<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.,
|
url="manpages/shorewall.conf.html">shorewall.conf</ulink> (5) (e.g.,
|
||||||
@@ -1333,7 +1431,7 @@ SHELL cat /etc/shorewall/rules.d/*.rules 2> /dev/null || true</programlisting
|
|||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>When an option is set to 'No' in shorewall.conf, the corresponding
|
<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>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
@@ -1342,6 +1440,112 @@ SHELL cat /etc/shorewall/rules.d/*.rules 2> /dev/null || true</programlisting
|
|||||||
</note>
|
</note>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section id="Conditional">
|
||||||
|
<title>Conditional Entries</title>
|
||||||
|
|
||||||
|
<para>Beginning with Shorewall 4.5.2, lines in configuration files may be
|
||||||
|
conditionally included or omitted based on the setting of <link
|
||||||
|
linkend="Variables">Shell variables</link>.</para>
|
||||||
|
|
||||||
|
<para>The general form is:</para>
|
||||||
|
|
||||||
|
<programlisting>?IF [!] <replaceable>$variable
|
||||||
|
|
||||||
|
</replaceable><lines to be included if $variable is non-empty and non-zero>
|
||||||
|
|
||||||
|
?ELSE
|
||||||
|
|
||||||
|
<lines to be omitted if $variable is non-empty and non-zero>
|
||||||
|
|
||||||
|
?ENDIF</programlisting>
|
||||||
|
|
||||||
|
<para>The compiler predefines two special
|
||||||
|
<replaceable>variable</replaceable>s that may only be used in ?IF
|
||||||
|
lines:</para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>__IPV4</term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>True if this is an IPv4 compilation</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>__IPV6</term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>True if this is an IPv6 compilation.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
|
||||||
|
<para>Unless <replaceable>variable</replaceable> is one of these
|
||||||
|
pre-defined ones, it is searched for in the compiler's environmental
|
||||||
|
variables, in variables set in <filename>/etc/shorewall/params</filename>,
|
||||||
|
and in options set in <filename>/etc/shorewall/shorewall.conf</filename>
|
||||||
|
in that order. If it is not found in any of those places, the
|
||||||
|
<replaceable>variable</replaceable> is assumed to have a value of 0
|
||||||
|
(false). If "!" is present, the result of the test is inverted.</para>
|
||||||
|
|
||||||
|
<para>The setting in <filename>/etc/shorewall/params</filename> by be
|
||||||
|
overridden at runtime, provided the setting in
|
||||||
|
<filename>/etc/shorewall/params</filename> is done like this:</para>
|
||||||
|
|
||||||
|
<programlisting>[ -n "${<replaceable>variable</replaceable>:=0}" ]</programlisting>
|
||||||
|
|
||||||
|
<para>or like this:</para>
|
||||||
|
|
||||||
|
<programlisting>[ -n "${<replaceable>variable</replaceable>}" ] || <replaceable>variable</replaceable>=0</programlisting>
|
||||||
|
|
||||||
|
<para>Either of those will set variable to 0 if it is not set to a
|
||||||
|
non-empty value in the environment. The setting can be overridden at
|
||||||
|
runtime:</para>
|
||||||
|
|
||||||
|
<programlisting><replaceable>variable</replaceable>=1 shorewall restart -c # use -c to force recompilation if AUTOMAKE=Yes in /etc/shorewall/shorewall.conf</programlisting>
|
||||||
|
|
||||||
|
<para>The ?ELSE may be omitted if there are no lines to be omitted.</para>
|
||||||
|
|
||||||
|
<para>The test may also be inverted using '!':</para>
|
||||||
|
|
||||||
|
<programlisting>?IF ! <replaceable>$variable
|
||||||
|
|
||||||
|
</replaceable><lines to be omitted if $variable is non-empty and non-zero>
|
||||||
|
|
||||||
|
?ELSE
|
||||||
|
|
||||||
|
<lines to be included if $variable is non-empty and non-zero>
|
||||||
|
|
||||||
|
?ENDIF</programlisting>
|
||||||
|
|
||||||
|
<para>Conditional entries may be nested but the number of ?IFs must match
|
||||||
|
the number of ?ENDs in any give file. <link linkend="INCLUDE">INCLUDE
|
||||||
|
directives</link> are ignored in omitted lines.</para>
|
||||||
|
|
||||||
|
<programlisting>?IF <replaceable>$variable1
|
||||||
|
|
||||||
|
</replaceable><lines to be included if $variable1 is non-empty and non-zero>
|
||||||
|
|
||||||
|
?IF $variable2
|
||||||
|
|
||||||
|
<lines to be included if $variable1 and $variable2 are non-empty and non-zero>
|
||||||
|
|
||||||
|
?ELSE
|
||||||
|
|
||||||
|
<lines to be omitted if $variable1 is non-empty and non-zero and if $variable2 is empty or zero>
|
||||||
|
|
||||||
|
?ENDIF
|
||||||
|
<replaceable>
|
||||||
|
</replaceable><lines to be included if $variable1 is non-empty and non-zero>
|
||||||
|
|
||||||
|
?ELSE
|
||||||
|
|
||||||
|
<lines to be omitted if $variable is non-empty and non-zero>
|
||||||
|
|
||||||
|
?ENDIF</programlisting>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section id="Embedded">
|
<section id="Embedded">
|
||||||
<title>Embedded Shell and Perl</title>
|
<title>Embedded Shell and Perl</title>
|
||||||
|
|
||||||
@@ -1353,23 +1557,31 @@ SHELL cat /etc/shorewall/rules.d/*.rules 2> /dev/null || true</programlisting
|
|||||||
richer and more flexible extension capability.</para>
|
richer and more flexible extension capability.</para>
|
||||||
|
|
||||||
<para>While inline scripts may be written in either Shell or Perl, those
|
<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
|
<para><emphasis role="bold">Note:</emphasis>In this section, '[' and ']'
|
||||||
line scripts take one of the following forms:</para>
|
are meta-characters which indicate that what they enclose is optional and
|
||||||
|
may be omitted.</para>
|
||||||
|
|
||||||
|
<para>Single line scripts take one of the following forms:</para>
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><emphasis role="bold">PERL</emphasis> <<emphasis>perl
|
<para><emphasis role="bold">[?]PERL</emphasis> <<emphasis>perl
|
||||||
script</emphasis>></para>
|
script</emphasis>></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><emphasis role="bold">SHELL</emphasis> <<emphasis>shell
|
<para><emphasis role="bold">[?]SHELL</emphasis> <<emphasis>shell
|
||||||
script</emphasis>></para>
|
script</emphasis>></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
|
<para>The optional '?' is allowed in Shorewall versions 4.5.2 and
|
||||||
|
later.</para>
|
||||||
|
|
||||||
<para>Shell scripts run in a child shell process and their output is piped
|
<para>Shell scripts run in a child shell process and their output is piped
|
||||||
back to the compiler which processes that output as if it were embedded at
|
back to the compiler which processes that output as if it were embedded at
|
||||||
the point of the script.</para>
|
the point of the script.</para>
|
||||||
@@ -1414,18 +1626,14 @@ use Shorewall::Config ( qw/shorewall/ );</programlisting>
|
|||||||
</orderedlist>
|
</orderedlist>
|
||||||
|
|
||||||
<para>Multi-line scripts use one of the following forms:<programlisting><emphasis
|
<para>Multi-line scripts use one of the following forms:<programlisting><emphasis
|
||||||
role="bold">BEGIN SHELL</emphasis>
|
role="bold">[?]BEGIN SHELL</emphasis>
|
||||||
<<emphasis>shell script</emphasis>>
|
<<emphasis>shell script</emphasis>>
|
||||||
<emphasis role="bold">END</emphasis> [ <emphasis role="bold">SHELL</emphasis> ]</programlisting><programlisting><emphasis
|
<emphasis role="bold">[?]END</emphasis> [ <emphasis role="bold">SHELL</emphasis> ]</programlisting><programlisting><emphasis
|
||||||
role="bold">BEGIN PERL</emphasis> [;]
|
role="bold">[?]BEGIN PERL</emphasis> [;]
|
||||||
<<emphasis>perl script</emphasis>>
|
<<emphasis>perl script</emphasis>>
|
||||||
<emphasis role="bold">END</emphasis> [ <emphasis role="bold">PERL</emphasis> ] [<emphasis
|
<emphasis role="bold">[?]END</emphasis> [ <emphasis role="bold">PERL</emphasis> ] [<emphasis
|
||||||
role="bold">;</emphasis>]</programlisting></para>
|
role="bold">;</emphasis>]</programlisting>As above, the optional
|
||||||
|
leading '?' is allowed in Shorewall versions 4.5.2 and later.</para>
|
||||||
<para><emphasis role="bold">Note: </emphasis>The '[' and ']' above are
|
|
||||||
meta-characters which indicate that what they enclose is optional and may
|
|
||||||
be omitted. So you may follow PERL with a semicolon ( ';') or you may omit
|
|
||||||
the semicolon.</para>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="dnsnames">
|
<section id="dnsnames">
|
||||||
|
@@ -85,7 +85,7 @@
|
|||||||
problem reporting process. It will ensure that you provide us with the
|
problem reporting process. It will ensure that you provide us with the
|
||||||
information we need to solve your problem as quickly as possible.</para>
|
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>
|
<orderedlist>
|
||||||
<important>
|
<important>
|
||||||
@@ -203,7 +203,7 @@
|
|||||||
message produced by Shorewall is "done.":</para>
|
message produced by Shorewall is "done.":</para>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<para></para>
|
<para/>
|
||||||
|
|
||||||
<programlisting>…
|
<programlisting>…
|
||||||
Activating Rules...
|
Activating Rules...
|
||||||
@@ -457,9 +457,7 @@ State:Stopped (Thu Mar 30 14:08:11 PDT 2006)</programlisting>
|
|||||||
<section id="Unsubscribe">
|
<section id="Unsubscribe">
|
||||||
<title>Unsubscribing from Shorewall Mailing Lists</title>
|
<title>Unsubscribing from Shorewall Mailing Lists</title>
|
||||||
|
|
||||||
<para>If you are really dim-witted enough to have to ask -- you
|
<para>See <ulink url="FAQ.htm#faq98">Shorewall FAQ 98</ulink>.</para>
|
||||||
unsubscribe at the same place that you subscribed. <emphasis
|
|
||||||
role="bold">Doh.......</emphasis></para>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="Other">
|
<section id="Other">
|
||||||
|
@@ -223,10 +223,10 @@
|
|||||||
<para>This screen shot shows how I configured QoS in a 2.6.16
|
<para>This screen shot shows how I configured QoS in a 2.6.16
|
||||||
Kernel:</para>
|
Kernel:</para>
|
||||||
|
|
||||||
<graphic align="center" fileref="images/traffic_shaping2.6.png" />
|
<graphic align="center" fileref="images/traffic_shaping2.6.png"/>
|
||||||
|
|
||||||
<para>And here's my recommendation for a 2.6.21 kernel:<graphic
|
<para>And here's my recommendation for a 2.6.21 kernel:<graphic
|
||||||
align="center" fileref="images/traffic_shaping2.6.21.png" /></para>
|
align="center" fileref="images/traffic_shaping2.6.21.png"/></para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="Shorewall">
|
<section id="Shorewall">
|
||||||
@@ -445,7 +445,7 @@
|
|||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
<example id="Example0">
|
<example id="Example0">
|
||||||
<title></title>
|
<title/>
|
||||||
|
|
||||||
<para>Suppose you are using PPP over Ethernet (DSL) and ppp0 is the
|
<para>Suppose you are using PPP over Ethernet (DSL) and ppp0 is the
|
||||||
interface for this. The device has an outgoing bandwidth of 500kbit
|
interface for this. The device has an outgoing bandwidth of 500kbit
|
||||||
@@ -829,11 +829,11 @@ ppp0 6000kbit 500kbit</programlisting>
|
|||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>MARK or CLASSIFY - MARK specifies the mark value is to be
|
<para>ACTION - ACTION (previously called MARK) specifies the mark
|
||||||
assigned in case of a match. This is an integer in the range 1-255
|
value is to be assigned in case of a match. This is an integer in
|
||||||
(1-16383 if you set WIDE_TC_MARKS=Yes or TC_BITS=14 in <ulink
|
the range 1-255 (1-16383 if you set WIDE_TC_MARKS=Yes or TC_BITS=14
|
||||||
url="manpages/shorewall.conf.html">shorewall.conf</ulink> (5)
|
in <ulink url="manpages/shorewall.conf.html">shorewall.conf</ulink>
|
||||||
).</para>
|
(5) ).</para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>In Shorewall 4.4.26, WIDE_TC_MARKS was superseded by TC_BITS
|
<para>In Shorewall 4.4.26, WIDE_TC_MARKS was superseded by TC_BITS
|
||||||
@@ -998,7 +998,7 @@ ppp0 6000kbit 500kbit</programlisting>
|
|||||||
MAC addresses. <emphasis role="bold">This form will not match
|
MAC addresses. <emphasis role="bold">This form will not match
|
||||||
traffic that originates on the firewall itself unless either
|
traffic that originates on the firewall itself unless either
|
||||||
<major><minor> or the :T chain qualifier is used in
|
<major><minor> or the :T chain qualifier is used in
|
||||||
the MARK column.</emphasis></para>
|
the ACTION column.</emphasis></para>
|
||||||
|
|
||||||
<para>Examples:<simplelist>
|
<para>Examples:<simplelist>
|
||||||
<member>0.0.0.0/0</member>
|
<member>0.0.0.0/0</member>
|
||||||
@@ -1020,7 +1020,7 @@ ppp0 6000kbit 500kbit</programlisting>
|
|||||||
<para>$FW optionally followed by a colon (":") and a
|
<para>$FW optionally followed by a colon (":") and a
|
||||||
comma-separated list of host or network IP addresses. matches
|
comma-separated list of host or network IP addresses. matches
|
||||||
packets originating on the firewall. May not be used with a
|
packets originating on the firewall. May not be used with a
|
||||||
chain qualifier (:P, :F, etc.) in the MARK column.</para>
|
chain qualifier (:P, :F, etc.) in the ACTION column.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</orderedlist>
|
</orderedlist>
|
||||||
|
|
||||||
@@ -1177,13 +1177,13 @@ ppp0 6000kbit 500kbit</programlisting>
|
|||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
<example id="Example1">
|
<example id="Example1">
|
||||||
<title></title>
|
<title/>
|
||||||
|
|
||||||
<para>All packets arriving on eth1 should be marked with 1. All
|
<para>All packets arriving on eth1 should be marked with 1. All
|
||||||
packets arriving on eth2 and eth3 should be marked with 2. All packets
|
packets arriving on eth2 and eth3 should be marked with 2. All packets
|
||||||
originating on the firewall itself should be marked with 3.</para>
|
originating on the firewall itself should be marked with 3.</para>
|
||||||
|
|
||||||
<programlisting>#MARK SOURCE DESTINATION PROTOCOL PORT(S)
|
<programlisting>#ACTION SOURCE DESTINATION PROTOCOL PORT(S)
|
||||||
1 eth1 0.0.0.0/0 all
|
1 eth1 0.0.0.0/0 all
|
||||||
2 eth2 0.0.0.0/0 all
|
2 eth2 0.0.0.0/0 all
|
||||||
2 eth3 0.0.0.0/0 all
|
2 eth3 0.0.0.0/0 all
|
||||||
@@ -1191,40 +1191,40 @@ ppp0 6000kbit 500kbit</programlisting>
|
|||||||
</example>
|
</example>
|
||||||
|
|
||||||
<example id="Example2">
|
<example id="Example2">
|
||||||
<title></title>
|
<title/>
|
||||||
|
|
||||||
<para>All GRE (protocol 47) packets destined for 155.186.235.151
|
<para>All GRE (protocol 47) packets destined for 155.186.235.151
|
||||||
should be marked with 12.</para>
|
should be marked with 12.</para>
|
||||||
|
|
||||||
<programlisting>#MARK SOURCE DESTINATION PROTOCOL PORT(S)
|
<programlisting>#ACTION SOURCE DESTINATION PROTOCOL PORT(S)
|
||||||
12:T 0.0.0.0/0 155.182.235.151 47</programlisting>
|
12:T 0.0.0.0/0 155.182.235.151 47</programlisting>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
<example id="Example3">
|
<example id="Example3">
|
||||||
<title></title>
|
<title/>
|
||||||
|
|
||||||
<para>All SSH request packets originating in 192.168.1.0/24 and
|
<para>All SSH request packets originating in 192.168.1.0/24 and
|
||||||
destined for 155.186.235.151 should be marked with 22.</para>
|
destined for 155.186.235.151 should be marked with 22.</para>
|
||||||
|
|
||||||
<programlisting>#MARK SOURCE DESTINATION PROTOCOL PORT(S)
|
<programlisting>#ACTION SOURCE DESTINATION PROTOCOL PORT(S)
|
||||||
22:T 192.168.1.0/24 155.182.235.151 tcp 22</programlisting>
|
22:T 192.168.1.0/24 155.182.235.151 tcp 22</programlisting>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
<example id="Example4">
|
<example id="Example4">
|
||||||
<title></title>
|
<title/>
|
||||||
|
|
||||||
<para>All SSH packets packets going out of the first device in in
|
<para>All SSH packets packets going out of the first device in in
|
||||||
/etc/shorewall/tcdevices should be assigned to the class with mark
|
/etc/shorewall/tcdevices should be assigned to the class with mark
|
||||||
value 10.</para>
|
value 10.</para>
|
||||||
|
|
||||||
<programlisting>#MARK SOURCE DESTINATION PROTOCOL PORT(S) CLIENT
|
<programlisting>#ACTION SOURCE DESTINATION PROTOCOL PORT(S) CLIENT
|
||||||
# PORT(S)
|
# PORT(S)
|
||||||
1:110 0.0.0.0/0 0.0.0.0/0 tcp 22
|
1:110 0.0.0.0/0 0.0.0.0/0 tcp 22
|
||||||
1:110 0.0.0.0/0 0.0.0.0/0 tcp - 22</programlisting>
|
1:110 0.0.0.0/0 0.0.0.0/0 tcp - 22</programlisting>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
<example id="Example5">
|
<example id="Example5">
|
||||||
<title></title>
|
<title/>
|
||||||
|
|
||||||
<para>Mark all ICMP echo traffic with packet mark 1. Mark all peer to
|
<para>Mark all ICMP echo traffic with packet mark 1. Mark all peer to
|
||||||
peer traffic with packet mark 4.</para>
|
peer traffic with packet mark 4.</para>
|
||||||
@@ -1236,7 +1236,7 @@ ppp0 6000kbit 500kbit</programlisting>
|
|||||||
means unclassified. Traffic originating on the firewall is not covered
|
means unclassified. Traffic originating on the firewall is not covered
|
||||||
by this example.</para>
|
by this example.</para>
|
||||||
|
|
||||||
<programlisting>#MARK SOURCE DESTINATION PROTOCOL PORT(S) CLIENT USER/ TEST
|
<programlisting>#ACTION SOURCE DESTINATION PROTOCOL PORT(S) CLIENT USER/ TEST
|
||||||
# PORT(S) GROUP
|
# PORT(S) GROUP
|
||||||
1 0.0.0.0/0 0.0.0.0/0 icmp echo-request
|
1 0.0.0.0/0 0.0.0.0/0 icmp echo-request
|
||||||
1 0.0.0.0/0 0.0.0.0/0 icmp echo-reply
|
1 0.0.0.0/0 0.0.0.0/0 icmp echo-reply
|
||||||
@@ -1257,13 +1257,13 @@ SAVE 0.0.0.0/0 0.0.0.0/0 all - - -
|
|||||||
</example>
|
</example>
|
||||||
|
|
||||||
<example>
|
<example>
|
||||||
<title></title>
|
<title/>
|
||||||
|
|
||||||
<para>Mark all forwarded VOIP connections with connection mark 1 and
|
<para>Mark all forwarded VOIP connections with connection mark 1 and
|
||||||
ensure that all VOIP packets also receive that mark (assumes that
|
ensure that all VOIP packets also receive that mark (assumes that
|
||||||
nf_conntrack_sip is loaded).</para>
|
nf_conntrack_sip is loaded).</para>
|
||||||
|
|
||||||
<programlisting>#MARK SOURCE DESTINATION PROTOCOL PORT(S) CLIENT USER/ TEST CONNBYTES TOS HELPER
|
<programlisting>#ACTION SOURCE DESTINATION PROTOCOL PORT(S) CLIENT USER/ TEST CONNBYTES TOS HELPER
|
||||||
# PORT(S) GROUP
|
# PORT(S) GROUP
|
||||||
RESTORE 0.0.0.0/0 0.0.0.0/0 all - - - 0
|
RESTORE 0.0.0.0/0 0.0.0.0/0 all - - - 0
|
||||||
CONTINUE 0.0.0.0/0 0.0.0.0/0 all - - - !0
|
CONTINUE 0.0.0.0/0 0.0.0.0/0 all - - - !0
|
||||||
@@ -1508,8 +1508,8 @@ eth0:101 - 1kbit 230kbit 4 occurs=6</programlisting>
|
|||||||
|
|
||||||
<para><filename>/etc/shoreall/tcrules</filename>:</para>
|
<para><filename>/etc/shoreall/tcrules</filename>:</para>
|
||||||
|
|
||||||
<programlisting>#MARK SOURCE DEST
|
<programlisting>#ACTION SOURCE DEST
|
||||||
IPMARK(src,0xff,0x10100):F 192.168.1.0/29 eth0</programlisting>
|
IPMARK(src,0xff,0x10100):F 192.168.1.0/29 eth0</programlisting>
|
||||||
|
|
||||||
<para>This facility also alters the way in which Shorewall generates a
|
<para>This facility also alters the way in which Shorewall generates a
|
||||||
class number when none is given. Prior to the implementation of this
|
class number when none is given. Prior to the implementation of this
|
||||||
@@ -1568,7 +1568,7 @@ ppp0 3 2*full/10 8*full/10 2</programlisting>
|
|||||||
<section id="realtcr">
|
<section id="realtcr">
|
||||||
<title>tcrules file</title>
|
<title>tcrules file</title>
|
||||||
|
|
||||||
<programlisting>#MARK SOURCE DEST PROTO PORT(S) CLIENT USER
|
<programlisting>#ACTION SOURCE DEST PROTO PORT(S) CLIENT USER
|
||||||
# PORT(S)
|
# PORT(S)
|
||||||
1:F 0.0.0.0/0 0.0.0.0/0 icmp echo-request
|
1:F 0.0.0.0/0 0.0.0.0/0 icmp echo-request
|
||||||
1:F 0.0.0.0/0 0.0.0.0/0 icmp echo-reply
|
1:F 0.0.0.0/0 0.0.0.0/0 icmp echo-reply
|
||||||
@@ -1652,7 +1652,7 @@ ppp0 4 90kbit 200kbit 3 default</pro
|
|||||||
<section id="simpletcr">
|
<section id="simpletcr">
|
||||||
<title>tcrules file</title>
|
<title>tcrules file</title>
|
||||||
|
|
||||||
<programlisting>#MARK SOURCE DEST PROTO PORT(S) CLIENT USER
|
<programlisting>#ACTION SOURCE DEST PROTO PORT(S) CLIENT USER
|
||||||
# PORT(S)
|
# PORT(S)
|
||||||
1:F 0.0.0.0/0 0.0.0.0/0 icmp echo-request
|
1:F 0.0.0.0/0 0.0.0.0/0 icmp echo-request
|
||||||
1:F 0.0.0.0/0 0.0.0.0/0 icmp echo-reply
|
1:F 0.0.0.0/0 0.0.0.0/0 icmp echo-reply
|
||||||
|
@@ -31,9 +31,11 @@
|
|||||||
|
|
||||||
<year>2009</year>
|
<year>2009</year>
|
||||||
|
|
||||||
|
<year>2012</year>
|
||||||
|
|
||||||
<holder>Thomas M. Eastep</holder>
|
<holder>Thomas M. Eastep</holder>
|
||||||
|
|
||||||
<holder></holder>
|
<holder/>
|
||||||
</copyright>
|
</copyright>
|
||||||
|
|
||||||
<legalnotice>
|
<legalnotice>
|
||||||
@@ -74,6 +76,44 @@
|
|||||||
zones.</para>
|
zones.</para>
|
||||||
</section>
|
</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>
|
<section>
|
||||||
<title>Versions >= 4.4.0</title>
|
<title>Versions >= 4.4.0</title>
|
||||||
|
|
||||||
@@ -318,7 +358,7 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<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
|
deprecated. With EXPORTPARAMS=No, the variables set by <ulink
|
||||||
url="manpages/shorewall-params.html">/etc/shorewall/params</ulink>
|
url="manpages/shorewall-params.html">/etc/shorewall/params</ulink>
|
||||||
(<ulink
|
(<ulink
|
||||||
|
Reference in New Issue
Block a user