forked from extern/shorewall_code
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f6ce03c506 | ||
|
83e0be6d0b | ||
|
e027f5078f | ||
|
81b42afa30 |
2
Shorewall-core/configure
vendored
2
Shorewall-core/configure
vendored
@@ -190,7 +190,7 @@ for p in ${!params[@]}; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo '#' > shorewallrc
|
echo '#' > shorewallrc
|
||||||
echo "# Created by Shorewall Core version $VERSION configure - " `date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}"` >> shorewallrc
|
echo "# Created by Shorewall Core version $VERSION configure - " `date` >> shorewallrc
|
||||||
echo "# rc file: $rcfile" >> shorewallrc
|
echo "# rc file: $rcfile" >> shorewallrc
|
||||||
echo '#' >> shorewallrc
|
echo '#' >> shorewallrc
|
||||||
|
|
||||||
|
@@ -173,12 +173,7 @@ my $outfile;
|
|||||||
|
|
||||||
open $outfile, '>', 'shorewallrc' or die "Can't open 'shorewallrc' for output: $!";
|
open $outfile, '>', 'shorewallrc' or die "Can't open 'shorewallrc' for output: $!";
|
||||||
|
|
||||||
if ( $ENV{SOURCE_DATE_EPOCH} ) {
|
printf $outfile "#\n# Created by Shorewall Core version %s configure.pl - %s %2d %04d %02d:%02d:%02d\n", VERSION, $abbr[$localtime[4]], $localtime[3], 1900 + $localtime[5] , @localtime[2,1,0];
|
||||||
printf $outfile "#\n# Created by Shorewall Core version %s configure.pl - %s\n", VERSION, `date --utc --date=\"\@$ENV{SOURCE_DATE_EPOCH}\"`;
|
|
||||||
} else {
|
|
||||||
printf $outfile "#\n# Created by Shorewall Core version %s configure.pl - %s %2d %04d %02d:%02d:%02d\n", VERSION, $abbr[$localtime[4]], $localtime[3], 1900 + $localtime[5] , @localtime[2,1,0];
|
|
||||||
}
|
|
||||||
|
|
||||||
print $outfile "# rc file: $rcfilename\n#\n";
|
print $outfile "# rc file: $rcfilename\n#\n";
|
||||||
|
|
||||||
print $outfile "# Input: @ARGV\n#\n" if @ARGV;
|
print $outfile "# Input: @ARGV\n#\n" if @ARGV;
|
||||||
|
@@ -335,8 +335,9 @@ for f in lib.* ; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ $SHAREDIR != /usr/share ]; then
|
if [ $SHAREDIR != /usr/share ]; then
|
||||||
eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/shorewall/lib.base
|
eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/${PRODUCT}/lib.base
|
||||||
eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/shorewall/lib.cli
|
eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/${PRODUCT}/lib.core
|
||||||
|
eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/${PRODUCT}/lib.cli
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Shorewall 5.1 -- /usr/share/shorewall/lib.base
|
# Shorewall 5.0 -- /usr/share/shorewall/lib.base
|
||||||
#
|
#
|
||||||
# (c) 1999-2017 - Tom Eastep (teastep@shorewall.net)
|
# (c) 1999-2015 - Tom Eastep (teastep@shorewall.net)
|
||||||
#
|
#
|
||||||
# Complete documentation is available at http://shorewall.net
|
# Complete documentation is available at http://shorewall.net
|
||||||
#
|
#
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
# loaded after this one and replaces some of the functions declared here.
|
# loaded after this one and replaces some of the functions declared here.
|
||||||
#
|
#
|
||||||
|
|
||||||
SHOREWALL_CAPVERSION=50106
|
SHOREWALL_CAPVERSION=50100
|
||||||
|
|
||||||
if [ -z "$g_basedir" ]; then
|
if [ -z "$g_basedir" ]; then
|
||||||
#
|
#
|
||||||
@@ -1137,31 +1137,16 @@ show_a_macro() {
|
|||||||
cat ${directory}/macro.$1
|
cat ${directory}/macro.$1
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
# Don't dump empty SPD entries or entries from the other address family
|
# Don't dump empty SPD entries
|
||||||
#
|
#
|
||||||
spd_filter() {
|
spd_filter()
|
||||||
#
|
{
|
||||||
# af = Address Family (4 or 6)
|
awk \
|
||||||
# afok = Address Family of entry matches af
|
'BEGIN { skip=0; }; \
|
||||||
# p = print the contents of A (entry is not empty)
|
/^src/ { skip=0; }; \
|
||||||
# i = Number of lines stored in A
|
/^src 0.0.0.0\/0/ { skip=1; }; \
|
||||||
#
|
/^src ::\/0/ { skip=1; }; \
|
||||||
awk -v af=$g_family \
|
{ if ( skip == 0 ) print; };'
|
||||||
'function prnt(A,i, j) { while ( j < i ) print A[j++]; };\
|
|
||||||
\
|
|
||||||
/^src / { if (p) prnt( A, i );\
|
|
||||||
afok = 1;\
|
|
||||||
p = 0;\
|
|
||||||
i = 0;\
|
|
||||||
if ( af == 4 )\
|
|
||||||
{ if ( /:/ ) afok = 0; }\
|
|
||||||
else\
|
|
||||||
{ if ( /\./ ) afok = 0; }\
|
|
||||||
};\
|
|
||||||
{ if ( afok ) A[i++] = $0; };\
|
|
||||||
/tmpl/ { p = afok; };\
|
|
||||||
\
|
|
||||||
END { if (p) prnt( A, i ); }'
|
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
# Print a heading with leading and trailing black lines
|
# Print a heading with leading and trailing black lines
|
||||||
@@ -1174,8 +1159,7 @@ heading() {
|
|||||||
|
|
||||||
show_ipsec() {
|
show_ipsec() {
|
||||||
heading "PFKEY SPD"
|
heading "PFKEY SPD"
|
||||||
$IP -s -$g_family xfrm policy | spd_filter
|
$IP -s xfrm policy | spd_filter
|
||||||
|
|
||||||
heading "PFKEY SAD"
|
heading "PFKEY SAD"
|
||||||
$IP -s -$g_family xfrm state | egrep -v '[[:space:]]+(auth-trunc|enc )' # Don't divulge the keys
|
$IP -s -$g_family xfrm state | egrep -v '[[:space:]]+(auth-trunc|enc )' # Don't divulge the keys
|
||||||
}
|
}
|
||||||
@@ -1813,7 +1797,7 @@ do_dump_command() {
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
qt mywhich ss && ss -${g_family}tunap || { qt mywhich netstat && netstat -tunap; }
|
qt mywhich ss && ss -${g_family}tunap || { qt mywhich netstat && netatat -tunap; }
|
||||||
|
|
||||||
if [ -n "$TC_ENABLED" ]; then
|
if [ -n "$TC_ENABLED" ]; then
|
||||||
heading "Traffic Control"
|
heading "Traffic Control"
|
||||||
@@ -2786,7 +2770,7 @@ determine_capabilities() {
|
|||||||
GOTO_TARGET=
|
GOTO_TARGET=
|
||||||
LOGMARK_TARGET=
|
LOGMARK_TARGET=
|
||||||
IPMARK_TARGET=
|
IPMARK_TARGET=
|
||||||
LOG_TARGET=
|
LOG_TARGET=Yes
|
||||||
ULOG_TARGET=
|
ULOG_TARGET=
|
||||||
NFLOG_TARGET=
|
NFLOG_TARGET=
|
||||||
PERSISTENT_SNAT=
|
PERSISTENT_SNAT=
|
||||||
@@ -2819,8 +2803,6 @@ determine_capabilities() {
|
|||||||
WAIT_OPTION=
|
WAIT_OPTION=
|
||||||
CPU_FANOUT=
|
CPU_FANOUT=
|
||||||
NETMAP_TARGET=
|
NETMAP_TARGET=
|
||||||
NFLOG_SIZE=
|
|
||||||
RESTORE_WAIT_OPTION=
|
|
||||||
|
|
||||||
AMANDA_HELPER=
|
AMANDA_HELPER=
|
||||||
FTP_HELPER=
|
FTP_HELPER=
|
||||||
@@ -2844,11 +2826,9 @@ determine_capabilities() {
|
|||||||
qt $arptables -L OUT && ARPTABLESJF=Yes
|
qt $arptables -L OUT && ARPTABLESJF=Yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -z "$(${g_tool}-restore --wait < /dev/null 2>&1)" ] && RESTORE_WAIT_OPTION=Yes
|
|
||||||
|
|
||||||
if qt $g_tool --wait -t filter -L INPUT -n -v; then
|
if qt $g_tool --wait -t filter -L INPUT -n -v; then
|
||||||
WAIT_OPTION=Yes
|
WAIT_OPTION=Yes
|
||||||
g_tool="$g_tool --wait"
|
tool="$tool --wait"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chain=fooX$$
|
chain=fooX$$
|
||||||
@@ -3154,15 +3134,12 @@ determine_capabilities() {
|
|||||||
qt $g_tool -A $chain -m time --timestart 23:00 -j DROP && TIME_MATCH=Yes
|
qt $g_tool -A $chain -m time --timestart 23:00 -j DROP && TIME_MATCH=Yes
|
||||||
qt $g_tool -A $chain -g $chain1 && GOTO_TARGET=Yes
|
qt $g_tool -A $chain -g $chain1 && GOTO_TARGET=Yes
|
||||||
qt $g_tool -A $chain -j LOGMARK && LOGMARK_TARGET=Yes
|
qt $g_tool -A $chain -j LOGMARK && LOGMARK_TARGET=Yes
|
||||||
qt $g_tool -A $chain -j LOG && LOG_TARGET=Yes
|
qt $g_tool -A $chain -j LOG || LOG_TARGET=
|
||||||
qt $g_tool -A $chain -j ULOG && ULOG_TARGET=Yes
|
qt $g_tool -A $chain -j ULOG && ULOG_TARGET=Yes
|
||||||
|
qt $g_tool -A $chain -j NFLOG && NFLOG_TARGET=Yes
|
||||||
qt $g_tool -A $chain -j MARK --set-mark 5 && MARK_ANYWHERE=Yes
|
qt $g_tool -A $chain -j MARK --set-mark 5 && MARK_ANYWHERE=Yes
|
||||||
qt $g_tool -A $chain -m statistic --mode nth --every 2 --packet 1 && STATISTIC_MATCH=Yes
|
qt $g_tool -A $chain -m statistic --mode nth --every 2 --packet 1 && STATISTIC_MATCH=Yes
|
||||||
qt $g_tool -A $chain -m geoip --src-cc US && GEOIP_MATCH=Yes
|
qt $g_tool -A $chain -m geoip --src-cc US && GEOIP_MATCH=Yes
|
||||||
if qt $g_tool -A $chain -j NFLOG; then
|
|
||||||
NFLOG_TARGET=Yes
|
|
||||||
qt $g_tool -A $chain -j NFLOG --nflog-size 64 && NFLOG_SIZE=Yes
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $g_family -eq 4 ]; then
|
if [ $g_family -eq 4 ]; then
|
||||||
qt $g_tool -A $chain -j ACCOUNT --addr 192.168.1.0/29 --tname $chain && ACCOUNT_TARGET=Yes
|
qt $g_tool -A $chain -j ACCOUNT --addr 192.168.1.0/29 --tname $chain && ACCOUNT_TARGET=Yes
|
||||||
@@ -3318,11 +3295,9 @@ report_capabilities_unsorted() {
|
|||||||
if [ $g_family -eq 4 ]; then
|
if [ $g_family -eq 4 ]; then
|
||||||
report_capability "iptables -S (IPTABLES_S)" $IPTABLES_S
|
report_capability "iptables -S (IPTABLES_S)" $IPTABLES_S
|
||||||
report_capability "iptables --wait option (WAIT_OPTION)" $WAIT_OPTION
|
report_capability "iptables --wait option (WAIT_OPTION)" $WAIT_OPTION
|
||||||
report_capability "iptables-restore --wait option (RESTORE_WAIT_OPTION)" $RESTORE_WAIT_OPTION
|
|
||||||
else
|
else
|
||||||
report_capability "ip6tables -S (IPTABLES_S)" $IPTABLES_S
|
report_capability "ip6tables -S (IPTABLES_S)" $IPTABLES_S
|
||||||
report_capability "ip6tables --wait option (WAIT_OPTION)" $WAIT_OPTION
|
report_capability "ip6tables --wait option (WAIT_OPTION)" $WAIT_OPTION
|
||||||
report_capability "ip6tables-restore --wait option (RESTORE_WAIT_OPTION)" $RESTORE_WAIT_OPTION
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
report_capability "Basic Filter (BASIC_FILTER)" $BASIC_FILTER
|
report_capability "Basic Filter (BASIC_FILTER)" $BASIC_FILTER
|
||||||
@@ -3330,7 +3305,6 @@ report_capabilities_unsorted() {
|
|||||||
report_capability "CT Target (CT_TARGET)" $CT_TARGET
|
report_capability "CT Target (CT_TARGET)" $CT_TARGET
|
||||||
report_capability "NFQUEUE CPU Fanout (CPU_FANOUT)" $CPU_FANOUT
|
report_capability "NFQUEUE CPU Fanout (CPU_FANOUT)" $CPU_FANOUT
|
||||||
report_capability "NETMAP Target (NETMAP_TARGET)" $NETMAP_TARGET
|
report_capability "NETMAP Target (NETMAP_TARGET)" $NETMAP_TARGET
|
||||||
report_capability "--nflog-size support (NFLOG_SIZE)" $NFLOG_SIZE
|
|
||||||
|
|
||||||
echo " Kernel Version (KERNELVERSION): $KERNELVERSION"
|
echo " Kernel Version (KERNELVERSION): $KERNELVERSION"
|
||||||
echo " Capabilities Version (CAPVERSION): $CAPVERSION"
|
echo " Capabilities Version (CAPVERSION): $CAPVERSION"
|
||||||
@@ -3437,8 +3411,6 @@ report_capabilities_unsorted1() {
|
|||||||
report_capability1 WAIT_OPTION
|
report_capability1 WAIT_OPTION
|
||||||
report_capability1 CPU_FANOUT
|
report_capability1 CPU_FANOUT
|
||||||
report_capability1 NETMAP_TARGET
|
report_capability1 NETMAP_TARGET
|
||||||
report_capability1 NFLOG_SIZE
|
|
||||||
report_capability1 RESTORE_WAIT_OPTION
|
|
||||||
|
|
||||||
report_capability1 AMANDA_HELPER
|
report_capability1 AMANDA_HELPER
|
||||||
report_capability1 FTP_HELPER
|
report_capability1 FTP_HELPER
|
||||||
@@ -3743,7 +3715,7 @@ ipcalc_command() {
|
|||||||
|
|
||||||
valid_address $address || fatal_error "Invalid IP address: $address"
|
valid_address $address || fatal_error "Invalid IP address: $address"
|
||||||
[ -z "$vlsm" ] && fatal_error "Missing VLSM"
|
[ -z "$vlsm" ] && fatal_error "Missing VLSM"
|
||||||
[ "x$address" = "x$vlsm" ] && fatal_error "Invalid VLSM"
|
[ "x$address" = "x$vlsm" ] && "Invalid VLSM"
|
||||||
[ $vlsm -gt 32 ] && fatal_error "Invalid VLSM: /$vlsm"
|
[ $vlsm -gt 32 ] && fatal_error "Invalid VLSM: /$vlsm"
|
||||||
|
|
||||||
address=$address/$vlsm
|
address=$address/$vlsm
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Shorewall 5.1 -- /usr/share/shorewall/lib.common.
|
# Shorewall 5.0 -- /usr/share/shorewall/lib.common.
|
||||||
#
|
#
|
||||||
# (c) 2010-2017 - Tom Eastep (teastep@shorewall.net)
|
# (c) 2010-2015 - Tom Eastep (teastep@shorewall.net)
|
||||||
#
|
#
|
||||||
# Complete documentation is available at http://shorewall.net
|
# Complete documentation is available at http://shorewall.net
|
||||||
#
|
#
|
||||||
@@ -269,48 +269,53 @@ loadmodule() # $1 = module name, $2 - * arguments
|
|||||||
{
|
{
|
||||||
local modulename
|
local modulename
|
||||||
modulename=$1
|
modulename=$1
|
||||||
shift
|
|
||||||
local moduleoptions
|
|
||||||
moduleoptions=$*
|
|
||||||
local modulefile
|
local modulefile
|
||||||
local suffix
|
local suffix
|
||||||
|
|
||||||
if [ -d /sys/module/ ]; then
|
if [ -d /sys/module/ ]; then
|
||||||
if ! list_search $modulename $DONT_LOAD; then
|
if ! list_search $modulename $DONT_LOAD; then
|
||||||
if [ ! -d /sys/module/$modulename ]; then
|
if [ ! -d /sys/module/$modulename ]; then
|
||||||
case $moduleloader in
|
shift
|
||||||
insmod)
|
|
||||||
for directory in $moduledirectories; do
|
for suffix in $MODULE_SUFFIX ; do
|
||||||
for modulefile in $directory/${modulename}.*; do
|
for directory in $moduledirectories; do
|
||||||
if [ -f $modulefile ]; then
|
modulefile=$directory/${modulename}.${suffix}
|
||||||
insmod $modulefile $moduleoptions
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
modprobe -q $modulename $moduleoptions
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
elif ! list_search $modulename $DONT_LOAD $MODULES; then
|
|
||||||
case $moduleloader in
|
|
||||||
insmod)
|
|
||||||
for directory in $moduledirectories; do
|
|
||||||
for modulefile in $directory/${modulename}.*; do
|
|
||||||
if [ -f $modulefile ]; then
|
if [ -f $modulefile ]; then
|
||||||
insmod $modulefile $moduleoptions
|
case $moduleloader in
|
||||||
return
|
insmod)
|
||||||
|
insmod $modulefile $*
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
modprobe $modulename $*
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
break 2
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
;;
|
fi
|
||||||
*)
|
fi
|
||||||
modprobe -q $modulename $moduleoptions
|
elif ! list_search $modulename $DONT_LOAD $MODULES; then
|
||||||
;;
|
shift
|
||||||
esac
|
|
||||||
|
for suffix in $MODULE_SUFFIX ; do
|
||||||
|
for directory in $moduledirectories; do
|
||||||
|
modulefile=$directory/${modulename}.${suffix}
|
||||||
|
|
||||||
|
if [ -f $modulefile ]; then
|
||||||
|
case $moduleloader in
|
||||||
|
insmod)
|
||||||
|
insmod $modulefile $*
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
modprobe $modulename $*
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
break 2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,6 +338,8 @@ reload_kernel_modules() {
|
|||||||
moduleloader=insmod
|
moduleloader=insmod
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ -n "${MODULE_SUFFIX:=ko ko.gz ko.xz o o.gz o.xz gz xz}" ]
|
||||||
|
|
||||||
if [ -n "$MODULESDIR" ]; then
|
if [ -n "$MODULESDIR" ]; then
|
||||||
case "$MODULESDIR" in
|
case "$MODULESDIR" in
|
||||||
+*)
|
+*)
|
||||||
@@ -387,6 +394,8 @@ load_kernel_modules() # $1 = Yes, if we are to save moduleinfo in $VARDIR
|
|||||||
moduleloader=insmod
|
moduleloader=insmod
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ -n "${MODULE_SUFFIX:=o gz xz ko o.gz o.xz ko.gz ko.xz}" ]
|
||||||
|
|
||||||
if [ -n "$MODULESDIR" ]; then
|
if [ -n "$MODULESDIR" ]; then
|
||||||
case "$MODULESDIR" in
|
case "$MODULESDIR" in
|
||||||
+*)
|
+*)
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Shorewall 5.1 -- /usr/share/shorewall/lib.core
|
# Shorewall 5.0 -- /usr/share/shorewall/lib.core
|
||||||
#
|
#
|
||||||
# (c) 1999-2017 - Tom Eastep (teastep@shorewall.net)
|
# (c) 1999-2015 - Tom Eastep (teastep@shorewall.net)
|
||||||
#
|
#
|
||||||
# Complete documentation is available at http://shorewall.net
|
# Complete documentation is available at http://shorewall.net
|
||||||
#
|
#
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
# generated scripts.
|
# generated scripts.
|
||||||
#
|
#
|
||||||
|
|
||||||
SHOREWALL_LIBVERSION=50108
|
SHOREWALL_LIBVERSION=50100
|
||||||
|
|
||||||
#
|
#
|
||||||
# Fatal Error
|
# Fatal Error
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Shorewall 5.1 -- /usr/share/shorewall/lib.installer.
|
# Shorewall 5.0 -- /usr/share/shorewall/lib.installer.
|
||||||
#
|
#
|
||||||
# (c) 2017 - Tom Eastep (teastep@shorewall.net)
|
# (c) 2017 - Tom Eastep (teastep@shorewall.net)
|
||||||
# (c) 2017 - Matt Darfeuille (matdarf@gmail.com)
|
# (c) 2017 - Matt Darfeuille (matdarf@gmail.com)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Shorewall 5.1 -- /usr/share/shorewall/lib.installer.
|
# Shorewall 5.0 -- /usr/share/shorewall/lib.installer.
|
||||||
#
|
#
|
||||||
# (c) 2017 - Tom Eastep (teastep@shorewall.net)
|
# (c) 2017 - Tom Eastep (teastep@shorewall.net)
|
||||||
# (c) 2017 - Matt Darfeuille (matdarf@gmail.com)
|
# (c) 2017 - Matt Darfeuille (matdarf@gmail.com)
|
||||||
|
@@ -3173,8 +3173,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/</para>
|
<para>/etc/shorewall/</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -3184,18 +3182,13 @@
|
|||||||
url="/starting_and_stopping_shorewall.htm">http://www.shorewall.net/starting_and_stopping_shorewall.htm</ulink></para>
|
url="/starting_and_stopping_shorewall.htm">http://www.shorewall.net/starting_and_stopping_shorewall.htm</ulink></para>
|
||||||
|
|
||||||
<para>shorewall-accounting(5), shorewall-actions(5),
|
<para>shorewall-accounting(5), shorewall-actions(5),
|
||||||
shorewall-arprules(5), shorewall-blrules(5), shorewall.conf(5),
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
shorewall-conntrack(5), shorewall-ecn(5), shorewall-exclusion(5),
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
shorewall-hosts(5), shorewall-init(5), shorewall_interfaces(5),
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
shorewall-ipsets(5), shorewall-logging(), shorewall-maclist(5),
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
shorewall-mangle(5), shorewall-masq(5), shorewall-modules(5),
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
shorewall-nat(5), shorewall-nesting(5), shorewall-netmap(5),
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcclasses(5),
|
||||||
shorewall-params(5), shorewall-policy(5), shorewall-providers(5),
|
shorewall-tcdevices(5), shorewall-tcrules(5), shorewall-tos(5),
|
||||||
shorewall-proxyarp(5), shorewall6-proxyndp(5), shorewall-routes(5),
|
shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
shorewall-rtrules(5), shorewall-rtrules(5), shorewall-rules(5),
|
|
||||||
shorewall-secmarks(5), shorewall-snat(5), shorewall-tcclasses(5),
|
|
||||||
shorewall-tcdevices(5), shorewall-tcfilters(5), shorewall-tcinterfaces(5),
|
|
||||||
shorewall-tcpri(5), shorewall-tunnels(5), shorewall-vardir(5),
|
|
||||||
shorewall-zones(5)</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Shorewall Packet Filtering Firewall Control Program - V5.1
|
# Shorewall Packet Filtering Firewall Control Program - V5.0
|
||||||
#
|
#
|
||||||
# (c) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2014,2015-2017
|
# (c) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2014,2015 -
|
||||||
# Tom Eastep (teastep@shorewall.net)
|
# Tom Eastep (teastep@shorewall.net)
|
||||||
#
|
#
|
||||||
# Shorewall documentation is available at http://www.shorewall.net
|
# Shorewall documentation is available at http://www.shorewall.net
|
||||||
@@ -25,10 +25,6 @@
|
|||||||
# For a list of supported commands, type 'shorewall help' or 'shorewall6 help'
|
# For a list of supported commands, type 'shorewall help' or 'shorewall6 help'
|
||||||
#
|
#
|
||||||
################################################################################################
|
################################################################################################
|
||||||
#
|
|
||||||
# Default product is Shorewall. PRODUCT will be set based on $0 and on passed -[46] and -l
|
|
||||||
# options
|
|
||||||
#
|
|
||||||
PRODUCT=shorewall
|
PRODUCT=shorewall
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@@ -73,16 +73,12 @@ setstatedir() {
|
|||||||
|
|
||||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
||||||
|
|
||||||
if [ -x ${STATEDIR}/firewall ]; then
|
if [ $PRODUCT = shorewall ]; then
|
||||||
return 0
|
${SBINDIR}/shorewall compile
|
||||||
|
elif [ $PRODUCT = shorewall6 ]; then
|
||||||
|
${SBINDIR}/shorewall -6 compile
|
||||||
else
|
else
|
||||||
if [ $PRODUCT = shorewall ]; then
|
return 0
|
||||||
${SBINDIR}/shorewall compile
|
|
||||||
elif [ $PRODUCT = shorewall6 ]; then
|
|
||||||
${SBINDIR}/shorewall -6 compile
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,14 +108,16 @@ shorewall_start () {
|
|||||||
|
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
#
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
# Run in a sub-shell to avoid name collisions
|
#
|
||||||
#
|
# Run in a sub-shell to avoid name collisions
|
||||||
(
|
#
|
||||||
if ! ${STATEDIR}/firewall status > /dev/null 2>&1; then
|
(
|
||||||
${STATEDIR}/firewall ${OPTIONS} stop
|
if ! ${STATEDIR}/firewall status > /dev/null 2>&1; then
|
||||||
fi
|
${STATEDIR}/firewall ${OPTIONS} stop
|
||||||
)
|
fi
|
||||||
|
)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -147,7 +145,9 @@ shorewall_stop () {
|
|||||||
printf "Clearing \"Shorewall-based firewalls\": "
|
printf "Clearing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} clear
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
|
${STATEDIR}/firewall ${OPTIONS} clear
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -159,9 +159,8 @@ shorewall_stop () {
|
|||||||
|
|
||||||
mkdir -p $(dirname "$SAVE_IPSETS")
|
mkdir -p $(dirname "$SAVE_IPSETS")
|
||||||
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
||||||
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS" || rm -f "${SAVE_IPSETS}.tmp"
|
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS"
|
||||||
else
|
else
|
||||||
rm -f "${SAVE_IPSETS}.tmp"
|
|
||||||
echo_notdone
|
echo_notdone
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -44,14 +44,12 @@ setstatedir() {
|
|||||||
|
|
||||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
||||||
|
|
||||||
if [ -x ${STATEDIR}/firewall ]; then
|
if [ $PRODUCT = shorewall ]; then
|
||||||
return 0
|
|
||||||
elif [ $PRODUCT = shorewall ]; then
|
|
||||||
${SBINDIR}/shorewall compile
|
${SBINDIR}/shorewall compile
|
||||||
elif [ $PRODUCT = shorewall6 ]; then
|
elif [ $PRODUCT = shorewall6 ]; then
|
||||||
${SBINDIR}/shorewall -6 compile
|
${SBINDIR}/shorewall -6 compile
|
||||||
else
|
else
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,20 +66,20 @@ start () {
|
|||||||
|
|
||||||
printf "Initializing \"Shorewall-based firewalls\": "
|
printf "Initializing \"Shorewall-based firewalls\": "
|
||||||
|
|
||||||
if [ -n "$SAVE_IPSETS" -a -f "$SAVE_IPSETS" ]; then
|
|
||||||
ipset -R < "$SAVE_IPSETS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
setstatedir
|
setstatedir
|
||||||
retval=$?
|
retval=$?
|
||||||
|
|
||||||
if [ $retval -eq 0 ]; then
|
if [ $retval -eq 0 ]; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} stop 2>&1 | $logger
|
if [ -x "${STATEDIR}/firewall" ]; then
|
||||||
retval=${PIPESTATUS[0]}
|
${STATEDIR}/firewall ${OPTIONS} stop 2>&1 | $logger
|
||||||
[ $retval -ne 0 ] && break
|
retval=${PIPESTATUS[0]}
|
||||||
|
[ $retval -ne 0 ] && break
|
||||||
|
else
|
||||||
|
retval=6 #Product not configured
|
||||||
|
break
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
retval=6 #Product not configured
|
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -108,25 +106,20 @@ stop () {
|
|||||||
retval=$?
|
retval=$?
|
||||||
|
|
||||||
if [ $retval -eq 0 ]; then
|
if [ $retval -eq 0 ]; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} clear 2>&1 | $logger
|
if [ -x "${STATEDIR}/firewall" ]; then
|
||||||
retval=${PIPESTATUS[0]}
|
${STATEDIR}/firewall ${OPTIONS} clear 2>&1 | $logger
|
||||||
[ $retval -ne 0 ] && break
|
retval=${PIPESTATUS[0]}
|
||||||
|
[ $retval -ne 0 ] && break
|
||||||
|
else
|
||||||
|
retval=6 #Product not configured
|
||||||
|
break
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
retval=6 #Product not configured
|
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $retval -eq 0 ]; then
|
if [ $retval -eq 0 ]; then
|
||||||
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" || rm -f "${SAVE_IPSETS}.tmp"
|
|
||||||
else
|
|
||||||
rm -f "${SAVE_IPSETS}.tmp"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f $lockfile
|
rm -f $lockfile
|
||||||
success
|
success
|
||||||
else
|
else
|
||||||
|
24
Shorewall-init/init.openwrt.sh
Executable file → Normal file
24
Shorewall-init/init.openwrt.sh
Executable file → Normal file
@@ -75,14 +75,12 @@ setstatedir() {
|
|||||||
|
|
||||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
||||||
|
|
||||||
if [ -x ${STATEDIR}/firewall ]; then
|
if [ $PRODUCT = shorewall ]; then
|
||||||
return 0
|
|
||||||
elif [ $PRODUCT = shorewall ]; then
|
|
||||||
${SBINDIR}/shorewall compile
|
${SBINDIR}/shorewall compile
|
||||||
elif [ $PRODUCT = shorewall6 ]; then
|
elif [ $PRODUCT = shorewall6 ]; then
|
||||||
${SBINDIR}/shorewall -6 compile
|
${SBINDIR}/shorewall -6 compile
|
||||||
else
|
else
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,8 +92,10 @@ start () {
|
|||||||
printf "Initializing \"Shorewall-based firewalls\": "
|
printf "Initializing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} stop
|
if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
|
||||||
|
${STATEDIR}/firewall ${OPTIONS} stop
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -103,8 +103,6 @@ start () {
|
|||||||
if [ -n "$SAVE_IPSETS" -a -f "$SAVE_IPSETS" ]; then
|
if [ -n "$SAVE_IPSETS" -a -f "$SAVE_IPSETS" ]; then
|
||||||
ipset -R < "$SAVE_IPSETS"
|
ipset -R < "$SAVE_IPSETS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boot () {
|
boot () {
|
||||||
@@ -119,19 +117,17 @@ stop () {
|
|||||||
printf "Clearing \"Shorewall-based firewalls\": "
|
printf "Clearing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} clear
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
|
${STATEDIR}/firewall ${OPTIONS} clear
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -n "$SAVE_IPSETS" ]; then
|
if [ -n "$SAVE_IPSETS" ]; then
|
||||||
mkdir -p $(dirname "$SAVE_IPSETS")
|
mkdir -p $(dirname "$SAVE_IPSETS")
|
||||||
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
||||||
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS" || rm -f "${SAVE_IPSETS}.tmp"
|
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS"
|
||||||
else
|
|
||||||
rm -f "${SAVE_IPSETS}.tmp"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -69,12 +69,10 @@ setstatedir() {
|
|||||||
|
|
||||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
||||||
|
|
||||||
if [ -x ${STATEDIR}/firewall ]; then
|
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||||
return 0
|
|
||||||
elif [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
|
||||||
${SBINDIR}/$PRODUCT ${OPTIONS} compile $STATEDIR/firewall
|
${SBINDIR}/$PRODUCT ${OPTIONS} compile $STATEDIR/firewall
|
||||||
else
|
else
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,8 +84,10 @@ shorewall_start () {
|
|||||||
printf "Initializing \"Shorewall-based firewalls\": "
|
printf "Initializing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} stop
|
if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
|
||||||
|
${STATEDIR}/firewall ${OPTIONS} stop
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -107,16 +107,16 @@ shorewall_stop () {
|
|||||||
printf "Clearing \"Shorewall-based firewalls\": "
|
printf "Clearing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} clear
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
|
${STATEDIR}/firewall ${OPTIONS} clear
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -n "$SAVE_IPSETS" ]; then
|
if [ -n "$SAVE_IPSETS" ]; then
|
||||||
mkdir -p $(dirname "$SAVE_IPSETS")
|
mkdir -p $(dirname "$SAVE_IPSETS")
|
||||||
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
||||||
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS" || rm -f "${SAVE_IPSETS}.tmp"
|
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS"
|
||||||
else
|
|
||||||
rm -f "${SAVE_IPSETS}.tmp"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -79,14 +79,12 @@ setstatedir() {
|
|||||||
|
|
||||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
||||||
|
|
||||||
if [ -x ${STATEDIR}/firewall ]; then
|
if [ $PRODUCT = shorewall ]; then
|
||||||
return 0
|
|
||||||
elif [ $PRODUCT = shorewall ]; then
|
|
||||||
${SBINDIR}/shorewall compile
|
${SBINDIR}/shorewall compile
|
||||||
elif [ $PRODUCT = shorewall6 ]; then
|
elif [ $PRODUCT = shorewall6 ]; then
|
||||||
${SBINDIR}/shorewall -6 compile
|
${SBINDIR}/shorewall -6 compile
|
||||||
else
|
else
|
||||||
return 6
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,8 +96,10 @@ shorewall_start () {
|
|||||||
printf "Initializing \"Shorewall-based firewalls\": "
|
printf "Initializing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
|
if [ -x $STATEDIR/firewall ]; then
|
||||||
$STATEDIR/$PRODUCT/firewall ${OPTIONS} stop
|
if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
|
||||||
|
$STATEDIR/$PRODUCT/firewall ${OPTIONS} stop
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -117,16 +117,16 @@ shorewall_stop () {
|
|||||||
printf "Clearing \"Shorewall-based firewalls\": "
|
printf "Clearing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} clear
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
|
${STATEDIR}/firewall ${OPTIONS} clear
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -n "$SAVE_IPSETS" ]; then
|
if [ -n "$SAVE_IPSETS" ]; then
|
||||||
mkdir -p $(dirname "$SAVE_IPSETS")
|
mkdir -p $(dirname "$SAVE_IPSETS")
|
||||||
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
||||||
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS" || rm -f "${SAVE_IPSETS}.tmp"
|
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS"
|
||||||
else
|
|
||||||
rm -f "${SAVE_IPSETS}.tmp"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@@ -33,12 +33,12 @@ setstatedir() {
|
|||||||
|
|
||||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
|
||||||
|
|
||||||
if [ -x ${STATEDIR}/firewall ]; then
|
if [ $PRODUCT = shorewall ]; then
|
||||||
return 0
|
|
||||||
elif [ $PRODUCT = shorewall ]; then
|
|
||||||
${SBINDIR}/shorewall compile
|
${SBINDIR}/shorewall compile
|
||||||
elif [ $PRODUCT = shorewall6 ]; then
|
elif [ $PRODUCT = shorewall6 ]; then
|
||||||
${SBINDIR}/shorewall -6 compile
|
${SBINDIR}/shorewall -6 compile
|
||||||
|
else
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,14 +67,16 @@ shorewall_start () {
|
|||||||
printf "Initializing \"Shorewall-based firewalls\": "
|
printf "Initializing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
#
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
# Run in a sub-shell to avoid name collisions
|
#
|
||||||
#
|
# Run in a sub-shell to avoid name collisions
|
||||||
(
|
#
|
||||||
if ! ${STATEDIR}/firewall status > /dev/null 2>&1; then
|
(
|
||||||
${STATEDIR}/firewall ${OPTIONS} stop
|
if ! ${STATEDIR}/firewall status > /dev/null 2>&1; then
|
||||||
fi
|
${STATEDIR}/firewall ${OPTIONS} stop
|
||||||
)
|
fi
|
||||||
|
)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -93,16 +95,16 @@ shorewall_stop () {
|
|||||||
printf "Clearing \"Shorewall-based firewalls\": "
|
printf "Clearing \"Shorewall-based firewalls\": "
|
||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
if setstatedir; then
|
if setstatedir; then
|
||||||
${STATEDIR}/firewall ${OPTIONS} clear
|
if [ -x ${STATEDIR}/firewall ]; then
|
||||||
|
${STATEDIR}/firewall ${OPTIONS} clear
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -n "$SAVE_IPSETS" ]; then
|
if [ -n "$SAVE_IPSETS" ]; then
|
||||||
mkdir -p $(dirname "$SAVE_IPSETS")
|
mkdir -p $(dirname "$SAVE_IPSETS")
|
||||||
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
if ipset -S > "${SAVE_IPSETS}.tmp"; then
|
||||||
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS" || rm -f "${SAVE_IPSETS}.tmp"
|
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS"
|
||||||
else
|
|
||||||
rm -f "${SAVE_IPSETS}.tmp"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#
|
#
|
||||||
# On the target system (the system where the firewall program is to run):
|
# On the target system (the system where the firewall program is to run):
|
||||||
#
|
#
|
||||||
# [ IPTABLES=<iptables binary> ] [ MODULESDIR=<kernel modules directory> ] shorecap > capabilities
|
# [ IPTABLES=<iptables binary> ] [ MODULESDIR=<kernel modules directory> ] [ MODULE_SUFFIX="<module suffix list>" ] shorecap > capabilities
|
||||||
#
|
#
|
||||||
# Now move the capabilities file to the compilation system. The file must
|
# Now move the capabilities file to the compilation system. The file must
|
||||||
# be placed in a directory on the CONFIG_PATH to be used when compiling firewalls
|
# be placed in a directory on the CONFIG_PATH to be used when compiling firewalls
|
||||||
@@ -38,6 +38,7 @@
|
|||||||
#
|
#
|
||||||
# IPTABLES - iptables
|
# IPTABLES - iptables
|
||||||
# MODULESDIR - /lib/modules/$(uname -r)/kernel/net/ipv4/netfilter
|
# MODULESDIR - /lib/modules/$(uname -r)/kernel/net/ipv4/netfilter
|
||||||
|
# MODULE_SUFFIX - "o gz xz ko o.gz o.xz ko.gz ko.xz"
|
||||||
#
|
#
|
||||||
# Shorewall need not be installed on the target system to run shorecap. If the '-e' flag is
|
# Shorewall need not be installed on the target system to run shorecap. If the '-e' flag is
|
||||||
# used during firewall compilation, then the generated firewall program will likewise not
|
# used during firewall compilation, then the generated firewall program will likewise not
|
||||||
|
@@ -13,6 +13,7 @@ DEFAULTS ACCEPT
|
|||||||
@1 - - icmp time-exceeded {comment="Needed ICMP types"}
|
@1 - - icmp time-exceeded {comment="Needed ICMP types"}
|
||||||
?else
|
?else
|
||||||
?COMMENT Needed ICMP types (RFC4890)
|
?COMMENT Needed ICMP types (RFC4890)
|
||||||
|
|
||||||
@1 - - ipv6-icmp destination-unreachable
|
@1 - - ipv6-icmp destination-unreachable
|
||||||
@1 - - ipv6-icmp packet-too-big
|
@1 - - ipv6-icmp packet-too-big
|
||||||
@1 - - ipv6-icmp time-exceeded
|
@1 - - ipv6-icmp time-exceeded
|
||||||
@@ -37,7 +38,7 @@ DEFAULTS ACCEPT
|
|||||||
@1 - - ipv6-icmp 148 # Certificate path solicitation
|
@1 - - ipv6-icmp 148 # Certificate path solicitation
|
||||||
@1 - - ipv6-icmp 149 # Certificate path advertisement
|
@1 - - ipv6-icmp 149 # Certificate path advertisement
|
||||||
|
|
||||||
# The following should have a link local source address and a ttl of 1 and must be allowed to transit a bridge
|
# The following should have a link local source address and a ttl of 1 and must be allowed to transit abridge
|
||||||
@1 fe80::/10 - ipv6-icmp 151 # Multicast router advertisement
|
@1 fe80::/10 - ipv6-icmp 151 # Multicast router advertisement
|
||||||
@1 fe80::/10 - ipv6-icmp 152 # Multicast router solicitation
|
@1 fe80::/10 - ipv6-icmp 152 # Multicast router solicitation
|
||||||
@1 fe80::/10 - ipv6-icmp 153 # Multicast router termination
|
@1 fe80::/10 - ipv6-icmp 153 # Multicast router termination
|
||||||
|
@@ -1,33 +0,0 @@
|
|||||||
#
|
|
||||||
# Shorewall -- /usr/share/shorewall/action.FIN
|
|
||||||
#
|
|
||||||
# FIN Action
|
|
||||||
#
|
|
||||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
|
||||||
#
|
|
||||||
# (c) 2012-2016 Tom Eastep (teastep@shorewall.net)
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# FIN[([<action>])]
|
|
||||||
#
|
|
||||||
# Default action is ACCEPT
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
DEFAULTS ACCEPT,-
|
|
||||||
|
|
||||||
@1 - - ;;+ -p 6 --tcp-flags ACK,FIN ACK,FIN
|
|
@@ -107,11 +107,6 @@ if ( $command & $REAP_OPT ) {
|
|||||||
|
|
||||||
$duration .= '--rttl ' if $command & $TTL_OPT;
|
$duration .= '--rttl ' if $command & $TTL_OPT;
|
||||||
|
|
||||||
if ( ( $targets{$action} || 0 ) & NATRULE ) {
|
|
||||||
perl_action_helper( "${action}-", "-m recent --rcheck ${duration}--hitcount $hitcount" );
|
|
||||||
$action = 'ACCEPT';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $command & $RESET_CMD ) {
|
if ( $command & $RESET_CMD ) {
|
||||||
require_capability 'MARK_ANYWHERE', '"reset"', 's';
|
require_capability 'MARK_ANYWHERE', '"reset"', 's';
|
||||||
|
|
||||||
|
@@ -41,11 +41,6 @@ fatal_error "Invalid Src or Dest ($destination)" unless $destination =~ /^(?:src
|
|||||||
set_action_disposition( $disposition) if supplied $disposition;
|
set_action_disposition( $disposition) if supplied $disposition;
|
||||||
set_action_name_to_caller;
|
set_action_name_to_caller;
|
||||||
|
|
||||||
if ( ( $targets{$action} || 0 ) & NATRULE ) {
|
|
||||||
perl_action_helper( "${action}-", "" );
|
|
||||||
$action = 'ACCEPT';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $destination eq 'dst' ) {
|
if ( $destination eq 'dst' ) {
|
||||||
perl_action_helper( $action, '', '', "-m recent --name $event --remove --rdest" );
|
perl_action_helper( $action, '', '', "-m recent --name $event --remove --rdest" );
|
||||||
} else {
|
} else {
|
||||||
|
@@ -37,11 +37,6 @@ fatal_error "Invalid Src or Dest ($destination)" unless $destination =~ /^(?:src
|
|||||||
set_action_disposition( $disposition) if supplied $disposition;
|
set_action_disposition( $disposition) if supplied $disposition;
|
||||||
set_action_name_to_caller;
|
set_action_name_to_caller;
|
||||||
|
|
||||||
if ( ( $targets{$action} || 0 ) & NATRULE ) {
|
|
||||||
perl_action_helper( "${action}-", "" );
|
|
||||||
$action = 'ACCEPT';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $destination eq 'dst' ) {
|
if ( $destination eq 'dst' ) {
|
||||||
perl_action_helper( $action, '', '', "-m recent --name $event --set --rdest" );
|
perl_action_helper( $action, '', '', "-m recent --name $event --set --rdest" );
|
||||||
} else {
|
} else {
|
||||||
|
@@ -26,4 +26,4 @@ $tcpflags_action - - ;;+ -p 6 --tcp-flags ALL FIN,URG,PSH
|
|||||||
$tcpflags_action - - ;;+ -p 6 --tcp-flags ALL NONE
|
$tcpflags_action - - ;;+ -p 6 --tcp-flags ALL NONE
|
||||||
$tcpflags_action - - ;;+ -p 6 --tcp-flags SYN,RST SYN,RST
|
$tcpflags_action - - ;;+ -p 6 --tcp-flags SYN,RST SYN,RST
|
||||||
$tcpflags_action - - ;;+ -p 6 --tcp-flags SYN,FIN SYN,FIN
|
$tcpflags_action - - ;;+ -p 6 --tcp-flags SYN,FIN SYN,FIN
|
||||||
$tcpflags_action - - ;;+ -p 6 --syn --sport 0
|
$tcpflags_action - - ;;+ -p tcp --syn --sport 0
|
||||||
|
@@ -1,39 +0,0 @@
|
|||||||
#
|
|
||||||
# Shorewall -- /usr/share/shorewall/action.dropBcasts
|
|
||||||
#
|
|
||||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
|
||||||
#
|
|
||||||
# (c) 2017 Tom Eastep (teastep@shorewall.net)
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# dropBcasts[([audit])]
|
|
||||||
#
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
DEFAULTS -
|
|
||||||
|
|
||||||
?if passed(@1)
|
|
||||||
?if @1 eq 'audit'
|
|
||||||
?require AUDIT_TARGET
|
|
||||||
Broadcast(A_DROP)
|
|
||||||
?else
|
|
||||||
?error "Invalid argument (@1) to dropBcasts"
|
|
||||||
?endif
|
|
||||||
?else
|
|
||||||
Broadcast(DROP)
|
|
||||||
?endif
|
|
||||||
|
|
@@ -15,7 +15,6 @@ PARAM - - tcp 3668,3669 # Virtual Media, Secure (Dell)
|
|||||||
PARAM - - tcp 5120,5123 # CD, floppy (Asus, Aten)
|
PARAM - - tcp 5120,5123 # CD, floppy (Asus, Aten)
|
||||||
PARAM - - tcp 5900,5901 # Remote Console (Aten, Dell)
|
PARAM - - tcp 5900,5901 # Remote Console (Aten, Dell)
|
||||||
PARAM - - tcp 7578 # Remote Console (AMI)
|
PARAM - - tcp 7578 # Remote Console (AMI)
|
||||||
PARAM - - tcp 3520 # Remote Console (Redfish)
|
|
||||||
PARAM - - udp 623 # RMCP
|
PARAM - - udp 623 # RMCP
|
||||||
HTTP
|
HTTP
|
||||||
HTTPS
|
HTTPS
|
||||||
|
@@ -6,5 +6,4 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER
|
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER
|
||||||
|
|
||||||
PARAM - - udp 3389
|
|
||||||
PARAM - - tcp 3389
|
PARAM - - tcp 3389
|
||||||
|
82
Shorewall/Makefile-lite
Normal file
82
Shorewall/Makefile-lite
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
# Shorewall Packet Filtering Firewall Export Directory Makefile - V4.2
|
||||||
|
#
|
||||||
|
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||||
|
#
|
||||||
|
# (c) 2006 - Tom Eastep (teastep@shorewall.net)
|
||||||
|
#
|
||||||
|
# Shorewall documentation is available at http://www.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.
|
||||||
|
################################################################################
|
||||||
|
# Place this file in each export directory. Modify each copy to set HOST
|
||||||
|
# to the name of the remote firewall corresponding to the directory.
|
||||||
|
#
|
||||||
|
# To make the 'firewall' script, type "make".
|
||||||
|
#
|
||||||
|
# Once the script is compiling correctly, you can install it by
|
||||||
|
# typing "make install".
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
# V A R I A B L E S
|
||||||
|
#
|
||||||
|
# Files in the export directory on which the firewall script does not depend
|
||||||
|
#
|
||||||
|
IGNOREFILES = firewall% Makefile% trace% %~
|
||||||
|
#
|
||||||
|
# Remote Firewall system
|
||||||
|
#
|
||||||
|
HOST = gateway
|
||||||
|
#
|
||||||
|
# Save some typing
|
||||||
|
#
|
||||||
|
LITEDIR = /var/lib/shorewall-lite
|
||||||
|
#
|
||||||
|
# Set this if the remote system has a non-standard modules directory
|
||||||
|
#
|
||||||
|
MODULESDIR=
|
||||||
|
#
|
||||||
|
# Default target is the firewall script
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
# T A R G E T S
|
||||||
|
#
|
||||||
|
all: firewall
|
||||||
|
#
|
||||||
|
# Only generate the capabilities file if it doesn't already exist
|
||||||
|
#
|
||||||
|
capabilities:
|
||||||
|
ssh root@$(HOST) "MODULESDIR=$(MODULESDIR) /usr/share/shorewall-lite/shorecap > $(LITEDIR)/capabilities"
|
||||||
|
scp root@$(HOST):$(LITEDIR)/capabilities .
|
||||||
|
#
|
||||||
|
# Compile the firewall script. Using the 'wildcard' function causes "*" to be expanded so that
|
||||||
|
# 'filter-out' will be presented with the list of files in this directory rather than "*"
|
||||||
|
#
|
||||||
|
firewall: $(filter-out $(IGNOREFILES) capabilities , $(wildcard *) ) capabilities
|
||||||
|
shorewall compile -e . firewall
|
||||||
|
#
|
||||||
|
# Only reload on demand.
|
||||||
|
#
|
||||||
|
install: firewall
|
||||||
|
scp firewall firewall.conf root@$(HOST):$(LITEDIR)
|
||||||
|
ssh root@$(HOST) "/sbin/shorewall-lite restart"
|
||||||
|
#
|
||||||
|
# Save running configuration
|
||||||
|
#
|
||||||
|
save:
|
||||||
|
ssh root@$(HOST) "/sbin/shorewall-lite save"
|
||||||
|
#
|
||||||
|
# Remove generated files
|
||||||
|
#
|
||||||
|
clean:
|
||||||
|
rm -f capabilities firewall firewall.conf reload
|
@@ -195,7 +195,7 @@ sub process_accounting_rule1( $$$$$$$$$$$ ) {
|
|||||||
$ports = '' if $ports eq 'any' || $ports eq 'all';
|
$ports = '' if $ports eq 'any' || $ports eq 'all';
|
||||||
$sports = '' if $sports eq 'any' || $sports eq 'all';
|
$sports = '' if $sports eq 'any' || $sports eq 'all';
|
||||||
|
|
||||||
fatal_error "USER/GROUP may only be specified in the OUTPUT section" unless $user eq '-' || $asection == OUTPUT_SECTION;
|
fatal_error "USER/GROUP may only be specified in the OUTPUT section" unless $user eq '-' || $asection == OUTPUT;
|
||||||
|
|
||||||
my $rule = do_proto( $proto, $ports, $sports ) . do_user ( $user ) . do_test ( $mark, $globals{TC_MASK} ) . do_headers( $headers );
|
my $rule = do_proto( $proto, $ports, $sports ) . do_user ( $user ) . do_test ( $mark, $globals{TC_MASK} ) . do_headers( $headers );
|
||||||
my $prerule = '';
|
my $prerule = '';
|
||||||
@@ -266,7 +266,7 @@ sub process_accounting_rule1( $$$$$$$$$$$ ) {
|
|||||||
if ( $source eq 'any' || $source eq 'all' ) {
|
if ( $source eq 'any' || $source eq 'all' ) {
|
||||||
$source = ALLIP;
|
$source = ALLIP;
|
||||||
} else {
|
} else {
|
||||||
fatal_error "MAC addresses only allowed in the INPUT and FORWARD sections" if $source =~ /~/ && ( $asection == OUTPUT_SECTION || ! $asection );
|
fatal_error "MAC addresses only allowed in the INPUT and FORWARD sections" if $source =~ /~/ && ( $asection == OUTPUT || ! $asection );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( have_bridges && ! $asection ) {
|
if ( have_bridges && ! $asection ) {
|
||||||
|
@@ -32,7 +32,6 @@ require Exporter;
|
|||||||
use Scalar::Util 'reftype';
|
use Scalar::Util 'reftype';
|
||||||
use Digest::SHA qw(sha1_hex);
|
use Digest::SHA qw(sha1_hex);
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
use Socket;
|
|
||||||
use Shorewall::Config qw(:DEFAULT :internal);
|
use Shorewall::Config qw(:DEFAULT :internal);
|
||||||
use Shorewall::Zones;
|
use Shorewall::Zones;
|
||||||
use Shorewall::IPAddrs;
|
use Shorewall::IPAddrs;
|
||||||
@@ -138,12 +137,6 @@ our %EXPORT_TAGS = (
|
|||||||
ALL_COMMANDS
|
ALL_COMMANDS
|
||||||
NOT_RESTORE
|
NOT_RESTORE
|
||||||
|
|
||||||
validate_port
|
|
||||||
validate_portpair
|
|
||||||
validate_portpair1
|
|
||||||
validate_port_list
|
|
||||||
expand_port_range
|
|
||||||
|
|
||||||
PREROUTING
|
PREROUTING
|
||||||
INPUT
|
INPUT
|
||||||
FORWARD
|
FORWARD
|
||||||
@@ -516,7 +509,6 @@ our $idiotcount1;
|
|||||||
our $hashlimitset;
|
our $hashlimitset;
|
||||||
our $global_variables;
|
our $global_variables;
|
||||||
our %address_variables;
|
our %address_variables;
|
||||||
our %port_variables;
|
|
||||||
our $ipset_rules;
|
our $ipset_rules;
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -792,7 +784,6 @@ sub initialize( $$$ ) {
|
|||||||
%interfaceacasts = ();
|
%interfaceacasts = ();
|
||||||
%interfacegateways = ();
|
%interfacegateways = ();
|
||||||
%address_variables = ();
|
%address_variables = ();
|
||||||
%port_variables = ();
|
|
||||||
|
|
||||||
$global_variables = 0;
|
$global_variables = 0;
|
||||||
$idiotcount = 0;
|
$idiotcount = 0;
|
||||||
@@ -828,211 +819,6 @@ sub initialize( $$$ ) {
|
|||||||
#
|
#
|
||||||
}
|
}
|
||||||
|
|
||||||
sub record_runtime_port( $ ) {
|
|
||||||
my ( $variable ) = @_;
|
|
||||||
|
|
||||||
if ( $variable =~ /^{([a-zA-Z_]\w*)}$/ ) {
|
|
||||||
fatal_error "Variable %variable is already used as an address variable" if $address_variables{$1};
|
|
||||||
$port_variables{$1} = 1;
|
|
||||||
} else {
|
|
||||||
fatal_error( "Invalid port variable (%$variable)" );
|
|
||||||
}
|
|
||||||
|
|
||||||
"\$$variable";
|
|
||||||
}
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Functions moved from IPAddrs.pm in 5.1.5 #
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
sub validate_port( $$ ) {
|
|
||||||
my ($proto, $port) = @_;
|
|
||||||
|
|
||||||
my $value;
|
|
||||||
|
|
||||||
if ( $port =~ /^(\d+)$/ || $port =~ /^0x/ ) {
|
|
||||||
$value = numeric_value $port;
|
|
||||||
|
|
||||||
if ( defined $value ) {
|
|
||||||
if ( $value && $value <= 65535 ) {
|
|
||||||
return $value;
|
|
||||||
} else {
|
|
||||||
$value = undef;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} elsif ( $port =~ /^%(.*)/ ) {
|
|
||||||
$value = record_runtime_port( $1 );
|
|
||||||
} else {
|
|
||||||
$proto = proto_name $proto if $proto =~ /^(\d+)$/;
|
|
||||||
$value = getservbyname( $port, $proto );
|
|
||||||
}
|
|
||||||
|
|
||||||
return $value if defined $value;
|
|
||||||
|
|
||||||
fatal_error "The separator for a port range is ':', not '-' ($port)" if $port =~ /^\d+-\d+$/;
|
|
||||||
|
|
||||||
fatal_error "Invalid/Unknown $proto port/service ($_[1])" unless defined $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub validate_portpair( $$ ) {
|
|
||||||
my ($proto, $portpair) = @_;
|
|
||||||
my $what;
|
|
||||||
my $pair = $portpair;
|
|
||||||
#
|
|
||||||
# Accept '-' as a port-range separator
|
|
||||||
#
|
|
||||||
$pair =~ tr/-/:/ if $pair =~ /^[-0-9]+$/;
|
|
||||||
|
|
||||||
fatal_error "Invalid port range ($portpair)" if $pair =~ tr/:/:/ > 1;
|
|
||||||
|
|
||||||
$pair = "0$pair" if substr( $pair, 0, 1 ) eq ':';
|
|
||||||
$pair = "${pair}65535" if substr( $pair, -1, 1 ) eq ':';
|
|
||||||
|
|
||||||
my @ports = split /:/, $pair, 2;
|
|
||||||
|
|
||||||
my $protonum = resolve_proto( $proto ) || 0;
|
|
||||||
|
|
||||||
$_ = validate_port( $protonum, $_) for grep $_, @ports;
|
|
||||||
|
|
||||||
if ( @ports == 2 ) {
|
|
||||||
$what = 'port range';
|
|
||||||
|
|
||||||
unless ($ports[0] =~ /^\$/ || $ports[1] =~ /^\$/ ) {
|
|
||||||
fatal_error "Invalid port range ($_[1])" unless $ports[0] < $ports[1];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$what = 'port';
|
|
||||||
}
|
|
||||||
|
|
||||||
fatal_error "Using a $what ( $_[1] ) requires PROTO TCP, UDP, UDPLITE, SCTP or DCCP" unless
|
|
||||||
defined $protonum && ( $protonum == TCP ||
|
|
||||||
$protonum == UDP ||
|
|
||||||
$protonum == UDPLITE ||
|
|
||||||
$protonum == SCTP ||
|
|
||||||
$protonum == DCCP );
|
|
||||||
join ':', @ports;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
sub validate_portpair1( $$ ) {
|
|
||||||
my ($proto, $portpair) = @_;
|
|
||||||
my $what;
|
|
||||||
|
|
||||||
fatal_error "Invalid port range ($portpair)" if $portpair =~ tr/-/-/ > 1;
|
|
||||||
|
|
||||||
$portpair = "1$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';
|
|
||||||
|
|
||||||
unless ($ports[0] =~ /^\$/ || $ports[1] =~ /^\$/ ) {
|
|
||||||
fatal_error "Invalid port range ($portpair)" unless $ports[0] && $ports[0] < $ports[1];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$what = 'port';
|
|
||||||
fatal_error 'Invalid port number (0)' unless $portpair;
|
|
||||||
}
|
|
||||||
|
|
||||||
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( $$ ) {
|
|
||||||
my $result = '';
|
|
||||||
my ( $proto, $list ) = @_;
|
|
||||||
my @list = split_list( $list, 'port' );
|
|
||||||
|
|
||||||
if ( @list > 1 && $list =~ /[:-]/ ) {
|
|
||||||
require_capability( 'XMULTIPORT' , 'Port ranges in a port list', '' );
|
|
||||||
}
|
|
||||||
|
|
||||||
$proto = proto_name $proto;
|
|
||||||
|
|
||||||
for ( @list ) {
|
|
||||||
my $value = validate_portpair( $proto , $_ );
|
|
||||||
$result = $result ? join ',', $result, $value : $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
$result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#
|
|
||||||
# Expands a port range into a minimal list of ( port, mask ) pairs.
|
|
||||||
# Each port and mask are expressed as 4 hex nibbles without a leading '0x'.
|
|
||||||
#
|
|
||||||
# Example:
|
|
||||||
#
|
|
||||||
# DB<3> @foo = Shorewall::IPAddrs::expand_port_range( 6, '110:' ); print "@foo\n"
|
|
||||||
# 006e fffe 0070 fff0 0080 ff80 0100 ff00 0200 fe00 0400 fc00 0800 f800 1000 f000 2000 e000 4000 c000 8000 8000
|
|
||||||
#
|
|
||||||
sub expand_port_range( $$ ) {
|
|
||||||
my ( $proto, $range ) = @_;
|
|
||||||
|
|
||||||
if ( $range =~ /^(.*):(.*)$/ ) {
|
|
||||||
my ( $first, $last ) = ( $1, $2);
|
|
||||||
my @result;
|
|
||||||
|
|
||||||
fatal_error "Invalid port range ($range)" unless $first ne '' or $last ne '';
|
|
||||||
#
|
|
||||||
# Supply missing first/last port number
|
|
||||||
#
|
|
||||||
$first = 0 if $first eq '';
|
|
||||||
$last = 65535 if $last eq '';
|
|
||||||
#
|
|
||||||
# Validate the ports
|
|
||||||
#
|
|
||||||
( $first , $last ) = ( validate_port( $proto, $first || 1 ) , validate_port( $proto, $last ) );
|
|
||||||
|
|
||||||
$last++; #Increment last address for limit testing.
|
|
||||||
#
|
|
||||||
# Break the range into groups:
|
|
||||||
#
|
|
||||||
# - If the first port in the remaining range is odd, then the next group is ( <first>, ffff ).
|
|
||||||
# - Otherwise, find the largest power of two P that divides the first address such that
|
|
||||||
# the remaining range has less than or equal to P ports. The next group is
|
|
||||||
# ( <first> , ~( P-1 ) ).
|
|
||||||
#
|
|
||||||
while ( ( my $ports = ( $last - $first ) ) > 0 ) {
|
|
||||||
my $mask = 0xffff; #Mask for current ports in group.
|
|
||||||
my $y = 2; #Next power of two to test
|
|
||||||
my $z = 1; #Number of ports in current group (Previous value of $y).
|
|
||||||
|
|
||||||
while ( ( ! ( $first % $y ) ) && ( $y <= $ports ) ) {
|
|
||||||
$mask <<= 1;
|
|
||||||
$z = $y;
|
|
||||||
$y <<= 1;
|
|
||||||
}
|
|
||||||
#
|
|
||||||
#
|
|
||||||
push @result, sprintf( '%04x', $first ) , sprintf( '%04x' , $mask & 0xffff );
|
|
||||||
$first += $z;
|
|
||||||
}
|
|
||||||
|
|
||||||
fatal_error "Invalid port range ($range)" unless @result; # first port > last port
|
|
||||||
|
|
||||||
@result;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
( sprintf( '%04x' , validate_port( $proto, $range ) ) , 'ffff' );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# End functions moved from IPAddrs.pm in 5.1.5 #
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Functions to manipulate cmdlevel
|
# Functions to manipulate cmdlevel
|
||||||
#
|
#
|
||||||
@@ -1345,6 +1131,8 @@ sub format_rule( $$;$ ) {
|
|||||||
} else {
|
} else {
|
||||||
$rule .= join( '' , ' --', $_, ' ', $value );
|
$rule .= join( '' , ' --', $_, ' ', $value );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
next;
|
||||||
} elsif ( $type == EXPENSIVE ) {
|
} elsif ( $type == EXPENSIVE ) {
|
||||||
#
|
#
|
||||||
# Only emit expensive matches now if there are '-m nfacct' or '-m recent' matches in the rule
|
# Only emit expensive matches now if there are '-m nfacct' or '-m recent' matches in the rule
|
||||||
@@ -1403,15 +1191,13 @@ sub compatible( $$ ) {
|
|||||||
}
|
}
|
||||||
#
|
#
|
||||||
# Don't combine chains where each specifies
|
# Don't combine chains where each specifies
|
||||||
# -m policy and the policies are different
|
# -m policy
|
||||||
# or when one specifies
|
# or when one specifies
|
||||||
# -m multiport
|
# -m multiport
|
||||||
# and the other specifies
|
# and the other specifies
|
||||||
# --dport or --sport or -m multiport
|
# --dport or --sport or -m multiport
|
||||||
#
|
#
|
||||||
my ( $p1, $p2 );
|
return ! ( $ref1->{policy} && $ref2->{policy} ||
|
||||||
|
|
||||||
return ! ( ( ( $p1 = $ref1->{policy} ) && ( $p2 = $ref2->{policy} ) && $p1 ne $p2 ) ||
|
|
||||||
( ( $ref1->{multiport} && ( $ref2->{dport} || $ref2->{sport} || $ref2->{multiport} ) ) ||
|
( ( $ref1->{multiport} && ( $ref2->{dport} || $ref2->{sport} || $ref2->{multiport} ) ) ||
|
||||||
( $ref2->{multiport} && ( $ref1->{dport} || $ref1->{sport} ) ) ) );
|
( $ref2->{multiport} && ( $ref1->{dport} || $ref1->{sport} ) ) ) );
|
||||||
}
|
}
|
||||||
@@ -1929,7 +1715,7 @@ sub delete_reference( $$ ) {
|
|||||||
|
|
||||||
assert( $toref );
|
assert( $toref );
|
||||||
|
|
||||||
delete $toref->{references}{$fromref->{name}} if --$toref->{references}{$fromref->{name}} <= 0;
|
delete $toref->{references}{$fromref->{name}} unless --$toref->{references}{$fromref->{name}} > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -2067,7 +1853,7 @@ sub adjust_reference_counts( $$$ ) {
|
|||||||
my ($toref, $name1, $name2) = @_;
|
my ($toref, $name1, $name2) = @_;
|
||||||
|
|
||||||
if ( $toref ) {
|
if ( $toref ) {
|
||||||
delete $toref->{references}{$name1} if --$toref->{references}{$name1} <= 0;
|
delete $toref->{references}{$name1} unless --$toref->{references}{$name1} > 0;
|
||||||
$toref->{references}{$name2}++;
|
$toref->{references}{$name2}++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3275,10 +3061,8 @@ sub initialize_chain_table($) {
|
|||||||
$chainref = new_nat_chain( 'DOCKER' );
|
$chainref = new_nat_chain( 'DOCKER' );
|
||||||
set_optflags( $chainref, DONT_OPTIMIZE | DONT_DELETE | DONT_MOVE );
|
set_optflags( $chainref, DONT_OPTIMIZE | DONT_DELETE | DONT_MOVE );
|
||||||
add_commands( $chainref, '[ -f ${VARDIR}/.nat_DOCKER ] && cat ${VARDIR}/.nat_DOCKER >&3' );
|
add_commands( $chainref, '[ -f ${VARDIR}/.nat_DOCKER ] && cat ${VARDIR}/.nat_DOCKER >&3' );
|
||||||
$chainref = new_standard_chain( 'DOCKER-INGRESS' );
|
|
||||||
$chainref = new_standard_chain( 'DOCKER-ISOLATION' );
|
$chainref = new_standard_chain( 'DOCKER-ISOLATION' );
|
||||||
set_optflags( $chainref, DONT_OPTIMIZE | DONT_DELETE | DONT_MOVE );
|
set_optflags( $chainref, DONT_OPTIMIZE | DONT_DELETE | DONT_MOVE );
|
||||||
add_commands( $chainref, '[ -f ${VARDIR}/.filter_DOCKER-INGRESS ] && cat ${VARDIR}/.filter_DOCKER-INGRESS >&3' );
|
|
||||||
add_commands( $chainref, '[ -f ${VARDIR}/.filter_DOCKER-ISOLATION ] && cat ${VARDIR}/.filter_DOCKER-ISOLATION >&3' );
|
add_commands( $chainref, '[ -f ${VARDIR}/.filter_DOCKER-ISOLATION ] && cat ${VARDIR}/.filter_DOCKER-ISOLATION >&3' );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3675,7 +3459,7 @@ sub optimize_level4( $$ ) {
|
|||||||
#
|
#
|
||||||
delete_chain_and_references( $chainref );
|
delete_chain_and_references( $chainref );
|
||||||
$progress = 1;
|
$progress = 1;
|
||||||
} elsif ( $chainref->{builtin} || ! $globals{KLUDGEFREE} ) {
|
} elsif ( $chainref->{builtin} || ! $globals{KLUDGEFREE} || $firstrule->{policy} ) {
|
||||||
#
|
#
|
||||||
# This case requires a new rule merging algorithm. Ignore this chain from
|
# This case requires a new rule merging algorithm. Ignore this chain from
|
||||||
# now on.
|
# now on.
|
||||||
@@ -3902,15 +3686,6 @@ sub optimize_level8( $$$ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$combined{ $chainref1->{name} } = $chainref->{name};
|
$combined{ $chainref1->{name} } = $chainref->{name};
|
||||||
#
|
|
||||||
# While rare, it is possible for a policy chain to be combined with a non-policy chain. So we need to preserve
|
|
||||||
# the policy attributes in the combined chain
|
|
||||||
#
|
|
||||||
if ( $chainref->{policychain} ) {
|
|
||||||
@{$chainref1}{qw(policychain policy)} = @{$chainref}{qw(policychain policy)} unless $chainref1->{policychain};
|
|
||||||
} elsif ( $chainref1->{policychain} ) {
|
|
||||||
@{$chainref}{qw(policychain policy)} = @{$chainref1}{qw(policychain policy)} unless $chainref->{policychain};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4837,7 +4612,7 @@ sub do_proto( $$$;$ )
|
|||||||
$multiport = 1;
|
$multiport = 1;
|
||||||
} else {
|
} else {
|
||||||
fatal_error "Missing DEST PORT" unless supplied $ports;
|
fatal_error "Missing DEST PORT" unless supplied $ports;
|
||||||
$ports = validate_portpair $pname , $ports unless $ports =~ /^\$/;
|
$ports = validate_portpair $pname , $ports;
|
||||||
$output .= ( $srcndst ? "-m multiport ${invert}--ports ${ports} " : "${invert}--dport ${ports} " );
|
$output .= ( $srcndst ? "-m multiport ${invert}--ports ${ports} " : "${invert}--dport ${ports} " );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5044,7 +4819,7 @@ sub do_iproto( $$$ )
|
|||||||
$multiport = 1;
|
$multiport = 1;
|
||||||
} else {
|
} else {
|
||||||
fatal_error "Missing DEST PORT" unless supplied $ports;
|
fatal_error "Missing DEST PORT" unless supplied $ports;
|
||||||
$ports = validate_portpair $pname , $ports unless $ports =~ /^\$/;
|
$ports = validate_portpair $pname , $ports;
|
||||||
|
|
||||||
if ( $srcndst ) {
|
if ( $srcndst ) {
|
||||||
push @output, multiport => "${invert}--ports ${ports}";
|
push @output, multiport => "${invert}--ports ${ports}";
|
||||||
@@ -5983,7 +5758,6 @@ sub record_runtime_address( $$;$$ ) {
|
|||||||
|
|
||||||
if ( $interface =~ /^{([a-zA-Z_]\w*)}$/ ) {
|
if ( $interface =~ /^{([a-zA-Z_]\w*)}$/ ) {
|
||||||
fatal_error "Mixed required/optional usage of address variable $1" if ( $address_variables{$1} || $addrtype ) ne $addrtype;
|
fatal_error "Mixed required/optional usage of address variable $1" if ( $address_variables{$1} || $addrtype ) ne $addrtype;
|
||||||
fatal_error "Variable %variable is already used as a port variable" if $port_variables{$1};
|
|
||||||
$address_variables{$1} = $addrtype;
|
$address_variables{$1} = $addrtype;
|
||||||
return '$' . "$1 ";
|
return '$' . "$1 ";
|
||||||
}
|
}
|
||||||
@@ -6329,7 +6103,7 @@ sub match_dest_net( $;$ ) {
|
|||||||
return '-d ' . record_runtime_address $1, $2;
|
return '-d ' . record_runtime_address $1, $2;
|
||||||
}
|
}
|
||||||
|
|
||||||
$net = validate_net $net, 1 unless $net =~ /^\$/; # Don't validate if runtime address variable
|
$net = validate_net $net, 1;
|
||||||
$net eq ALLIP ? '' : "-d $net ";
|
$net eq ALLIP ? '' : "-d $net ";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6410,7 +6184,7 @@ sub imatch_dest_net( $;$ ) {
|
|||||||
return ( d => record_runtime_address( $1, $2, 1 ) );
|
return ( d => record_runtime_address( $1, $2, 1 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
$net = validate_net $net, 1 unless $net =~ /^\$/; # Don't validate if runtime address variable
|
$net = validate_net $net, 1;
|
||||||
$net eq ALLIP ? () : ( d => $net );
|
$net eq ALLIP ? () : ( d => $net );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7069,8 +6843,6 @@ sub interface_gateway( $ ) {
|
|||||||
sub get_interface_gateway ( $;$$ ) {
|
sub get_interface_gateway ( $;$$ ) {
|
||||||
my ( $logical, $protect, $provider ) = @_;
|
my ( $logical, $protect, $provider ) = @_;
|
||||||
|
|
||||||
$provider = '' unless defined $provider;
|
|
||||||
|
|
||||||
my $interface = get_physical $logical;
|
my $interface = get_physical $logical;
|
||||||
my $variable = interface_gateway( $interface );
|
my $variable = interface_gateway( $interface );
|
||||||
my $gateway = get_interface_option( $interface, 'gateway' );
|
my $gateway = get_interface_option( $interface, 'gateway' );
|
||||||
@@ -7084,9 +6856,9 @@ sub get_interface_gateway ( $;$$ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( interface_is_optional $logical ) {
|
if ( interface_is_optional $logical ) {
|
||||||
$interfacegateways{$interface} = qq([ -n "\$$variable" ] || $variable=\$(detect_gateway $interface $provider));
|
$interfacegateways{$interface} = qq([ -n "\$$variable" ] || $variable=\$(detect_gateway $interface));
|
||||||
} else {
|
} else {
|
||||||
$interfacegateways{$interface} = qq([ -n "\$$variable" ] || $variable=\$(detect_gateway $interface $provider)
|
$interfacegateways{$interface} = qq([ -n "\$$variable" ] || $variable=\$(detect_gateway $interface)
|
||||||
[ -n "\$$variable" ] || startup_error "Unable to detect the gateway through interface $interface");
|
[ -n "\$$variable" ] || startup_error "Unable to detect the gateway through interface $interface");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7273,19 +7045,6 @@ sub verify_address_variables() {
|
|||||||
qq( startup_error "Invalid value ($address) for address variable $variable"),
|
qq( startup_error "Invalid value ($address) for address variable $variable"),
|
||||||
qq(fi\n) );
|
qq(fi\n) );
|
||||||
}
|
}
|
||||||
|
|
||||||
for my $variable( keys %port_variables ) {
|
|
||||||
my $port = "\$$variable";
|
|
||||||
my $type = $port_variables{$variable};
|
|
||||||
|
|
||||||
emit( qq(if [ -z "$port" ]; then) ,
|
|
||||||
qq( $variable=255) ,
|
|
||||||
qq(elif qt \$g_tool -A INPUT -p 6 --dport $port; then) ,
|
|
||||||
qq( qt \$g_tool -D INPUT -p 6 --dport $variable) ,
|
|
||||||
qq(else) ,
|
|
||||||
qq( startup_error "Invalid valid ($port) for port variable $variable") ,
|
|
||||||
qq(fi\n) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -7535,11 +7294,6 @@ sub isolate_dest_interface( $$$$ ) {
|
|||||||
|
|
||||||
$rule .= "-d $variable ";
|
$rule .= "-d $variable ";
|
||||||
}
|
}
|
||||||
} elsif ( $dest =~ /^\$/ ) {
|
|
||||||
#
|
|
||||||
# Runtime address variable
|
|
||||||
#
|
|
||||||
$dnets = $dest;
|
|
||||||
} elsif ( $family == F_IPV4 ) {
|
} elsif ( $family == F_IPV4 ) {
|
||||||
if ( $dest =~ /^(.+?):(.+)$/ ) {
|
if ( $dest =~ /^(.+?):(.+)$/ ) {
|
||||||
$diface = $1;
|
$diface = $1;
|
||||||
@@ -8463,7 +8217,6 @@ sub save_docker_rules($) {
|
|||||||
qq( $tool -t nat -S OUTPUT | tail -n +2 | fgrep DOCKER > \${VARDIR}/.nat_OUTPUT),
|
qq( $tool -t nat -S OUTPUT | tail -n +2 | fgrep DOCKER > \${VARDIR}/.nat_OUTPUT),
|
||||||
qq( $tool -t nat -S POSTROUTING | tail -n +2 | fgrep -v SHOREWALL > \${VARDIR}/.nat_POSTROUTING),
|
qq( $tool -t nat -S POSTROUTING | tail -n +2 | fgrep -v SHOREWALL > \${VARDIR}/.nat_POSTROUTING),
|
||||||
qq( $tool -t filter -S DOCKER | tail -n +2 > \${VARDIR}/.filter_DOCKER),
|
qq( $tool -t filter -S DOCKER | tail -n +2 > \${VARDIR}/.filter_DOCKER),
|
||||||
qq( [ -n "\$g_dockeringress" ] && $tool -t filter -S DOCKER-INGRESS | tail -n +2 > \${VARDIR}/.filter_DOCKER-INGRESS),
|
|
||||||
qq( [ -n "\$g_dockernetwork" ] && $tool -t filter -S DOCKER-ISOLATION | tail -n +2 > \${VARDIR}/.filter_DOCKER-ISOLATION)
|
qq( [ -n "\$g_dockernetwork" ] && $tool -t filter -S DOCKER-ISOLATION | tail -n +2 > \${VARDIR}/.filter_DOCKER-ISOLATION)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -8479,7 +8232,6 @@ sub save_docker_rules($) {
|
|||||||
q( rm -f ${VARDIR}/.nat_OUTPUT),
|
q( rm -f ${VARDIR}/.nat_OUTPUT),
|
||||||
q( rm -f ${VARDIR}/.nat_POSTROUTING),
|
q( rm -f ${VARDIR}/.nat_POSTROUTING),
|
||||||
q( rm -f ${VARDIR}/.filter_DOCKER),
|
q( rm -f ${VARDIR}/.filter_DOCKER),
|
||||||
q( rm -f ${VARDIR}/.filter_DOCKER-INGRESS),
|
|
||||||
q( rm -f ${VARDIR}/.filter_DOCKER-ISOLATION),
|
q( rm -f ${VARDIR}/.filter_DOCKER-ISOLATION),
|
||||||
q( rm -f ${VARDIR}/.filter_FORWARD),
|
q( rm -f ${VARDIR}/.filter_FORWARD),
|
||||||
q(fi)
|
q(fi)
|
||||||
@@ -8922,15 +8674,9 @@ sub create_netfilter_load( $ ) {
|
|||||||
my $UTILITY = $family == F_IPV4 ? 'IPTABLES_RESTORE' : 'IP6TABLES_RESTORE';
|
my $UTILITY = $family == F_IPV4 ? 'IPTABLES_RESTORE' : 'IP6TABLES_RESTORE';
|
||||||
|
|
||||||
emit( '',
|
emit( '',
|
||||||
'if [ "$COMMAND" = reload -a -n "$g_counters" ] && chain_exists $g_sha1sum1 && chain_exists $g_sha1sum2 ; then' );
|
'if [ "$COMMAND" = reload -a -n "$g_counters" ] && chain_exists $g_sha1sum1 && chain_exists $g_sha1sum2 ; then',
|
||||||
|
' option="--counters"',
|
||||||
if ( have_capability( 'RESTORE_WAIT_OPTION' ) ) {
|
'',
|
||||||
emit( ' option="--counters --wait "' . $config{MUTEX_TIMEOUT} );
|
|
||||||
} else {
|
|
||||||
emit( ' option="--counters"' );
|
|
||||||
}
|
|
||||||
|
|
||||||
emit( '',
|
|
||||||
' progress_message "Reusing existing ruleset..."',
|
' progress_message "Reusing existing ruleset..."',
|
||||||
'',
|
'',
|
||||||
'else'
|
'else'
|
||||||
@@ -8938,11 +8684,7 @@ sub create_netfilter_load( $ ) {
|
|||||||
|
|
||||||
push_indent;
|
push_indent;
|
||||||
|
|
||||||
if ( have_capability( 'RESTORE_WAIT_OPTION' ) ) {
|
emit 'option=';
|
||||||
emit 'option="--wait "' . $config{MUTEX_TIMEOUT};
|
|
||||||
} else {
|
|
||||||
emit 'option=';
|
|
||||||
}
|
|
||||||
|
|
||||||
save_progress_message "Preparing $utility input...";
|
save_progress_message "Preparing $utility input...";
|
||||||
|
|
||||||
@@ -8991,10 +8733,6 @@ sub create_netfilter_load( $ ) {
|
|||||||
enter_cmd_mode;
|
enter_cmd_mode;
|
||||||
emit( '[ -n "$g_dockernetwork" ] && echo ":DOCKER-ISOLATION - [0:0]" >&3' );
|
emit( '[ -n "$g_dockernetwork" ] && echo ":DOCKER-ISOLATION - [0:0]" >&3' );
|
||||||
enter_cat_mode;
|
enter_cat_mode;
|
||||||
} elsif ( $name eq 'DOCKER-INGRESS' ) {
|
|
||||||
enter_cmd_mode;
|
|
||||||
emit( '[ -n "$g_dockeringress" ] && echo ":DOCKER-INGRESS - [0:0]" >&3' );
|
|
||||||
enter_cat_mode;
|
|
||||||
} else {
|
} else {
|
||||||
emit_unindented ":$name - [0:0]";
|
emit_unindented ":$name - [0:0]";
|
||||||
}
|
}
|
||||||
@@ -9099,11 +8837,6 @@ sub preview_netfilter_load() {
|
|||||||
print( '[ -n "$g_dockernetwork" ] && echo ":DOCKER-ISOLATION - [0:0]" >&3' );
|
print( '[ -n "$g_dockernetwork" ] && echo ":DOCKER-ISOLATION - [0:0]" >&3' );
|
||||||
print "\n";
|
print "\n";
|
||||||
enter_cat_mode1;
|
enter_cat_mode1;
|
||||||
} elsif ( $name eq 'DOCKER-INGRESS' ) {
|
|
||||||
enter_cmd_mode1 unless $mode == CMD_MODE;
|
|
||||||
print( '[ -n "$g_dockeringress" ] && echo ":DOCKER-INGRESS - [0:0]" >&3' );
|
|
||||||
print "\n";
|
|
||||||
enter_cat_mode1;
|
|
||||||
} else {
|
} else {
|
||||||
enter_cmd_mode1 unless $mode == CMD_MODE;
|
enter_cmd_mode1 unless $mode == CMD_MODE;
|
||||||
print( ":$name - [0:0]\n" );
|
print( ":$name - [0:0]\n" );
|
||||||
@@ -9341,10 +9074,6 @@ sub create_stop_load( $ ) {
|
|||||||
enter_cmd_mode;
|
enter_cmd_mode;
|
||||||
emit( '[ -n "$g_dockernetwork" ] && echo ":DOCKER-ISOLATION - [0:0]" >&3' );
|
emit( '[ -n "$g_dockernetwork" ] && echo ":DOCKER-ISOLATION - [0:0]" >&3' );
|
||||||
enter_cat_mode;
|
enter_cat_mode;
|
||||||
} elsif ( $name eq 'DOCKER-INGRESS' ) {
|
|
||||||
enter_cmd_mode;
|
|
||||||
emit( '[ -n "$g_dockeringress" ] && echo ":DOCKER-INGRESS - [0:0]" >&3' );
|
|
||||||
enter_cat_mode;
|
|
||||||
} else {
|
} else {
|
||||||
emit_unindented ":$name - [0:0]";
|
emit_unindented ":$name - [0:0]";
|
||||||
}
|
}
|
||||||
@@ -9370,11 +9099,7 @@ sub create_stop_load( $ ) {
|
|||||||
|
|
||||||
enter_cmd_mode;
|
enter_cmd_mode;
|
||||||
|
|
||||||
if ( have_capability( 'RESTORE_WAIT_OPTION' ) ) {
|
emit( '[ -n "$g_debug_iptables" ] && command=debug_restore_input || command=$' . $UTILITY );
|
||||||
emit( '[ -n "$g_debug_iptables" ] && command=debug_restore_input || command="$' . $UTILITY . ' --wait ' . $config{MUTEX_TIMEOUT} . '"' );
|
|
||||||
} else {
|
|
||||||
emit( '[ -n "$g_debug_iptables" ] && command=debug_restore_input || command=$' . $UTILITY );
|
|
||||||
}
|
|
||||||
|
|
||||||
emit( '',
|
emit( '',
|
||||||
'progress_message2 "Running $command..."',
|
'progress_message2 "Running $command..."',
|
||||||
|
@@ -59,7 +59,7 @@ our $have_arptables;
|
|||||||
# Initilize the package-globals in the other modules
|
# Initilize the package-globals in the other modules
|
||||||
#
|
#
|
||||||
sub initialize_package_globals( $$$ ) {
|
sub initialize_package_globals( $$$ ) {
|
||||||
Shorewall::Config::initialize($family, $export, $_[1], $_[2]);
|
Shorewall::Config::initialize($family, $_[1], $_[2]);
|
||||||
Shorewall::Chains::initialize ($family, 1, $export );
|
Shorewall::Chains::initialize ($family, 1, $export );
|
||||||
Shorewall::Zones::initialize ($family, $_[0]);
|
Shorewall::Zones::initialize ($family, $_[0]);
|
||||||
Shorewall::Nat::initialize($family);
|
Shorewall::Nat::initialize($family);
|
||||||
@@ -109,7 +109,7 @@ sub generate_script_1( $ ) {
|
|||||||
################################################################################
|
################################################################################
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
for my $exit ( qw/init start tcclear started stop stopped clear refresh refreshed restored enabled disabled/ ) {
|
for my $exit ( qw/init start tcclear started stop stopped clear refresh refreshed restored/ ) {
|
||||||
emit "\nrun_${exit}_exit() {";
|
emit "\nrun_${exit}_exit() {";
|
||||||
push_indent;
|
push_indent;
|
||||||
append_file $exit or emit 'true';
|
append_file $exit or emit 'true';
|
||||||
@@ -209,8 +209,6 @@ sub generate_script_2() {
|
|||||||
emit ( '[ -f ${g_confdir}/vardir ] && . ${g_confdir}/vardir' );
|
emit ( '[ -f ${g_confdir}/vardir ] && . ${g_confdir}/vardir' );
|
||||||
emit ( qq([ -n "\${VARDIR:=$shorewallrc1{VARDIR}}" ]) );
|
emit ( qq([ -n "\${VARDIR:=$shorewallrc1{VARDIR}}" ]) );
|
||||||
emit ( qq([ -n "\${VARLIB:=$shorewallrc1{VARLIB}}" ]) );
|
emit ( qq([ -n "\${VARLIB:=$shorewallrc1{VARLIB}}" ]) );
|
||||||
emit ( qq([ -n "\${CONFDIR:=$shorewallrc1{CONFDIR}}" ]) );
|
|
||||||
emit ( qq([ -n "\${SHAREDIR:=$shorewallrc1{SHAREDIR}}" ]) );
|
|
||||||
|
|
||||||
emit 'TEMPFILE=';
|
emit 'TEMPFILE=';
|
||||||
|
|
||||||
@@ -268,8 +266,7 @@ sub generate_script_2() {
|
|||||||
emit( '',
|
emit( '',
|
||||||
'chain_exists DOCKER nat && chain_exists DOCKER && g_docker=Yes',
|
'chain_exists DOCKER nat && chain_exists DOCKER && g_docker=Yes',
|
||||||
);
|
);
|
||||||
emit( 'chain_exists DOCKER-INGRESS && g_dockeringress=Yes' );
|
emit( 'chain_exists DOCKER-ISOLATION && g_dockernetwork=Yes]' );
|
||||||
emit( 'chain_exists DOCKER-ISOLATION && g_dockernetwork=Yes' );
|
|
||||||
emit( '' );
|
emit( '' );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -692,7 +689,6 @@ sub compiler {
|
|||||||
set_timestamp( $timestamp );
|
set_timestamp( $timestamp );
|
||||||
set_debug( $debug , $confess );
|
set_debug( $debug , $confess );
|
||||||
#
|
#
|
||||||
# S H O R E W A L L R C ,
|
|
||||||
# S H O R E W A L L . C O N F A N D C A P A B I L I T I E S
|
# S H O R E W A L L . C O N F A N D C A P A B I L I T I E S
|
||||||
#
|
#
|
||||||
get_configuration( $export , $update , $annotate , $inline );
|
get_configuration( $export , $update , $annotate , $inline );
|
||||||
@@ -797,10 +793,13 @@ sub compiler {
|
|||||||
emit '}'; # End of setup_common_rules()
|
emit '}'; # End of setup_common_rules()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disable_script;
|
||||||
#
|
#
|
||||||
# R O U T I N G _ A N D _ T R A F F I C _ S H A P I N G
|
# R O U T I N G _ A N D _ T R A F F I C _ S H A P I N G
|
||||||
# (Writes the setup_routing_and_traffic_shaping() function to the compiled script)
|
# (Writes the setup_routing_and_traffic_shaping() function to the compiled script)
|
||||||
#
|
#
|
||||||
|
enable_script;
|
||||||
|
#
|
||||||
# Validate the TC files so that the providers will know what interfaces have TC
|
# Validate the TC files so that the providers will know what interfaces have TC
|
||||||
#
|
#
|
||||||
my $tcinterfaces = process_tc;
|
my $tcinterfaces = process_tc;
|
||||||
|
@@ -30,97 +30,17 @@
|
|||||||
# into those files (emitters) and finalizing those files (renaming
|
# into those files (emitters) and finalizing those files (renaming
|
||||||
# them to their final name and setting their mode appropriately).
|
# them to their final name and setting their mode appropriately).
|
||||||
#
|
#
|
||||||
# A significant portion of this module is dedicated to the preprocessor:
|
|
||||||
#
|
|
||||||
# process_compiler_directive() - processes compiler directives
|
|
||||||
#
|
|
||||||
# embedded_shell() - handles embedded shell scripting
|
|
||||||
#
|
|
||||||
# embedded_perl() - handles embedded perl scripting
|
|
||||||
#
|
|
||||||
# read_a_line() - Reads the next configuration file record to
|
|
||||||
# be passed to the function processing the file.
|
|
||||||
#
|
|
||||||
# - Detects compiler directives and passes then to
|
|
||||||
# process_compiler_directive() for handling.
|
|
||||||
#
|
|
||||||
# - Handles line continuation
|
|
||||||
#
|
|
||||||
# - Invokes a callback when the first (concatinated) non-directive
|
|
||||||
# record is read from a file.
|
|
||||||
#
|
|
||||||
# - Conditionally expands variables.
|
|
||||||
#
|
|
||||||
# - Conditionally detects embedded Shell and Perl and passes them
|
|
||||||
# off to embedded_shell() and embedded_perl() respectively.
|
|
||||||
#
|
|
||||||
# - Conditionally detects and handles [?}INCLUDE directives.
|
|
||||||
#
|
|
||||||
# - Conditionally detects and handles ?SECTION directives.
|
|
||||||
# File processing functions can supply a callback to be
|
|
||||||
# called during this processing.
|
|
||||||
#
|
|
||||||
# File processing routines may need to open a second (third, fourth, ...)
|
|
||||||
# file while processing the main file (macro and/or action files). Two
|
|
||||||
# functions are provided to make that possible:
|
|
||||||
#
|
|
||||||
# push_open() - open a file while leaving the current file open.
|
|
||||||
#
|
|
||||||
# pop_open() - close the current file, and make the previous
|
|
||||||
# file (if any) the current one.
|
|
||||||
#
|
|
||||||
# Because this module expands variables, it must be aware of action
|
|
||||||
# parameters.
|
|
||||||
#
|
|
||||||
# push_action_params() - populates the %actparams hash and
|
|
||||||
# returns a reference to the previous
|
|
||||||
# contents of that hash. The caller is
|
|
||||||
# expected to store those contents locally.
|
|
||||||
#
|
|
||||||
# pop_action_params() - Restores the %actparams hash from
|
|
||||||
# the reference returned by
|
|
||||||
# push_action_params().
|
|
||||||
#
|
|
||||||
# The following routines are provided for INLINE PERL within
|
|
||||||
# action bodies:
|
|
||||||
#
|
|
||||||
# default_action_params() - called to fill in omitted
|
|
||||||
# arguments when a DEFAULTS
|
|
||||||
# line is encountered.
|
|
||||||
#
|
|
||||||
# get_action_params() - returns an array of arguments.
|
|
||||||
#
|
|
||||||
# setup_audit_action() - helper for A_* actions.
|
|
||||||
#
|
|
||||||
# get_action_logging() - returns log level and tag
|
|
||||||
# from the action's invocation.
|
|
||||||
#
|
|
||||||
# get_action_chain_name() - returns chain name.
|
|
||||||
#
|
|
||||||
# set_action_name_to_caller() - replace chain name
|
|
||||||
# with that of invoking
|
|
||||||
# chain for logging purposes.
|
|
||||||
#
|
|
||||||
# set_action_disposition() - set the current action
|
|
||||||
# disposition for logging purposes.
|
|
||||||
#
|
|
||||||
# get_action_disposition() - get the current action disposition.
|
|
||||||
#
|
|
||||||
# set_action_param() - set the value of an argument.
|
|
||||||
#
|
|
||||||
package Shorewall::Config;
|
package Shorewall::Config;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
use File::Temp qw/ tempfile tempdir /;
|
use File::Temp qw/ tempfile tempdir /;
|
||||||
use File::Glob ':globally';
|
|
||||||
use Cwd qw(abs_path getcwd);
|
use Cwd qw(abs_path getcwd);
|
||||||
use autouse 'Carp' => qw(longmess confess);
|
use autouse 'Carp' => qw(longmess confess);
|
||||||
use Scalar::Util 'reftype';
|
use Scalar::Util 'reftype';
|
||||||
use FindBin;
|
use FindBin;
|
||||||
use Digest::SHA qw(sha1_hex);
|
use Digest::SHA qw(sha1_hex);
|
||||||
use Errno qw(:POSIX);
|
|
||||||
|
|
||||||
our @ISA = qw(Exporter);
|
our @ISA = qw(Exporter);
|
||||||
#
|
#
|
||||||
@@ -395,7 +315,7 @@ our %renamed = ( AUTO_COMMENT => 'AUTOCOMMENT', BLACKLIST_LOGLEVEL => 'BLACKLIST
|
|||||||
#
|
#
|
||||||
# Config options and global settings that are to be copied to output script
|
# Config options and global settings that are to be copied to output script
|
||||||
#
|
#
|
||||||
our @propagateconfig = qw/ DISABLE_IPV6 MODULESDIR LOAD_HELPERS_ONLY LOCKFILE SUBSYSLOCK LOG_VERBOSITY RESTART/;
|
our @propagateconfig = qw/ DISABLE_IPV6 MODULESDIR MODULE_SUFFIX LOAD_HELPERS_ONLY LOCKFILE SUBSYSLOCK LOG_VERBOSITY RESTART/;
|
||||||
#
|
#
|
||||||
# From parsing the capabilities file or detecting capabilities
|
# From parsing the capabilities file or detecting capabilities
|
||||||
#
|
#
|
||||||
@@ -493,9 +413,7 @@ our %capdesc = ( NAT_ENABLED => 'NAT',
|
|||||||
WAIT_OPTION => 'iptables --wait option',
|
WAIT_OPTION => 'iptables --wait option',
|
||||||
CPU_FANOUT => 'NFQUEUE CPU Fanout',
|
CPU_FANOUT => 'NFQUEUE CPU Fanout',
|
||||||
NETMAP_TARGET => 'NETMAP Target',
|
NETMAP_TARGET => 'NETMAP Target',
|
||||||
NFLOG_SIZE => '--nflog-size support',
|
|
||||||
RESTORE_WAIT_OPTION
|
|
||||||
=> 'iptables-restore --wait option',
|
|
||||||
AMANDA_HELPER => 'Amanda Helper',
|
AMANDA_HELPER => 'Amanda Helper',
|
||||||
FTP_HELPER => 'FTP Helper',
|
FTP_HELPER => 'FTP Helper',
|
||||||
FTP0_HELPER => 'FTP-0 Helper',
|
FTP0_HELPER => 'FTP-0 Helper',
|
||||||
@@ -570,55 +488,53 @@ our %helpers_aliases;
|
|||||||
our %helpers_enabled;
|
our %helpers_enabled;
|
||||||
|
|
||||||
our %config_files = ( #accounting => 1,
|
our %config_files = ( #accounting => 1,
|
||||||
actions => 1,
|
actions => 1,
|
||||||
blacklist => 1,
|
blacklist => 1,
|
||||||
clear => 1,
|
clear => 1,
|
||||||
conntrack => 1,
|
conntrack => 1,
|
||||||
ecn => 1,
|
ecn => 1,
|
||||||
findgw => 1,
|
findgw => 1,
|
||||||
hosts => 1,
|
hosts => 1,
|
||||||
init => 1,
|
init => 1,
|
||||||
initdone => 1,
|
initdone => 1,
|
||||||
interfaces => 1,
|
interfaces => 1,
|
||||||
isusable => 1,
|
isusable => 1,
|
||||||
maclist => 1,
|
maclist => 1,
|
||||||
mangle => 1,
|
masq => 1,
|
||||||
masq => 1,
|
nat => 1,
|
||||||
nat => 1,
|
netmap => 1,
|
||||||
netmap => 1,
|
params => 1,
|
||||||
params => 1,
|
policy => 1,
|
||||||
policy => 1,
|
providers => 1,
|
||||||
providers => 1,
|
proxyarp => 1,
|
||||||
proxyarp => 1,
|
refresh => 1,
|
||||||
refresh => 1,
|
refreshed => 1,
|
||||||
refreshed => 1,
|
restored => 1,
|
||||||
restored => 1,
|
rawnat => 1,
|
||||||
rawnat => 1,
|
|
||||||
route_rules => 1,
|
route_rules => 1,
|
||||||
routes => 1,
|
routes => 1,
|
||||||
routestopped => 1,
|
routestopped => 1,
|
||||||
rtrules => 1,
|
rtrules => 1,
|
||||||
rules => 1,
|
rules => 1,
|
||||||
scfilter => 1,
|
scfilter => 1,
|
||||||
secmarks => 1,
|
secmarks => 1,
|
||||||
snat => 1,
|
start => 1,
|
||||||
start => 1,
|
started => 1,
|
||||||
started => 1,
|
stop => 1,
|
||||||
stop => 1,
|
stopped => 1,
|
||||||
stopped => 1,
|
|
||||||
stoppedrules => 1,
|
stoppedrules => 1,
|
||||||
tcclasses => 1,
|
tcclasses => 1,
|
||||||
tcclear => 1,
|
tcclear => 1,
|
||||||
tcdevices => 1,
|
tcdevices => 1,
|
||||||
tcfilters => 1,
|
tcfilters => 1,
|
||||||
tcinterfaces => 1,
|
tcinterfaces => 1,
|
||||||
tcpri => 1,
|
tcpri => 1,
|
||||||
tcrules => 1,
|
tcrules => 1,
|
||||||
tos => 1,
|
tos => 1,
|
||||||
tunnels => 1,
|
tunnels => 1,
|
||||||
zones => 1 );
|
zones => 1 );
|
||||||
#
|
#
|
||||||
# Options that involve the AUDIT target
|
# Options that involve the the AUDIT target
|
||||||
#
|
#
|
||||||
our @auditoptions = qw( BLACKLIST_DISPOSITION MACLIST_DISPOSITION TCP_FLAGS_DISPOSITION );
|
our @auditoptions = qw( BLACKLIST_DISPOSITION MACLIST_DISPOSITION TCP_FLAGS_DISPOSITION );
|
||||||
#
|
#
|
||||||
@@ -675,7 +591,6 @@ our $debug; # Global debugging flag
|
|||||||
our $confess; # If true, use Carp to report errors with stack trace.
|
our $confess; # If true, use Carp to report errors with stack trace.
|
||||||
|
|
||||||
our $family; # Protocol family (4 or 6)
|
our $family; # Protocol family (4 or 6)
|
||||||
our $export; # True when compiling for export
|
|
||||||
our $toolname; # Name of the tool to use (iptables or iptables6)
|
our $toolname; # Name of the tool to use (iptables or iptables6)
|
||||||
our $toolNAME; # Tool name in CAPS
|
our $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
|
||||||
@@ -729,7 +644,6 @@ our %eliminated = ( LOGRATE => 1,
|
|||||||
HIGH_ROUTE_MARKS => 1,
|
HIGH_ROUTE_MARKS => 1,
|
||||||
BLACKLISTNEWONLY => 1,
|
BLACKLISTNEWONLY => 1,
|
||||||
CHAIN_SCRIPTS => 1,
|
CHAIN_SCRIPTS => 1,
|
||||||
MODULE_SUFFIX => 1,
|
|
||||||
);
|
);
|
||||||
#
|
#
|
||||||
# Variables involved in ?IF, ?ELSE ?ENDIF processing
|
# Variables involved in ?IF, ?ELSE ?ENDIF processing
|
||||||
@@ -789,8 +703,8 @@ sub add_variables( \% );
|
|||||||
# 2. The compiler can run multiple times in the same process so it has to be
|
# 2. The compiler can run multiple times in the same process so it has to be
|
||||||
# able to re-initialize its dependent modules' state.
|
# able to re-initialize its dependent modules' state.
|
||||||
#
|
#
|
||||||
sub initialize( $;$$$) {
|
sub initialize( $;$$) {
|
||||||
( $family, $export, my ( $shorewallrc, $shorewallrc1 ) ) = @_;
|
( $family, my ( $shorewallrc, $shorewallrc1 ) ) = @_;
|
||||||
|
|
||||||
if ( $family == F_IPV4 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
( $product, $Product, $toolname, $toolNAME ) = qw( shorewall Shorewall iptables IPTABLES );
|
( $product, $Product, $toolname, $toolNAME ) = qw( shorewall Shorewall iptables IPTABLES );
|
||||||
@@ -834,8 +748,8 @@ sub initialize( $;$$$) {
|
|||||||
TC_SCRIPT => '',
|
TC_SCRIPT => '',
|
||||||
EXPORT => 0,
|
EXPORT => 0,
|
||||||
KLUDGEFREE => '',
|
KLUDGEFREE => '',
|
||||||
VERSION => "5.1.8-Beta1",
|
VERSION => "5.1.4-Beta1",
|
||||||
CAPVERSION => 50106 ,
|
CAPVERSION => 50100 ,
|
||||||
BLACKLIST_LOG_TAG => '',
|
BLACKLIST_LOG_TAG => '',
|
||||||
RELATED_LOG_TAG => '',
|
RELATED_LOG_TAG => '',
|
||||||
MACLIST_LOG_TAG => '',
|
MACLIST_LOG_TAG => '',
|
||||||
@@ -930,6 +844,7 @@ sub initialize( $;$$$) {
|
|||||||
BLACKLIST => undef,
|
BLACKLIST => undef,
|
||||||
BLACKLISTNEWONLY => undef,
|
BLACKLISTNEWONLY => undef,
|
||||||
DELAYBLACKLISTLOAD => undef,
|
DELAYBLACKLISTLOAD => undef,
|
||||||
|
MODULE_SUFFIX => undef,
|
||||||
DISABLE_IPV6 => undef,
|
DISABLE_IPV6 => undef,
|
||||||
DYNAMIC_ZONES => undef,
|
DYNAMIC_ZONES => undef,
|
||||||
PKTTYPE=> undef,
|
PKTTYPE=> undef,
|
||||||
@@ -993,7 +908,6 @@ sub initialize( $;$$$) {
|
|||||||
FIREWALL => undef ,
|
FIREWALL => undef ,
|
||||||
BALANCE_PROVIDERS => undef ,
|
BALANCE_PROVIDERS => undef ,
|
||||||
PERL_HASH_SEED => undef ,
|
PERL_HASH_SEED => undef ,
|
||||||
USE_NFLOG_SIZE => undef ,
|
|
||||||
#
|
#
|
||||||
# Packet Disposition
|
# Packet Disposition
|
||||||
#
|
#
|
||||||
@@ -1089,7 +1003,7 @@ sub initialize( $;$$$) {
|
|||||||
CONNLIMIT_MATCH => undef,
|
CONNLIMIT_MATCH => undef,
|
||||||
TIME_MATCH => undef,
|
TIME_MATCH => undef,
|
||||||
GOTO_TARGET => undef,
|
GOTO_TARGET => undef,
|
||||||
LOG_TARGET => undef,
|
LOG_TARGET => 1, # Assume that we have it.
|
||||||
ULOG_TARGET => undef,
|
ULOG_TARGET => undef,
|
||||||
NFLOG_TARGET => undef,
|
NFLOG_TARGET => undef,
|
||||||
LOGMARK_TARGET => undef,
|
LOGMARK_TARGET => undef,
|
||||||
@@ -1127,8 +1041,6 @@ sub initialize( $;$$$) {
|
|||||||
WAIT_OPTION => undef,
|
WAIT_OPTION => undef,
|
||||||
CPU_FANOUT => undef,
|
CPU_FANOUT => undef,
|
||||||
NETMAP_TARGET => undef,
|
NETMAP_TARGET => undef,
|
||||||
NFLOG_SIZE => undef,
|
|
||||||
RESTORE_WAIT_OPTION => undef,
|
|
||||||
|
|
||||||
AMANDA_HELPER => undef,
|
AMANDA_HELPER => undef,
|
||||||
FTP_HELPER => undef,
|
FTP_HELPER => undef,
|
||||||
@@ -1254,7 +1166,7 @@ sub initialize( $;$$$) {
|
|||||||
#
|
#
|
||||||
# Process the global shorewallrc file
|
# Process the global shorewallrc file
|
||||||
#
|
#
|
||||||
# Note: The build script calls this function passing only the protocol family
|
# Note: The build file executes this function passing only the protocol family
|
||||||
#
|
#
|
||||||
process_shorewallrc( $shorewallrc,
|
process_shorewallrc( $shorewallrc,
|
||||||
$family == F_IPV4 ? 'shorewall' : 'shorewall6'
|
$family == F_IPV4 ? 'shorewall' : 'shorewall6'
|
||||||
@@ -1305,9 +1217,10 @@ sub compiletime() {
|
|||||||
# Create 'currentlineinfo'
|
# Create 'currentlineinfo'
|
||||||
#
|
#
|
||||||
sub currentlineinfo() {
|
sub currentlineinfo() {
|
||||||
|
my $linenumber = $currentlinenumber || 1;
|
||||||
|
|
||||||
if ( $currentfilename ) {
|
if ( $currentfilename ) {
|
||||||
my $linenumber = $currentlinenumber || 1;
|
my $lineinfo = " $currentfilename ";
|
||||||
my $lineinfo = " $currentfilename ";
|
|
||||||
|
|
||||||
if ( $linenumber eq 'EOF' ) {
|
if ( $linenumber eq 'EOF' ) {
|
||||||
$lineinfo .= '(EOF)'
|
$lineinfo .= '(EOF)'
|
||||||
@@ -2073,7 +1986,6 @@ sub find_file($)
|
|||||||
for my $directory ( @config_path ) {
|
for my $directory ( @config_path ) {
|
||||||
my $file = "$directory$filename";
|
my $file = "$directory$filename";
|
||||||
return $file if -f $file;
|
return $file if -f $file;
|
||||||
$!{ENOENT} || fatal_error "Unable to access $file: " . $!;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
"$config_path[0]$filename";
|
"$config_path[0]$filename";
|
||||||
@@ -2428,7 +2340,7 @@ sub split_line2( $$;$$$ ) {
|
|||||||
|
|
||||||
$inline_matches = $pairs;
|
$inline_matches = $pairs;
|
||||||
|
|
||||||
if ( $columns =~ /^(\s*|.*[^&@%])\{(.*)\}\s*$/ ) {
|
if ( $columns =~ /^(\s*|.*[^&@%]){(.*)}\s*$/ ) {
|
||||||
#
|
#
|
||||||
# Pairs are enclosed in curly brackets.
|
# Pairs are enclosed in curly brackets.
|
||||||
#
|
#
|
||||||
@@ -2444,7 +2356,7 @@ sub split_line2( $$;$$$ ) {
|
|||||||
if ( $currline =~ /^\s*INLINE(?:\(.*\)(:.*)?|:.*)?\s/ || $currline =~ /^\s*IP6?TABLES(?:\(.*\)|:.*)?\s/ ) {
|
if ( $currline =~ /^\s*INLINE(?:\(.*\)(:.*)?|:.*)?\s/ || $currline =~ /^\s*IP6?TABLES(?:\(.*\)|:.*)?\s/ ) {
|
||||||
$inline_matches = $pairs;
|
$inline_matches = $pairs;
|
||||||
|
|
||||||
if ( $columns =~ /^(\s*|.*[^&@%])\{(.*)\}\s*$/ ) {
|
if ( $columns =~ /^(\s*|.*[^&@%]){(.*)}\s*$/ ) {
|
||||||
#
|
#
|
||||||
# Pairs are enclosed in curly brackets.
|
# Pairs are enclosed in curly brackets.
|
||||||
#
|
#
|
||||||
@@ -2458,7 +2370,7 @@ sub split_line2( $$;$$$ ) {
|
|||||||
} elsif ( $checkinline ) {
|
} elsif ( $checkinline ) {
|
||||||
warning_message "This entry needs to be changed before INLINE_MATCHES can be set to Yes";
|
warning_message "This entry needs to be changed before INLINE_MATCHES can be set to Yes";
|
||||||
}
|
}
|
||||||
} elsif ( $currline =~ /^(\s*|.*[^&@%])\{(.*)\}$/ ) {
|
} elsif ( $currline =~ /^(\s*|.*[^&@%]){(.*)}$/ ) {
|
||||||
#
|
#
|
||||||
# Pairs are enclosed in curly brackets.
|
# Pairs are enclosed in curly brackets.
|
||||||
#
|
#
|
||||||
@@ -2656,7 +2568,7 @@ sub open_file( $;$$$$ ) {
|
|||||||
$max_format = supplied $mf ? $mf : 1;
|
$max_format = supplied $mf ? $mf : 1;
|
||||||
$comments_allowed = supplied $ca ? $ca : 0;
|
$comments_allowed = supplied $ca ? $ca : 0;
|
||||||
$nocomment = $nc;
|
$nocomment = $nc;
|
||||||
do_open_file $fname;
|
do_open_file $fname;;
|
||||||
} else {
|
} else {
|
||||||
$ifstack = @ifstack;
|
$ifstack = @ifstack;
|
||||||
'';
|
'';
|
||||||
@@ -4133,7 +4045,7 @@ sub make_mask( $ ) {
|
|||||||
0xffffffff >> ( 32 - $_[0] );
|
0xffffffff >> ( 32 - $_[0] );
|
||||||
}
|
}
|
||||||
|
|
||||||
my @suffixes;
|
my @suffixes = qw(group range threshold nlgroup cprange qthreshold);
|
||||||
|
|
||||||
#
|
#
|
||||||
# Validate a log level -- Drop the trailing '!' and translate to numeric value if appropriate"
|
# Validate a log level -- Drop the trailing '!' and translate to numeric value if appropriate"
|
||||||
@@ -4369,7 +4281,7 @@ sub which( $ ) {
|
|||||||
# Load the kernel modules defined in the 'modules' file.
|
# Load the kernel modules defined in the 'modules' file.
|
||||||
#
|
#
|
||||||
sub load_kernel_modules( ) {
|
sub load_kernel_modules( ) {
|
||||||
my $moduleloader = which( 'modprobe' ) || which( 'insmod' );
|
my $moduleloader = which( 'modprobe' ) || ( which 'insmod' );
|
||||||
|
|
||||||
my $modulesdir = $config{MODULESDIR};
|
my $modulesdir = $config{MODULESDIR};
|
||||||
|
|
||||||
@@ -4402,20 +4314,25 @@ sub load_kernel_modules( ) {
|
|||||||
|
|
||||||
close LSMOD;
|
close LSMOD;
|
||||||
|
|
||||||
MODULE:
|
$config{MODULE_SUFFIX} = 'o gz xz ko o.gz o.xz ko.gz ko.xz' unless $config{MODULE_SUFFIX};
|
||||||
|
|
||||||
|
my @suffixes = split /\s+/ , $config{MODULE_SUFFIX};
|
||||||
|
|
||||||
while ( read_a_line( NORMAL_READ ) ) {
|
while ( read_a_line( NORMAL_READ ) ) {
|
||||||
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 } ) {
|
||||||
if ( $moduleloader =~ /modprobe$/ ) {
|
for my $directory ( @moduledirectories ) {
|
||||||
system( "modprobe -q $module $arguments" );
|
for my $suffix ( @suffixes ) {
|
||||||
$loadedmodules{ $module } = 1;
|
my $modulefile = "$directory/$module.$suffix";
|
||||||
} else {
|
if ( -f $modulefile ) {
|
||||||
for my $directory ( @moduledirectories ) {
|
if ( $moduleloader eq 'insmod' ) {
|
||||||
for my $modulefile ( <$directory/$module.*> ) {
|
system ("insmod $modulefile $arguments" );
|
||||||
system ("insmod $modulefile $arguments" );
|
} else {
|
||||||
|
system( "modprobe $module $arguments" );
|
||||||
|
}
|
||||||
|
|
||||||
$loadedmodules{ $module } = 1;
|
$loadedmodules{ $module } = 1;
|
||||||
next MODULE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4900,10 +4817,6 @@ sub NFLog_Target() {
|
|||||||
qt1( "$iptables $iptablesw -A $sillyname -j NFLOG" );
|
qt1( "$iptables $iptablesw -A $sillyname -j NFLOG" );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub NFLog_Size() {
|
|
||||||
have_capability( 'NFLOG_TARGET' ) && qt1( "$iptables $iptablesw -A $sillyname -j NFLOG --nflog-size 64" );
|
|
||||||
}
|
|
||||||
|
|
||||||
sub Logmark_Target() {
|
sub Logmark_Target() {
|
||||||
qt1( "$iptables $iptablesw -A $sillyname -j LOGMARK" );
|
qt1( "$iptables $iptablesw -A $sillyname -j LOGMARK" );
|
||||||
}
|
}
|
||||||
@@ -5027,10 +4940,6 @@ sub Cpu_Fanout() {
|
|||||||
have_capability( 'NFQUEUE_TARGET' ) && qt1( "$iptables -A $sillyname -j NFQUEUE --queue-balance 0:3 --queue-cpu-fanout" );
|
have_capability( 'NFQUEUE_TARGET' ) && qt1( "$iptables -A $sillyname -j NFQUEUE --queue-balance 0:3 --queue-cpu-fanout" );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub Restore_Wait_Option() {
|
|
||||||
length( `${iptables}-restore --wait < /dev/null 2>&1` ) == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
our %detect_capability =
|
our %detect_capability =
|
||||||
( ACCOUNT_TARGET =>\&Account_Target,
|
( ACCOUNT_TARGET =>\&Account_Target,
|
||||||
AMANDA_HELPER => \&Amanda_Helper,
|
AMANDA_HELPER => \&Amanda_Helper,
|
||||||
@@ -5083,7 +4992,6 @@ our %detect_capability =
|
|||||||
LOG_TARGET => \&Log_Target,
|
LOG_TARGET => \&Log_Target,
|
||||||
ULOG_TARGET => \&Ulog_Target,
|
ULOG_TARGET => \&Ulog_Target,
|
||||||
NFLOG_TARGET => \&NFLog_Target,
|
NFLOG_TARGET => \&NFLog_Target,
|
||||||
NFLOG_SIZE => \&NFLog_Size,
|
|
||||||
MANGLE_ENABLED => \&Mangle_Enabled,
|
MANGLE_ENABLED => \&Mangle_Enabled,
|
||||||
MANGLE_FORWARD => \&Mangle_Forward,
|
MANGLE_FORWARD => \&Mangle_Forward,
|
||||||
MARK => \&Mark,
|
MARK => \&Mark,
|
||||||
@@ -5111,7 +5019,6 @@ our %detect_capability =
|
|||||||
REALM_MATCH => \&Realm_Match,
|
REALM_MATCH => \&Realm_Match,
|
||||||
REAP_OPTION => \&Reap_Option,
|
REAP_OPTION => \&Reap_Option,
|
||||||
RECENT_MATCH => \&Recent_Match,
|
RECENT_MATCH => \&Recent_Match,
|
||||||
RESTORE_WAIT_OPTION => \&Restore_Wait_Option,
|
|
||||||
RPFILTER_MATCH => \&RPFilter_Match,
|
RPFILTER_MATCH => \&RPFilter_Match,
|
||||||
SANE_HELPER => \&SANE_Helper,
|
SANE_HELPER => \&SANE_Helper,
|
||||||
SANE0_HELPER => \&SANE0_Helper,
|
SANE0_HELPER => \&SANE0_Helper,
|
||||||
@@ -5278,9 +5185,6 @@ sub determine_capabilities() {
|
|||||||
$capabilities{TCPMSS_TARGET} = detect_capability( 'TCPMSS_TARGET' );
|
$capabilities{TCPMSS_TARGET} = detect_capability( 'TCPMSS_TARGET' );
|
||||||
$capabilities{CPU_FANOUT} = detect_capability( 'CPU_FANOUT' );
|
$capabilities{CPU_FANOUT} = detect_capability( 'CPU_FANOUT' );
|
||||||
$capabilities{NETMAP_TARGET} = detect_capability( 'NETMAP_TARGET' );
|
$capabilities{NETMAP_TARGET} = detect_capability( 'NETMAP_TARGET' );
|
||||||
$capabilities{NFLOG_SIZE} = detect_capability( 'NFLOG_SIZE' );
|
|
||||||
$capabilities{RESTORE_WAIT_OPTION}
|
|
||||||
= detect_capability( 'RESTORE_WAIT_OPTION' );
|
|
||||||
|
|
||||||
unless ( have_capability 'CT_TARGET' ) {
|
unless ( have_capability 'CT_TARGET' ) {
|
||||||
$capabilities{HELPER_MATCH} = detect_capability 'HELPER_MATCH';
|
$capabilities{HELPER_MATCH} = detect_capability 'HELPER_MATCH';
|
||||||
@@ -5329,13 +5233,7 @@ sub ensure_config_path() {
|
|||||||
fatal_error "CONFIG_PATH not found in $f" unless $config{CONFIG_PATH};
|
fatal_error "CONFIG_PATH not found in $f" unless $config{CONFIG_PATH};
|
||||||
}
|
}
|
||||||
|
|
||||||
my $path = $config{CONFIG_PATH};
|
@config_path = split /:/, $config{CONFIG_PATH};
|
||||||
|
|
||||||
my $chop = ( $path =~ s/^:// );
|
|
||||||
|
|
||||||
@config_path = split /:/, $path;
|
|
||||||
|
|
||||||
shift @config_path if $chop && ( $export || $> != 0 );
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# To accomodate Cygwin-based compilation, we have separate directories for files whose names
|
# To accomodate Cygwin-based compilation, we have separate directories for files whose names
|
||||||
@@ -5464,11 +5362,11 @@ sub update_config_file( $ ) {
|
|||||||
update_default( 'BALANCE_PROVIDERS', 'Yes' );
|
update_default( 'BALANCE_PROVIDERS', 'Yes' );
|
||||||
}
|
}
|
||||||
|
|
||||||
update_default( 'EXPORTMODULES', 'No' );
|
update_default( 'EXPORTMODULES', 'No' );
|
||||||
update_default( 'RESTART', 'reload' );
|
update_default( 'RESTART', 'reload' );
|
||||||
update_default( 'PAGER', $shorewallrc1{DEFAULT_PAGER} );
|
update_default( 'PAGER', $shorewallrc1{DEFAULT_PAGER} );
|
||||||
update_default( 'LOGFORMAT', 'Shorewall:%s:%s:' );
|
update_default( 'LOGFORMAT', 'Shorewall:%s:%s:' );
|
||||||
update_default( 'LOGLIMIT', '' );
|
update_default( 'LOGLIMIT', '' );
|
||||||
|
|
||||||
if ( $family == F_IPV4 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
update_default( 'BLACKLIST_DEFAULT', 'dropBcasts,dropNotSyn,dropInvalid' );
|
update_default( 'BLACKLIST_DEFAULT', 'dropBcasts,dropNotSyn,dropInvalid' );
|
||||||
@@ -6153,6 +6051,7 @@ sub get_configuration( $$$$ ) {
|
|||||||
#
|
#
|
||||||
# get_capabilities requires that the true settings of these options be established
|
# get_capabilities requires that the true settings of these options be established
|
||||||
#
|
#
|
||||||
|
default 'MODULE_PREFIX', 'ko ko.gz o o.gz gz';
|
||||||
default_yes_no 'LOAD_HELPERS_ONLY' , 'Yes';
|
default_yes_no 'LOAD_HELPERS_ONLY' , 'Yes';
|
||||||
|
|
||||||
if ( ! $export && $> == 0 ) {
|
if ( ! $export && $> == 0 ) {
|
||||||
@@ -6338,7 +6237,7 @@ sub get_configuration( $$$$ ) {
|
|||||||
$config{LOG_VERBOSITY} = -1;
|
$config{LOG_VERBOSITY} = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
default_yes_no 'ADD_IP_ALIASES' , $family == F_IPV4 ? 'Yes' : '';
|
default_yes_no 'ADD_IP_ALIASES' , 'Yes';
|
||||||
default_yes_no 'ADD_SNAT_ALIASES' , '';
|
default_yes_no 'ADD_SNAT_ALIASES' , '';
|
||||||
default_yes_no 'DETECT_DNAT_IPADDRS' , '';
|
default_yes_no 'DETECT_DNAT_IPADDRS' , '';
|
||||||
default_yes_no 'DETECT_DNAT_IPADDRS' , '';
|
default_yes_no 'DETECT_DNAT_IPADDRS' , '';
|
||||||
@@ -6493,17 +6392,6 @@ sub get_configuration( $$$$ ) {
|
|||||||
default_yes_no 'AUTOMAKE' , '';
|
default_yes_no 'AUTOMAKE' , '';
|
||||||
default_yes_no 'TRACK_PROVIDERS' , '';
|
default_yes_no 'TRACK_PROVIDERS' , '';
|
||||||
default_yes_no 'BALANCE_PROVIDERS' , $config{USE_DEFAULT_RT} ? 'Yes' : '';
|
default_yes_no 'BALANCE_PROVIDERS' , $config{USE_DEFAULT_RT} ? 'Yes' : '';
|
||||||
default_yes_no 'USE_NFLOG_SIZE' , '';
|
|
||||||
|
|
||||||
if ( $config{USE_NFLOG_SIZE} ) {
|
|
||||||
if ( have_capability( 'NFLOG_SIZE' ) ) {
|
|
||||||
@suffixes = qw(group size threshold nlgroup cprange qthreshold);
|
|
||||||
} else {
|
|
||||||
fatal_error "USE_NFLOG_SIZE=Yes, but the --nflog-size capabiity is not present";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
@suffixes = qw(group range threshold nlgroup cprange qthreshold);
|
|
||||||
}
|
|
||||||
|
|
||||||
unless ( ( $config{NULL_ROUTE_RFC1918} || '' ) =~ /^(?:blackhole|unreachable|prohibit)$/ ) {
|
unless ( ( $config{NULL_ROUTE_RFC1918} || '' ) =~ /^(?:blackhole|unreachable|prohibit)$/ ) {
|
||||||
default_yes_no( 'NULL_ROUTE_RFC1918', '' );
|
default_yes_no( 'NULL_ROUTE_RFC1918', '' );
|
||||||
@@ -6924,12 +6812,6 @@ sub get_configuration( $$$$ ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( supplied( $val = $config{MUTEX_TIMEOUT} ) ) {
|
|
||||||
fatal_error "Invalid value ($val) for MUTEX_TIMEOUT" unless $val && $val =~ /^\d+$/;
|
|
||||||
} else {
|
|
||||||
$config{MUTEX_TIMEOUT} = 60;
|
|
||||||
}
|
|
||||||
|
|
||||||
add_variables %config;
|
add_variables %config;
|
||||||
|
|
||||||
while ( my ($var, $val ) = each %renamed ) {
|
while ( my ($var, $val ) = each %renamed ) {
|
||||||
|
@@ -63,6 +63,7 @@ our @EXPORT = ( qw( ALLIPv4
|
|||||||
validate_host
|
validate_host
|
||||||
validate_range
|
validate_range
|
||||||
ip_range_explicit
|
ip_range_explicit
|
||||||
|
expand_port_range
|
||||||
allipv4
|
allipv4
|
||||||
allipv6
|
allipv6
|
||||||
allip
|
allip
|
||||||
@@ -73,6 +74,10 @@ our @EXPORT = ( qw( ALLIPv4
|
|||||||
resolve_proto
|
resolve_proto
|
||||||
resolve_dnsname
|
resolve_dnsname
|
||||||
proto_name
|
proto_name
|
||||||
|
validate_port
|
||||||
|
validate_portpair
|
||||||
|
validate_portpair1
|
||||||
|
validate_port_list
|
||||||
validate_icmp
|
validate_icmp
|
||||||
validate_icmp6
|
validate_icmp6
|
||||||
) );
|
) );
|
||||||
@@ -406,6 +411,114 @@ sub proto_name( $ ) {
|
|||||||
$proto =~ /^(\d+)$/ ? $prototoname[ $proto ] || scalar getprotobynumber $proto : $proto
|
$proto =~ /^(\d+)$/ ? $prototoname[ $proto ] || scalar getprotobynumber $proto : $proto
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub validate_port( $$ ) {
|
||||||
|
my ($proto, $port) = @_;
|
||||||
|
|
||||||
|
my $value;
|
||||||
|
|
||||||
|
if ( $port =~ /^(\d+)$/ || $port =~ /^0x/ ) {
|
||||||
|
$port = numeric_value $port;
|
||||||
|
return $port if defined $port && $port && $port <= 65535;
|
||||||
|
} else {
|
||||||
|
$proto = proto_name $proto if $proto =~ /^(\d+)$/;
|
||||||
|
$value = getservbyname( $port, $proto );
|
||||||
|
}
|
||||||
|
|
||||||
|
return $value if defined $value;
|
||||||
|
|
||||||
|
fatal_error "The separator for a port range is ':', not '-' ($port)" if $port =~ /^\d+-\d+$/;
|
||||||
|
|
||||||
|
fatal_error "Invalid/Unknown $proto port/service ($_[1])" unless defined $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub validate_portpair( $$ ) {
|
||||||
|
my ($proto, $portpair) = @_;
|
||||||
|
my $what;
|
||||||
|
my $pair = $portpair;
|
||||||
|
#
|
||||||
|
# Accept '-' as a port-range separator
|
||||||
|
#
|
||||||
|
$pair =~ tr/-/:/ if $pair =~ /^[-0-9]+$/;
|
||||||
|
|
||||||
|
fatal_error "Invalid port range ($portpair)" if $pair =~ tr/:/:/ > 1;
|
||||||
|
|
||||||
|
$pair = "0$pair" if substr( $pair, 0, 1 ) eq ':';
|
||||||
|
$pair = "${pair}65535" if substr( $pair, -1, 1 ) eq ':';
|
||||||
|
|
||||||
|
my @ports = split /:/, $pair, 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, UDPLITE, SCTP or DCCP" unless
|
||||||
|
defined $protonum && ( $protonum == TCP ||
|
||||||
|
$protonum == UDP ||
|
||||||
|
$protonum == UDPLITE ||
|
||||||
|
$protonum == SCTP ||
|
||||||
|
$protonum == DCCP );
|
||||||
|
join ':', @ports;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
sub validate_portpair1( $$ ) {
|
||||||
|
my ($proto, $portpair) = @_;
|
||||||
|
my $what;
|
||||||
|
|
||||||
|
fatal_error "Invalid port range ($portpair)" if $portpair =~ tr/-/-/ > 1;
|
||||||
|
|
||||||
|
$portpair = "1$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[0] < $ports[1];
|
||||||
|
} else {
|
||||||
|
$what = 'port';
|
||||||
|
fatal_error 'Invalid port number (0)' unless $portpair;
|
||||||
|
}
|
||||||
|
|
||||||
|
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( $$ ) {
|
||||||
|
my $result = '';
|
||||||
|
my ( $proto, $list ) = @_;
|
||||||
|
my @list = split_list( $list, 'port' );
|
||||||
|
|
||||||
|
if ( @list > 1 && $list =~ /[:-]/ ) {
|
||||||
|
require_capability( 'XMULTIPORT' , 'Port ranges in a port list', '' );
|
||||||
|
}
|
||||||
|
|
||||||
|
$proto = proto_name $proto;
|
||||||
|
|
||||||
|
for ( @list ) {
|
||||||
|
my $value = validate_portpair( $proto , $_ );
|
||||||
|
$result = $result ? join ',', $result, $value : $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
$result;
|
||||||
|
}
|
||||||
|
|
||||||
my %icmp_types = ( any => 'any',
|
my %icmp_types = ( any => 'any',
|
||||||
'echo-reply' => 0,
|
'echo-reply' => 0,
|
||||||
'destination-unreachable' => 3,
|
'destination-unreachable' => 3,
|
||||||
@@ -459,6 +572,67 @@ sub validate_icmp( $ ) {
|
|||||||
fatal_error "Invalid ICMP Type ($type)"
|
fatal_error "Invalid ICMP Type ($type)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Expands a port range into a minimal list of ( port, mask ) pairs.
|
||||||
|
# Each port and mask are expressed as 4 hex nibbles without a leading '0x'.
|
||||||
|
#
|
||||||
|
# Example:
|
||||||
|
#
|
||||||
|
# DB<3> @foo = Shorewall::IPAddrs::expand_port_range( 6, '110:' ); print "@foo\n"
|
||||||
|
# 006e fffe 0070 fff0 0080 ff80 0100 ff00 0200 fe00 0400 fc00 0800 f800 1000 f000 2000 e000 4000 c000 8000 8000
|
||||||
|
#
|
||||||
|
sub expand_port_range( $$ ) {
|
||||||
|
my ( $proto, $range ) = @_;
|
||||||
|
|
||||||
|
if ( $range =~ /^(.*):(.*)$/ ) {
|
||||||
|
my ( $first, $last ) = ( $1, $2);
|
||||||
|
my @result;
|
||||||
|
|
||||||
|
fatal_error "Invalid port range ($range)" unless $first ne '' or $last ne '';
|
||||||
|
#
|
||||||
|
# Supply missing first/last port number
|
||||||
|
#
|
||||||
|
$first = 0 if $first eq '';
|
||||||
|
$last = 65535 if $last eq '';
|
||||||
|
#
|
||||||
|
# Validate the ports
|
||||||
|
#
|
||||||
|
( $first , $last ) = ( validate_port( $proto, $first || 1 ) , validate_port( $proto, $last ) );
|
||||||
|
|
||||||
|
$last++; #Increment last address for limit testing.
|
||||||
|
#
|
||||||
|
# Break the range into groups:
|
||||||
|
#
|
||||||
|
# - If the first port in the remaining range is odd, then the next group is ( <first>, ffff ).
|
||||||
|
# - Otherwise, find the largest power of two P that divides the first address such that
|
||||||
|
# the remaining range has less than or equal to P ports. The next group is
|
||||||
|
# ( <first> , ~( P-1 ) ).
|
||||||
|
#
|
||||||
|
while ( ( my $ports = ( $last - $first ) ) > 0 ) {
|
||||||
|
my $mask = 0xffff; #Mask for current ports in group.
|
||||||
|
my $y = 2; #Next power of two to test
|
||||||
|
my $z = 1; #Number of ports in current group (Previous value of $y).
|
||||||
|
|
||||||
|
while ( ( ! ( $first % $y ) ) && ( $y <= $ports ) ) {
|
||||||
|
$mask <<= 1;
|
||||||
|
$z = $y;
|
||||||
|
$y <<= 1;
|
||||||
|
}
|
||||||
|
#
|
||||||
|
#
|
||||||
|
push @result, sprintf( '%04x', $first ) , sprintf( '%04x' , $mask & 0xffff );
|
||||||
|
$first += $z;
|
||||||
|
}
|
||||||
|
|
||||||
|
fatal_error "Invalid port range ($range)" unless @result; # first port > last port
|
||||||
|
|
||||||
|
@result;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
( sprintf( '%04x' , validate_port( $proto, $range ) ) , 'ffff' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub valid_6address( $ ) {
|
sub valid_6address( $ ) {
|
||||||
my $address = $_[0];
|
my $address = $_[0];
|
||||||
|
|
||||||
|
@@ -667,7 +667,6 @@ sub create_docker_rules() {
|
|||||||
|
|
||||||
my $chainref = $filter_table->{FORWARD};
|
my $chainref = $filter_table->{FORWARD};
|
||||||
|
|
||||||
add_commands( $chainref, '[ -n "$g_dockeringress" ] && echo "-A FORWARD -j DOCKER-INGRESS" >&3', );
|
|
||||||
add_commands( $chainref, '[ -n "$g_dockernetwork" ] && echo "-A FORWARD -j DOCKER-ISOLATION" >&3', );
|
add_commands( $chainref, '[ -n "$g_dockernetwork" ] && echo "-A FORWARD -j DOCKER-ISOLATION" >&3', );
|
||||||
|
|
||||||
if ( my $dockerref = known_interface('docker0') ) {
|
if ( my $dockerref = known_interface('docker0') ) {
|
||||||
@@ -2448,7 +2447,7 @@ sub setup_mss( ) {
|
|||||||
my $clampmss = $config{CLAMPMSS};
|
my $clampmss = $config{CLAMPMSS};
|
||||||
my $option;
|
my $option;
|
||||||
my @match;
|
my @match;
|
||||||
my $chainref = $mangle_table->{FORWARD};
|
my $chainref = $filter_table->{FORWARD};
|
||||||
|
|
||||||
if ( $clampmss ) {
|
if ( $clampmss ) {
|
||||||
if ( "\L$clampmss" eq 'yes' ) {
|
if ( "\L$clampmss" eq 'yes' ) {
|
||||||
|
@@ -941,17 +941,7 @@ sub handle_nat_rule( $$$$$$$$$$$$$ ) {
|
|||||||
} else {
|
} else {
|
||||||
$server = $1 if $family == F_IPV6 && $server =~ /^\[(.+)\]$/;
|
$server = $1 if $family == F_IPV6 && $server =~ /^\[(.+)\]$/;
|
||||||
fatal_error "Invalid server IP address ($server)" if $server eq ALLIP || $server eq NILIP;
|
fatal_error "Invalid server IP address ($server)" if $server eq ALLIP || $server eq NILIP;
|
||||||
|
my @servers = validate_address $server, 1;
|
||||||
my @servers;
|
|
||||||
|
|
||||||
if ( ( $server =~ /^([&%])(.+)/ ) ) {
|
|
||||||
$server = record_runtime_address( $1, $2 );
|
|
||||||
$server =~ s/ $//;
|
|
||||||
@servers = ( $server );
|
|
||||||
} else {
|
|
||||||
@servers = validate_address $server, 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$server = join ',', @servers;
|
$server = join ',', @servers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -125,7 +125,7 @@ sub initialize( $ ) {
|
|||||||
# Set up marking for 'tracked' interfaces.
|
# Set up marking for 'tracked' interfaces.
|
||||||
#
|
#
|
||||||
sub setup_route_marking() {
|
sub setup_route_marking() {
|
||||||
my $mask = in_hex( $globals{PROVIDER_MASK} );
|
my $mask = in_hex( $globals{PROVIDER_MASK} );
|
||||||
my $exmask = have_capability( 'EXMARK' ) ? "/$mask" : '';
|
my $exmask = have_capability( 'EXMARK' ) ? "/$mask" : '';
|
||||||
|
|
||||||
require_capability( $_ , q(The provider 'track' option) , 's' ) for qw/CONNMARK_MATCH CONNMARK/;
|
require_capability( $_ , q(The provider 'track' option) , 's' ) for qw/CONNMARK_MATCH CONNMARK/;
|
||||||
@@ -502,7 +502,7 @@ sub process_a_provider( $ ) {
|
|||||||
|
|
||||||
if ( ( $gw = lc $gateway ) eq 'detect' ) {
|
if ( ( $gw = lc $gateway ) eq 'detect' ) {
|
||||||
fatal_error "Configuring multiple providers through one interface requires an explicit gateway" if $shared;
|
fatal_error "Configuring multiple providers through one interface requires an explicit gateway" if $shared;
|
||||||
$gateway = get_interface_gateway( $interface, undef, $number );
|
$gateway = get_interface_gateway( $interface, undef, 1 );
|
||||||
$gatewaycase = 'detect';
|
$gatewaycase = 'detect';
|
||||||
set_interface_option( $interface, 'gateway', 'detect' );
|
set_interface_option( $interface, 'gateway', 'detect' );
|
||||||
} elsif ( $gw eq 'none' ) {
|
} elsif ( $gw eq 'none' ) {
|
||||||
@@ -512,9 +512,6 @@ sub process_a_provider( $ ) {
|
|||||||
set_interface_option( $interface, 'gateway', 'none' );
|
set_interface_option( $interface, 'gateway', 'none' );
|
||||||
} elsif ( $gateway && $gateway ne '-' ) {
|
} elsif ( $gateway && $gateway ne '-' ) {
|
||||||
( $gateway, $mac ) = split_host_list( $gateway, 0 );
|
( $gateway, $mac ) = split_host_list( $gateway, 0 );
|
||||||
|
|
||||||
$gateway = $1 if $family == F_IPV6 && $gateway =~ /^\[(.+)\]$/;
|
|
||||||
|
|
||||||
validate_address $gateway, 0;
|
validate_address $gateway, 0;
|
||||||
|
|
||||||
if ( defined $mac ) {
|
if ( defined $mac ) {
|
||||||
@@ -605,7 +602,6 @@ sub process_a_provider( $ ) {
|
|||||||
} elsif ( $option eq 'nohostroute' ) {
|
} elsif ( $option eq 'nohostroute' ) {
|
||||||
$hostroute = 0;
|
$hostroute = 0;
|
||||||
} elsif ( $option eq 'persistent' ) {
|
} elsif ( $option eq 'persistent' ) {
|
||||||
warning_message "When RESTORE_DEFAULT_ROUTE=Yes, the 'persistent' option may not work as expected" if $config{RESTORE_DEFAULT_ROUTE};
|
|
||||||
$persistent = 1;
|
$persistent = 1;
|
||||||
} else {
|
} else {
|
||||||
fatal_error "Invalid option ($option)";
|
fatal_error "Invalid option ($option)";
|
||||||
@@ -692,6 +688,7 @@ sub process_a_provider( $ ) {
|
|||||||
|
|
||||||
$pref = 10000 + $number - 1;
|
$pref = 10000 + $number - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unless ( $loose || $pseudo ) {
|
unless ( $loose || $pseudo ) {
|
||||||
@@ -850,7 +847,7 @@ sub add_a_provider( $$ ) {
|
|||||||
if ( $tproxy ) {
|
if ( $tproxy ) {
|
||||||
emit 'run_ip route add local ' . ALLIP . " dev $physical table $id";
|
emit 'run_ip route add local ' . ALLIP . " dev $physical table $id";
|
||||||
} else {
|
} else {
|
||||||
emit "run_ip route replace default dev $physical table $id";
|
emit "run_ip route add default dev $physical table $id";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -866,7 +863,7 @@ sub add_a_provider( $$ ) {
|
|||||||
emit qq(echo "\$IP route del $gateway src $address dev $physical ${mtu}table $id $realm > /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing);
|
emit qq(echo "\$IP route del $gateway src $address dev $physical ${mtu}table $id $realm > /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing);
|
||||||
}
|
}
|
||||||
|
|
||||||
emit( "run_ip route replace default via $gateway src $address dev $physical ${mtu}table $id $realm" );
|
emit( "run_ip route add default via $gateway src $address dev $physical ${mtu}table $id $realm" );
|
||||||
emit( qq( echo "\$IP route del default via $gateway src $address dev $physical ${mtu}table $id $realm > /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing) );
|
emit( qq( echo "\$IP route del default via $gateway src $address dev $physical ${mtu}table $id $realm > /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -876,24 +873,24 @@ sub add_a_provider( $$ ) {
|
|||||||
emit( "run_ip rule add from $address pref 20000 table $id" ,
|
emit( "run_ip rule add from $address pref 20000 table $id" ,
|
||||||
"echo \"\$IP -$family rule del from $address pref 20000> /dev/null 2>&1\" >> \${VARDIR}/undo_${table}_routing" );
|
"echo \"\$IP -$family rule del from $address pref 20000> /dev/null 2>&1\" >> \${VARDIR}/undo_${table}_routing" );
|
||||||
} else {
|
} else {
|
||||||
emit ( "find_interface_addresses $physical | while read address; do",
|
emit ( "find_interface_addresses $physical | while read address; do" );
|
||||||
" qt \$IP -$family rule del from \$address",
|
emit ( " qt \$IP -$family rule del from \$address" );
|
||||||
" run_ip rule add from \$address pref 20000 table $id",
|
emit ( " run_ip rule add from \$address pref 20000 table $id",
|
||||||
" echo \"\$IP -$family rule del from \$address pref 20000 > /dev/null 2>&1\" >> \${VARDIR}/undo_${table}_routing",
|
" echo \"\$IP -$family rule del from \$address pref 20000 > /dev/null 2>&1\" >> \${VARDIR}/undo_${table}_routing",
|
||||||
' rulenum=$(($rulenum + 1))',
|
' rulenum=$(($rulenum + 1))',
|
||||||
'done'
|
'done'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ( @{$providerref->{persistent_routes}} ) {
|
if ( @{$providerref->{persistent_routes}} ) {
|
||||||
emit '';
|
emit '';
|
||||||
emit $_ for @{$providers{$table}->{persistent_routes}};
|
emit $_ for @{$providers{$table}->{persistent_routes}};
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( @{$providerref->{persistent_rules}} ) {
|
if ( @{$providerref->{persistent_rules}} ) {
|
||||||
emit '';
|
emit '';
|
||||||
emit $_ for @{$providers{$table}->{persistent_rules}};
|
emit $_ for @{$providers{$table}->{persistent_rules}};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pop_indent;
|
pop_indent;
|
||||||
@@ -901,6 +898,7 @@ sub add_a_provider( $$ ) {
|
|||||||
emit( qq(fi\n),
|
emit( qq(fi\n),
|
||||||
qq(echo 1 > \${VARDIR}/${physical}_disabled) );
|
qq(echo 1 > \${VARDIR}/${physical}_disabled) );
|
||||||
|
|
||||||
|
|
||||||
pop_indent;
|
pop_indent;
|
||||||
|
|
||||||
emit( "}\n" );
|
emit( "}\n" );
|
||||||
@@ -926,7 +924,7 @@ sub add_a_provider( $$ ) {
|
|||||||
if ( $tproxy ) {
|
if ( $tproxy ) {
|
||||||
emit 'run_ip route add local ' . ALLIP . " dev $physical table $id";
|
emit 'run_ip route add local ' . ALLIP . " dev $physical table $id";
|
||||||
} else {
|
} else {
|
||||||
emit "run_ip route replace default dev $physical table $id";
|
emit "run_ip route add default dev $physical table $id";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -958,7 +956,7 @@ CEOF
|
|||||||
my $hexmark = in_hex( $mark );
|
my $hexmark = in_hex( $mark );
|
||||||
my $mask = have_capability( 'FWMARK_RT_MASK' ) ? '/' . in_hex( $globals{ $tproxy && ! $local ? 'TPROXY_MARK' : 'PROVIDER_MASK' } ) : '';
|
my $mask = have_capability( 'FWMARK_RT_MASK' ) ? '/' . in_hex( $globals{ $tproxy && ! $local ? 'TPROXY_MARK' : 'PROVIDER_MASK' } ) : '';
|
||||||
|
|
||||||
emit ( "qt \$IP -$family rule del fwmark ${hexmark}${mask}" ) if $persistent || $config{DELETE_THEN_ADD};
|
emit ( "qt \$IP -$family rule del fwmark ${hexmark}${mask}" ) if $config{DELETE_THEN_ADD};
|
||||||
|
|
||||||
emit ( "run_ip rule add fwmark ${hexmark}${mask} pref $pref table $id",
|
emit ( "run_ip rule add fwmark ${hexmark}${mask} pref $pref table $id",
|
||||||
"echo \"\$IP -$family rule del fwmark ${hexmark}${mask} > /dev/null 2>&1\" >> \${VARDIR}/undo_${table}_routing"
|
"echo \"\$IP -$family rule del fwmark ${hexmark}${mask} > /dev/null 2>&1\" >> \${VARDIR}/undo_${table}_routing"
|
||||||
@@ -987,7 +985,7 @@ CEOF
|
|||||||
emit qq(run_ip route replace $gateway src $address dev $physical ${mtu}table $id $realm);
|
emit qq(run_ip route replace $gateway src $address dev $physical ${mtu}table $id $realm);
|
||||||
}
|
}
|
||||||
|
|
||||||
emit "run_ip route replace default via $gateway src $address dev $physical ${mtu}table $id $realm";
|
emit "run_ip route add default via $gateway src $address dev $physical ${mtu}table $id $realm";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $balance ) {
|
if ( $balance ) {
|
||||||
@@ -999,16 +997,14 @@ CEOF
|
|||||||
emit '';
|
emit '';
|
||||||
if ( $gateway ) {
|
if ( $gateway ) {
|
||||||
emit qq(run_ip route replace $gateway/32 dev $physical table $id) if $hostroute;
|
emit qq(run_ip route replace $gateway/32 dev $physical table $id) if $hostroute;
|
||||||
emit qq(run_ip route replace default via $gateway src $address dev $physical table $id metric $number);
|
emit qq(run_ip route add default via $gateway src $address dev $physical table $id metric $number);
|
||||||
emit qq(echo "\$IP -$family route del default via $gateway table $id > /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing);
|
emit qq(echo "\$IP -$family route del default via $gateway table $id > /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing);
|
||||||
emit qq(echo "\$IP -4 route del $gateway/32 dev $physical table $id > /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing) if $family == F_IPV4;
|
emit qq(echo "\$IP -4 route del $gateway/32 dev $physical table $id > /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing) if $family == F_IPV4;
|
||||||
} else {
|
} else {
|
||||||
emit qq(run_ip route replace default table $id dev $physical metric $number);
|
emit qq(run_ip route add default table $id dev $physical metric $number);
|
||||||
emit qq(echo "\$IP -$family route del default dev $physical table $id > /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing);
|
emit qq(echo "\$IP -$family route del default dev $physical table $id > /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing);
|
||||||
}
|
}
|
||||||
|
|
||||||
emit( 'g_fallback=Yes' ) if $persistent;
|
|
||||||
|
|
||||||
$metrics = 1;
|
$metrics = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1030,13 +1026,12 @@ CEOF
|
|||||||
} elsif ( ! $noautosrc ) {
|
} elsif ( ! $noautosrc ) {
|
||||||
if ( $shared ) {
|
if ( $shared ) {
|
||||||
if ( $persistent ) {
|
if ( $persistent ) {
|
||||||
emit( qq(if ! egrep -q "^20000:[[:space:]]+from $address lookup $id"; then),
|
emit( qq(if ! egrep -q "^2000:[[:space:]]+from $address lookup $id"; then),
|
||||||
qq( qt \$IP -$family rule del from $address pref 20000),
|
|
||||||
qq( run_ip rule add from $address pref 20000 table $id),
|
qq( run_ip rule add from $address pref 20000 table $id),
|
||||||
qq( echo "\$IP -$family rule del from $address pref 20000> /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing ),
|
qq( echo "\$IP -$family rule del from $address pref 20000> /dev/null 2>&1" >> \${VARDIR}/undo_${table}_routing ),
|
||||||
qq(fi) );
|
qq(fi) );
|
||||||
} else {
|
} else {
|
||||||
emit "qt \$IP -$family rule del from $address" if $persistent || $config{DELETE_THEN_ADD};
|
emit "qt \$IP -$family rule del from $address" if $config{DELETE_THEN_ADD};
|
||||||
emit( "run_ip rule add from $address pref 20000 table $id" ,
|
emit( "run_ip rule add from $address pref 20000 table $id" ,
|
||||||
"echo \"\$IP -$family rule del from $address pref 20000> /dev/null 2>&1\" >> \${VARDIR}/undo_${table}_routing" );
|
"echo \"\$IP -$family rule del from $address pref 20000> /dev/null 2>&1\" >> \${VARDIR}/undo_${table}_routing" );
|
||||||
}
|
}
|
||||||
@@ -1093,21 +1088,7 @@ CEOF
|
|||||||
emit( "setup_${dev}_tc" ) if $tcdevices->{$interface};
|
emit( "setup_${dev}_tc" ) if $tcdevices->{$interface};
|
||||||
}
|
}
|
||||||
|
|
||||||
emit( qq(rm -f \${VARDIR}/${physical}_disabled),
|
emit( qq(rm -f \${VARDIR}/${physical}_disabled) );
|
||||||
$pseudo ? "run_enabled_exit ${physical} ${interface}" : "run_enabled_exit ${physical} ${interface} ${table}"
|
|
||||||
);
|
|
||||||
|
|
||||||
if ( ! $pseudo && $config{USE_DEFAULT_RT} && $config{RESTORE_DEFAULT_ROUTE} ) {
|
|
||||||
emit ( '#',
|
|
||||||
'# We now have a viable default route in the \'default\' table so delete any default routes in the main table',
|
|
||||||
'#',
|
|
||||||
'while qt \$IP -$family route del default table ' . MAIN_TABLE . '; do',
|
|
||||||
' true',
|
|
||||||
'done',
|
|
||||||
''
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
emit_started_message( '', 2, $pseudo, $table, $number );
|
emit_started_message( '', 2, $pseudo, $table, $number );
|
||||||
|
|
||||||
if ( get_interface_option( $interface, 'used_address_variable' ) || get_interface_option( $interface, 'used_gateway_variable' ) ) {
|
if ( get_interface_option( $interface, 'used_address_variable' ) || get_interface_option( $interface, 'used_gateway_variable' ) ) {
|
||||||
@@ -1252,14 +1233,12 @@ CEOF
|
|||||||
"qt \$TC qdisc del dev $physical ingress\n" ) if $tcdevices->{$interface};
|
"qt \$TC qdisc del dev $physical ingress\n" ) if $tcdevices->{$interface};
|
||||||
}
|
}
|
||||||
|
|
||||||
emit( "echo 1 > \${VARDIR}/${physical}.status",
|
emit( "echo 1 > \${VARDIR}/${physical}.status" );
|
||||||
$pseudo ? "run_disabled_exit ${physical} ${interface}" : "run_disabled_exit ${physical} ${interface} ${table}"
|
|
||||||
);
|
|
||||||
|
|
||||||
if ( $pseudo ) {
|
if ( $pseudo ) {
|
||||||
emit( "progress_message2 \"Optional Interface $table stopped\"" );
|
emit( "progress_message2 \" Optional Interface $table stopped\"" );
|
||||||
} else {
|
} else {
|
||||||
emit( "progress_message2 \"Provider $table ($number) stopped\"" );
|
emit( "progress_message2 \" Provider $table ($number) stopped\"" );
|
||||||
}
|
}
|
||||||
|
|
||||||
pop_indent;
|
pop_indent;
|
||||||
@@ -1360,7 +1339,7 @@ sub add_an_rtrule1( $$$$$ ) {
|
|||||||
|
|
||||||
$priority = "pref $priority";
|
$priority = "pref $priority";
|
||||||
|
|
||||||
push @{$providerref->{rules}}, "qt \$IP -$family rule del $source ${dest}${mark} $priority" if $persistent || $config{DELETE_THEN_ADD};
|
push @{$providerref->{rules}}, "qt \$IP -$family rule del $source ${dest}${mark} $priority" if $config{DELETE_THEN_ADD};
|
||||||
push @{$providerref->{rules}}, "run_ip rule add $source ${dest}${mark} $priority table $id";
|
push @{$providerref->{rules}}, "run_ip rule add $source ${dest}${mark} $priority table $id";
|
||||||
|
|
||||||
if ( $persistent ) {
|
if ( $persistent ) {
|
||||||
@@ -1458,22 +1437,22 @@ sub add_a_route( ) {
|
|||||||
|
|
||||||
if ( $gateway ne '-' ) {
|
if ( $gateway ne '-' ) {
|
||||||
if ( $device ne '-' ) {
|
if ( $device ne '-' ) {
|
||||||
push @$routes, qq(run_ip route replace $dest via $gateway dev $physical table $id);
|
push @$routes, qq(run_ip route add $dest via $gateway dev $physical table $id);
|
||||||
push @$persistent_routes, qq(run_ip route replace $dest via $gateway dev $physical table $id) if $persistent;
|
push @$persistent_routes, qq(run_ip route add $dest via $gateway dev $physical table $id) if $persistent;
|
||||||
push @$routes, q(echo "$IP ) . qq(-$family route del $dest via $gateway dev $physical table $id > /dev/null 2>&1" >> \${VARDIR}/undo_${provider}_routing) if $number >= DEFAULT_TABLE;
|
push @$routes, q(echo "$IP ) . qq(-$family route del $dest via $gateway dev $physical table $id > /dev/null 2>&1" >> \${VARDIR}/undo_${provider}_routing) if $number >= DEFAULT_TABLE;
|
||||||
} elsif ( $null ) {
|
} elsif ( $null ) {
|
||||||
push @$routes, qq(run_ip route replace $null $dest table $id);
|
push @$routes, qq(run_ip route add $null $dest table $id);
|
||||||
push @$persistent_routes, qq(run_ip route replace $null $dest table $id) if $persistent;
|
push @$persistent_routes, qq(run_ip route add $null $dest table $id) if $persistent;
|
||||||
push @$routes, q(echo "$IP ) . qq(-$family route del $null $dest table $id > /dev/null 2>&1" >> \${VARDIR}/undo_${provider}_routing) if $number >= DEFAULT_TABLE;
|
push @$routes, q(echo "$IP ) . qq(-$family route del $null $dest table $id > /dev/null 2>&1" >> \${VARDIR}/undo_${provider}_routing) if $number >= DEFAULT_TABLE;
|
||||||
} else {
|
} else {
|
||||||
push @$routes, qq(run_ip route replace $dest via $gateway table $id);
|
push @$routes, qq(run_ip route add $dest via $gateway table $id);
|
||||||
push @$persistent_routes, qq(run_ip route replace $dest via $gateway table $id) if $persistent;
|
push @$persistent_routes, qq(run_ip route add $dest via $gateway table $id) if $persistent;
|
||||||
push @$routes, q(echo "$IP ) . qq(-$family route del $dest via $gateway table $id > /dev/null 2>&1" >> \${VARDIR}/undo_${provider}_routing) if $number >= DEFAULT_TABLE;
|
push @$routes, q(echo "$IP ) . qq(-$family route del $dest via $gateway table $id > /dev/null 2>&1" >> \${VARDIR}/undo_${provider}_routing) if $number >= DEFAULT_TABLE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fatal_error "You must specify a device for this route" unless $physical;
|
fatal_error "You must specify a device for this route" unless $physical;
|
||||||
push @$routes, qq(run_ip route replace $dest dev $physical table $id);
|
push @$routes, qq(run_ip route add $dest dev $physical table $id);
|
||||||
push @$persistent_routes, qq(run_ip route replace $dest dev $physical table $id) if $persistent;
|
push @$persistent_routes, qq(run_ip route add $dest dev $physical table $id) if $persistent;
|
||||||
push @$routes, q(echo "$IP ) . qq(-$family route del $dest dev $physical table $id > /dev/null 2>&1" >> \${VARDIR}/undo_${provider}_routing) if $number >= DEFAULT_TABLE;
|
push @$routes, q(echo "$IP ) . qq(-$family route del $dest dev $physical table $id > /dev/null 2>&1" >> \${VARDIR}/undo_${provider}_routing) if $number >= DEFAULT_TABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1575,7 +1554,7 @@ sub finish_providers() {
|
|||||||
emit ( " run_ip route replace default scope global table $table \$DEFAULT_ROUTE" );
|
emit ( " run_ip route replace default scope global table $table \$DEFAULT_ROUTE" );
|
||||||
} else {
|
} else {
|
||||||
emit ( " if echo \$DEFAULT_ROUTE | grep -q 'nexthop.+nexthop'; then",
|
emit ( " if echo \$DEFAULT_ROUTE | grep -q 'nexthop.+nexthop'; then",
|
||||||
" while qt \$IP -6 route delete default table $table; do true; done",
|
" qt \$IP -6 route delete default scope global table $table \$DEFAULT_ROUTE",
|
||||||
" run_ip route add default scope global table $table \$DEFAULT_ROUTE",
|
" run_ip route add default scope global table $table \$DEFAULT_ROUTE",
|
||||||
' else',
|
' else',
|
||||||
" run_ip route replace default scope global table $table \$DEFAULT_ROUTE",
|
" run_ip route replace default scope global table $table \$DEFAULT_ROUTE",
|
||||||
@@ -1596,7 +1575,7 @@ sub finish_providers() {
|
|||||||
' error_message "WARNING: No Default route added (all \'balance\' providers are down)"' );
|
' error_message "WARNING: No Default route added (all \'balance\' providers are down)"' );
|
||||||
|
|
||||||
if ( $config{RESTORE_DEFAULT_ROUTE} ) {
|
if ( $config{RESTORE_DEFAULT_ROUTE} ) {
|
||||||
emit qq( [ -z "\${FALLBACK_ROUTE}\${g_fallback}" ] && restore_default_route $config{USE_DEFAULT_RT} && error_message "NOTICE: Default route restored")
|
emit qq( restore_default_route $config{USE_DEFAULT_RT} && error_message "NOTICE: Default route restored")
|
||||||
} else {
|
} else {
|
||||||
emit qq( qt \$IP -$family route del default table $table && error_message "WARNING: Default route deleted from table $table");
|
emit qq( qt \$IP -$family route del default table $table && error_message "WARNING: Default route deleted from table $table");
|
||||||
}
|
}
|
||||||
@@ -1623,7 +1602,7 @@ sub finish_providers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
emit ( '#',
|
emit ( '#',
|
||||||
'# Delete any default routes with metric 0 in the \'balance\' table',
|
'# Delete any routes in the \'balance\' table',
|
||||||
'#',
|
'#',
|
||||||
"while qt \$IP -$family route del default table $balance; do",
|
"while qt \$IP -$family route del default table $balance; do",
|
||||||
' true',
|
' true',
|
||||||
@@ -1638,7 +1617,7 @@ sub finish_providers() {
|
|||||||
if ( $family == F_IPV4 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
emit( " run_ip route replace default scope global table $default \$FALLBACK_ROUTE" );
|
emit( " run_ip route replace default scope global table $default \$FALLBACK_ROUTE" );
|
||||||
} else {
|
} else {
|
||||||
emit( " while qt \$IP -6 route delete default table $default; do true; done" );
|
emit( " run_ip route delete default scope global table $default \$FALLBACK_ROUTE" );
|
||||||
emit( " run_ip route add default scope global table $default \$FALLBACK_ROUTE" );
|
emit( " run_ip route add default scope global table $default \$FALLBACK_ROUTE" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1651,10 +1630,7 @@ sub finish_providers() {
|
|||||||
'fi',
|
'fi',
|
||||||
'' );
|
'' );
|
||||||
} elsif ( $config{USE_DEFAULT_RT} ) {
|
} elsif ( $config{USE_DEFAULT_RT} ) {
|
||||||
emit( '#',
|
emit( "delete_default_routes $default",
|
||||||
'# No balanced fallback routes - delete any routes with metric 0 from the \'default\' table',
|
|
||||||
'#',
|
|
||||||
"delete_default_routes $default",
|
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1699,7 +1675,7 @@ sub process_providers( $ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $providers ) {
|
if ( $providers ) {
|
||||||
fatal_error q(Either all 'fallback' providers must specify a weight or none of them can specify a weight) if $fallback && $metrics;
|
fatal_error q(Either all 'fallback' providers must specify a weight or non of them can specify a weight) if $fallback && $metrics;
|
||||||
|
|
||||||
my $fn = open_file( 'route_rules' );
|
my $fn = open_file( 'route_rules' );
|
||||||
|
|
||||||
@@ -1938,6 +1914,7 @@ sub setup_providers() {
|
|||||||
|
|
||||||
emit "fi\n";
|
emit "fi\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@@ -96,7 +96,7 @@ use constant { NULL_SECTION => 0x00,
|
|||||||
INVALID_SECTION => 0x10,
|
INVALID_SECTION => 0x10,
|
||||||
UNTRACKED_SECTION => 0x20,
|
UNTRACKED_SECTION => 0x20,
|
||||||
NEW_SECTION => 0x40,
|
NEW_SECTION => 0x40,
|
||||||
POLICYACTION_SECTION => 0x80 };
|
DEFAULTACTION_SECTION => 0x80 };
|
||||||
#
|
#
|
||||||
# Number of elements in the action tuple
|
# Number of elements in the action tuple
|
||||||
#
|
#
|
||||||
@@ -216,10 +216,6 @@ our %statetable;
|
|||||||
# Tracks which of the state match actions (action.Invalid, etc.) that is currently being expanded
|
# Tracks which of the state match actions (action.Invalid, etc.) that is currently being expanded
|
||||||
#
|
#
|
||||||
our $statematch;
|
our $statematch;
|
||||||
#
|
|
||||||
# Remembers NAT-oriented columns from top-level action invocations
|
|
||||||
#
|
|
||||||
our %nat_columns;
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Action/Inline options
|
# Action/Inline options
|
||||||
@@ -388,8 +384,6 @@ sub initialize( $ ) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
%nat_columns = ( dest => '-', proto => '-', ports => '-' );
|
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
# Initialize variables moved from the Tc module in Shorewall 5.0.7 #
|
# Initialize variables moved from the Tc module in Shorewall 5.0.7 #
|
||||||
############################################################################
|
############################################################################
|
||||||
@@ -397,7 +391,7 @@ sub initialize( $ ) {
|
|||||||
%tcdevices = ();
|
%tcdevices = ();
|
||||||
%tcclasses = ();
|
%tcclasses = ();
|
||||||
$sticky = 0;
|
$sticky = 0;
|
||||||
$divertref = 0;
|
$divertref = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -927,28 +921,6 @@ sub process_policies()
|
|||||||
#
|
#
|
||||||
sub process_inline ($$$$$$$$$$$$$$$$$$$$$$);
|
sub process_inline ($$$$$$$$$$$$$$$$$$$$$$);
|
||||||
|
|
||||||
#
|
|
||||||
# Determine the protocol to be used in the jump to the passed action
|
|
||||||
#
|
|
||||||
sub determine_action_protocol( $$ ) {
|
|
||||||
my ( $action, $proto ) = @_;
|
|
||||||
|
|
||||||
if ( my $actionproto = $actions{$action}{proto} ) {
|
|
||||||
if ( $proto eq '-' ) {
|
|
||||||
$proto = $actionproto;
|
|
||||||
} else {
|
|
||||||
if ( defined( my $protonum = resolve_proto( $proto ) ) ) {
|
|
||||||
fatal_error( "The $action action is only usable with " . proto_name( $actionproto ) ) unless $actionproto == $protonum;
|
|
||||||
$proto = $protonum;
|
|
||||||
} else {
|
|
||||||
fatal_error( "Unknown protocol ($proto)" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$proto;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub add_policy_rules( $$$$$ ) {
|
sub add_policy_rules( $$$$$ ) {
|
||||||
my ( $chainref , $target, $loglevel, $pactions, $dropmulticast ) = @_;
|
my ( $chainref , $target, $loglevel, $pactions, $dropmulticast ) = @_;
|
||||||
|
|
||||||
@@ -964,16 +936,12 @@ sub add_policy_rules( $$$$$ ) {
|
|||||||
|
|
||||||
if ( ( $targets{$action} || 0 ) & ACTION ) {
|
if ( ( $targets{$action} || 0 ) & ACTION ) {
|
||||||
#
|
#
|
||||||
# Policy action is a regular action -- jump to the action chain
|
# Default action is a regular action -- jump to the action chain
|
||||||
#
|
#
|
||||||
if ( ( my $proto = determine_action_protocol( $action, '-' ) ) ne '-' ) {
|
add_ijump $chainref, j => use_policy_action( $paction, $chainref->{name} );
|
||||||
add_ijump( $chainref, j => use_policy_action( $paction, $chainref->{name} ), p => $proto );
|
|
||||||
} else {
|
|
||||||
add_ijump $chainref, j => use_policy_action( $paction, $chainref->{name} );
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
#
|
#
|
||||||
# Policy action is an inline
|
# Default action is an inline
|
||||||
#
|
#
|
||||||
( undef, my $level ) = split /:/, $paction, 2;
|
( undef, my $level ) = split /:/, $paction, 2;
|
||||||
( $action, my $param ) = get_target_param( $action );
|
( $action, my $param ) = get_target_param( $action );
|
||||||
@@ -1288,7 +1256,7 @@ sub finish_chain_section ($$$) {
|
|||||||
if ( $chain1ref->{is_policy} ) {
|
if ( $chain1ref->{is_policy} ) {
|
||||||
if ( $chain1ref->{synparams} ) {
|
if ( $chain1ref->{synparams} ) {
|
||||||
my $synchainref = ensure_chain 'filter', syn_flood_chain $chain1ref;
|
my $synchainref = ensure_chain 'filter', syn_flood_chain $chain1ref;
|
||||||
if ( $section == POLICYACTION_SECTION ) {
|
if ( $section == DEFAULTACTION_SECTION ) {
|
||||||
if ( $chain1ref->{policy} =~ /^(ACCEPT|CONTINUE|QUEUE|NFQUEUE)/ ) {
|
if ( $chain1ref->{policy} =~ /^(ACCEPT|CONTINUE|QUEUE|NFQUEUE)/ ) {
|
||||||
add_ijump $chain1ref, j => $synchainref, p => 'tcp --syn';
|
add_ijump $chain1ref, j => $synchainref, p => 'tcp --syn';
|
||||||
}
|
}
|
||||||
@@ -1324,7 +1292,7 @@ sub ensure_rules_chain( $ )
|
|||||||
$chainref = new_rules_chain( $chain ) unless $chainref;
|
$chainref = new_rules_chain( $chain ) unless $chainref;
|
||||||
|
|
||||||
unless ( $chainref->{referenced} ) {
|
unless ( $chainref->{referenced} ) {
|
||||||
if ( $section & ( NEW_SECTION | POLICYACTION_SECTION ) ) {
|
if ( $section & ( NEW_SECTION | DEFAULTACTION_SECTION ) ) {
|
||||||
finish_chain_section $chainref , $chainref, 'ESTABLISHED,RELATED,INVALID,UNTRACKED';
|
finish_chain_section $chainref , $chainref, 'ESTABLISHED,RELATED,INVALID,UNTRACKED';
|
||||||
} elsif ( $section == UNTRACKED_SECTION ) {
|
} elsif ( $section == UNTRACKED_SECTION ) {
|
||||||
finish_chain_section $chainref , $chainref, 'ESTABLISHED,RELATED,INVALID';
|
finish_chain_section $chainref , $chainref, 'ESTABLISHED,RELATED,INVALID';
|
||||||
@@ -1443,13 +1411,13 @@ sub external_name( $ ) {
|
|||||||
#
|
#
|
||||||
# Define an Action
|
# Define an Action
|
||||||
#
|
#
|
||||||
sub new_action( $$$$$$ ) {
|
sub new_action( $$$$$ ) {
|
||||||
|
|
||||||
my ( $action , $type, $options , $actionfile , $state, $proto ) = @_;
|
my ( $action , $type, $options , $actionfile , $state ) = @_;
|
||||||
|
|
||||||
fatal_error "Invalid action name($action)" if reserved_name( $action );
|
fatal_error "Invalid action name($action)" if reserved_name( $action );
|
||||||
|
|
||||||
$actions{$action} = { file => $actionfile, actchain => '' , type => $type, options => $options , state => $state, proto => $proto };
|
$actions{$action} = { file => $actionfile, actchain => '' , type => $type, options => $options , state => $state };
|
||||||
|
|
||||||
$targets{$action} = $type;
|
$targets{$action} = $type;
|
||||||
}
|
}
|
||||||
@@ -1667,7 +1635,7 @@ sub merge_inline_source_dest( $$ ) {
|
|||||||
return join( ':', $invocation, $body );
|
return join( ':', $invocation, $body );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fatal_error 'Interface names cannot appear in the DEST column within an action body' if $body =~ /:\[|:\+/;
|
fatal_error 'Interface names cannot appear in the DEST column within an action body' if $body =~ /:\[|:\+|/;
|
||||||
|
|
||||||
if ( $invocation =~ /:\[|:\+/ ) {
|
if ( $invocation =~ /:\[|:\+/ ) {
|
||||||
$invocation =~ s/:.*//;
|
$invocation =~ s/:.*//;
|
||||||
@@ -1684,19 +1652,6 @@ sub merge_inline_source_dest( $$ ) {
|
|||||||
$body || '';
|
$body || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# This one is used by perl_action_helper()
|
|
||||||
#
|
|
||||||
sub merge_action_column( $$ ) {
|
|
||||||
my ( $body, $invocation ) = @_;
|
|
||||||
|
|
||||||
if ( supplied( $body ) && $body ne '-' ) {
|
|
||||||
$body;
|
|
||||||
} else {
|
|
||||||
$invocation;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub merge_macro_column( $$ ) {
|
sub merge_macro_column( $$ ) {
|
||||||
my ( $body, $invocation ) = @_;
|
my ( $body, $invocation ) = @_;
|
||||||
|
|
||||||
@@ -1777,14 +1732,6 @@ sub process_action(\$\$$) {
|
|||||||
fatal_error "Action $action may not be used in the mangle file" if $chainref->{table} eq 'mangle';
|
fatal_error "Action $action may not be used in the mangle file" if $chainref->{table} eq 'mangle';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $type & NAT_TABLE ) {
|
|
||||||
fatal_error "Action $action may only be used in the snat file" unless $chainref->{table} eq 'nat';
|
|
||||||
} else {
|
|
||||||
fatal_error "Action $action may not be used in the snat file" if $chainref->{table} eq 'nat';
|
|
||||||
}
|
|
||||||
|
|
||||||
$param = $1 if $param =~ /^.*\|(.*)$/; #Strip interface name off of the parameters
|
|
||||||
|
|
||||||
my $actionfile = $actionref->{file};
|
my $actionfile = $actionref->{file};
|
||||||
|
|
||||||
progress_message2 "$doing $actionfile for chain $chainref->{name}...";
|
progress_message2 "$doing $actionfile for chain $chainref->{name}...";
|
||||||
@@ -1973,7 +1920,7 @@ sub process_action(\$\$$) {
|
|||||||
|
|
||||||
for my $proto (split_list( $protos, 'Protocol' ) ) {
|
for my $proto (split_list( $protos, 'Protocol' ) ) {
|
||||||
process_snat1( $chainref,
|
process_snat1( $chainref,
|
||||||
$nolog ? $action : merge_levels( join(':', @actparams{'chain','loglevel','logtag'}), $action ),
|
$action,
|
||||||
$source,
|
$source,
|
||||||
$dest,
|
$dest,
|
||||||
$proto,
|
$proto,
|
||||||
@@ -2075,10 +2022,9 @@ sub process_actions() {
|
|||||||
my $opts = $type == INLINE ? NOLOG_OPT : 0;
|
my $opts = $type == INLINE ? NOLOG_OPT : 0;
|
||||||
|
|
||||||
my $state = '';
|
my $state = '';
|
||||||
my $proto = 0;
|
|
||||||
|
|
||||||
if ( $action =~ /:/ ) {
|
if ( $action =~ /:/ ) {
|
||||||
warning_message 'Policy Actions are now specified in /etc/shorewall/shorewall.conf';
|
warning_message 'Default Actions are now specified in /etc/shorewall/shorewall.conf';
|
||||||
$action =~ s/:.*$//;
|
$action =~ s/:.*$//;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2092,9 +2038,6 @@ sub process_actions() {
|
|||||||
} else {
|
} else {
|
||||||
fatal_error( q(The 'state' option is reserved for use in the actions.std file) );
|
fatal_error( q(The 'state' option is reserved for use in the actions.std file) );
|
||||||
}
|
}
|
||||||
} elsif ( /^proto=(.+)$/ ) {
|
|
||||||
fatal_error "Unknown Protocol ($1)" unless defined( $proto = resolve_proto( $1 ) );
|
|
||||||
fatal_error "A protocol may not be specified on the REJECT_ACTION ($action)" if $action eq $config{REJECT_ACTION};
|
|
||||||
} else {
|
} else {
|
||||||
fatal_error "Invalid option ($_)" unless $options{$_};
|
fatal_error "Invalid option ($_)" unless $options{$_};
|
||||||
$opts |= $options{$_};
|
$opts |= $options{$_};
|
||||||
@@ -2104,10 +2047,10 @@ sub process_actions() {
|
|||||||
unless ( $type & INLINE ) {
|
unless ( $type & INLINE ) {
|
||||||
$type = INLINE if $opts & INLINE_OPT;
|
$type = INLINE if $opts & INLINE_OPT;
|
||||||
}
|
}
|
||||||
|
|
||||||
fatal_error "Conflicting OPTIONS ($options)" if ( $opts & NOINLINE_OPT && $type == INLINE ) || ( $opts & INLINE_OPT && $opts & BUILTIN_OPT );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fatal_error "Conflicting OPTIONS ($options)" if ( $opts & NOINLINE_OPT && $type == INLINE ) || ( $opts & INLINE_OPT && $opts & BUILTIN_OPT );
|
||||||
|
|
||||||
if ( my $actiontype = $targets{$action} ) {
|
if ( my $actiontype = $targets{$action} ) {
|
||||||
if ( ( $actiontype & ACTION ) && ( $type == INLINE ) ) {
|
if ( ( $actiontype & ACTION ) && ( $type == INLINE ) ) {
|
||||||
if ( $actions{$action}{options} & NOINLINE_OPT ) {
|
if ( $actions{$action}{options} & NOINLINE_OPT ) {
|
||||||
@@ -2115,11 +2058,6 @@ sub process_actions() {
|
|||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
$proto = $actions{$action}{proto} unless $proto;
|
|
||||||
delete $actions{$action};
|
|
||||||
delete $targets{$action};
|
|
||||||
} elsif ( ( $actiontype & INLINE ) && ( $type == ACTION ) && $opts & NOINLINE_OPT ) {
|
|
||||||
$proto = $actions{$action}{proto} unless $proto;
|
|
||||||
delete $actions{$action};
|
delete $actions{$action};
|
||||||
delete $targets{$action};
|
delete $targets{$action};
|
||||||
} else {
|
} else {
|
||||||
@@ -2129,8 +2067,6 @@ sub process_actions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $opts & BUILTIN_OPT ) {
|
if ( $opts & BUILTIN_OPT ) {
|
||||||
warning_message( "The 'proto' option has no effect when specified on a builtin action" ) if $proto;
|
|
||||||
|
|
||||||
my $actiontype = USERBUILTIN | OPTIONS;
|
my $actiontype = USERBUILTIN | OPTIONS;
|
||||||
$actiontype |= MANGLE_TABLE if $opts & MANGLE_OPT;
|
$actiontype |= MANGLE_TABLE if $opts & MANGLE_OPT;
|
||||||
$actiontype |= RAW_TABLE if $opts & RAW_OPT;
|
$actiontype |= RAW_TABLE if $opts & RAW_OPT;
|
||||||
@@ -2163,7 +2099,7 @@ sub process_actions() {
|
|||||||
|
|
||||||
fatal_error "Missing Action File ($actionfile)" unless -f $actionfile;
|
fatal_error "Missing Action File ($actionfile)" unless -f $actionfile;
|
||||||
|
|
||||||
new_action ( $action, $type, $opts, $actionfile , $state , $proto );
|
new_action ( $action, $type, $opts, $actionfile , $state );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2201,7 +2137,7 @@ sub process_reject_action() {
|
|||||||
#
|
#
|
||||||
# This gets called very early in the compilation process so we fake the section
|
# This gets called very early in the compilation process so we fake the section
|
||||||
#
|
#
|
||||||
$section = POLICYACTION_SECTION;
|
$section = DEFAULTACTION_SECTION;
|
||||||
|
|
||||||
if ( ( $targets{$action} || 0 ) == ACTION ) {
|
if ( ( $targets{$action} || 0 ) == ACTION ) {
|
||||||
add_ijump $rejectref, j => use_policy_action( $action, $rejectref->{name} );
|
add_ijump $rejectref, j => use_policy_action( $action, $rejectref->{name} );
|
||||||
@@ -2535,7 +2471,7 @@ sub verify_audit($;$$) {
|
|||||||
# the target is a macro, the macro is expanded and this function is called recursively for each rule in the expansion.
|
# the target is a macro, the macro is expanded and this function is called recursively for each rule in the expansion.
|
||||||
# Similarly, if a new action tuple is encountered, this function is called recursively for each rule in the action
|
# Similarly, if a new action tuple is encountered, this function is called recursively for each rule in the action
|
||||||
# body. In this latter case, a reference to the tuple's chain is passed in the first ($chainref) argument. A chain
|
# body. In this latter case, a reference to the tuple's chain is passed in the first ($chainref) argument. A chain
|
||||||
# reference is also passed when rules are being generated during processing of a macro used as a policy action.
|
# reference is also passed when rules are being generated during processing of a macro used as a default action.
|
||||||
#
|
#
|
||||||
|
|
||||||
sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
||||||
@@ -2574,8 +2510,6 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
my $exceptionrule = '';
|
my $exceptionrule = '';
|
||||||
my $usergenerated;
|
my $usergenerated;
|
||||||
my $prerule = '';
|
my $prerule = '';
|
||||||
my %save_nat_columns = %nat_columns;
|
|
||||||
my $generated = 0;
|
|
||||||
#
|
#
|
||||||
# Subroutine for handling MARK and CONNMARK.
|
# Subroutine for handling MARK and CONNMARK.
|
||||||
#
|
#
|
||||||
@@ -2657,30 +2591,32 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
|
|
||||||
$current_param = $param unless $param eq '' || $param eq 'PARAM';
|
$current_param = $param unless $param eq '' || $param eq 'PARAM';
|
||||||
|
|
||||||
$generated = process_macro( $basictarget,
|
my $generated = process_macro( $basictarget,
|
||||||
$chainref,
|
$chainref,
|
||||||
$rule . $raw_matches,
|
$rule . $raw_matches,
|
||||||
$matches1,
|
$matches1,
|
||||||
$target,
|
$target,
|
||||||
$current_param,
|
$current_param,
|
||||||
$source,
|
$source,
|
||||||
$dest,
|
$dest,
|
||||||
$proto,
|
$proto,
|
||||||
$ports,
|
$ports,
|
||||||
$sports,
|
$sports,
|
||||||
$origdest,
|
$origdest,
|
||||||
$ratelimit,
|
$ratelimit,
|
||||||
$user,
|
$user,
|
||||||
$mark,
|
$mark,
|
||||||
$connlimit,
|
$connlimit,
|
||||||
$time,
|
$time,
|
||||||
$headers,
|
$headers,
|
||||||
$condition,
|
$condition,
|
||||||
$helper,
|
$helper,
|
||||||
$wildcard );
|
$wildcard );
|
||||||
|
|
||||||
$macro_nest_level--;
|
$macro_nest_level--;
|
||||||
goto EXIT;
|
|
||||||
|
return $generated;
|
||||||
|
|
||||||
} elsif ( $actiontype & NFQ ) {
|
} elsif ( $actiontype & NFQ ) {
|
||||||
$action = handle_nfqueue( $param,
|
$action = handle_nfqueue( $param,
|
||||||
1 # Allow 'bypass'
|
1 # Allow 'bypass'
|
||||||
@@ -2752,7 +2688,6 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
|
|
||||||
REDIRECT => sub () {
|
REDIRECT => sub () {
|
||||||
my $z = $actiontype & NATONLY ? '' : firewall_zone;
|
my $z = $actiontype & NATONLY ? '' : firewall_zone;
|
||||||
|
|
||||||
if ( $dest eq '-' ) {
|
if ( $dest eq '-' ) {
|
||||||
if ( $family == F_IPV4 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
$dest = ( $inchain ) ? '' : join( '', $z, '::' , $ports =~ /[:,]/ ? '' : $ports );
|
$dest = ( $inchain ) ? '' : join( '', $z, '::' , $ports =~ /[:,]/ ? '' : $ports );
|
||||||
@@ -2881,7 +2816,6 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Isolate and validate source and destination zones
|
# Isolate and validate source and destination zones
|
||||||
#
|
#
|
||||||
@@ -2975,7 +2909,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
#
|
#
|
||||||
if ( $destref->{type} & BPORT ) {
|
if ( $destref->{type} & BPORT ) {
|
||||||
unless ( $sourceref->{bridge} eq $destref->{bridge} || single_interface( $sourcezone ) eq $destref->{bridge} ) {
|
unless ( $sourceref->{bridge} eq $destref->{bridge} || single_interface( $sourcezone ) eq $destref->{bridge} ) {
|
||||||
goto EXIT if $wildcard;
|
return 0 if $wildcard;
|
||||||
fatal_error "Rules with a DESTINATION Bridge Port zone must have a SOURCE zone on the same bridge";
|
fatal_error "Rules with a DESTINATION Bridge Port zone must have a SOURCE zone on the same bridge";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2990,7 +2924,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
my $policy = $chainref->{policy};
|
my $policy = $chainref->{policy};
|
||||||
|
|
||||||
if ( $policy eq 'NONE' ) {
|
if ( $policy eq 'NONE' ) {
|
||||||
goto EXIT if $wildcard;
|
return 0 if $wildcard;
|
||||||
fatal_error "Rules may not override a NONE policy";
|
fatal_error "Rules may not override a NONE policy";
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
@@ -2999,9 +2933,9 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
if ( $optimize == 1 && $section == NEW_SECTION ) {
|
if ( $optimize == 1 && $section == NEW_SECTION ) {
|
||||||
my $loglevel = $filter_table->{$chainref->{policychain}}{loglevel};
|
my $loglevel = $filter_table->{$chainref->{policychain}}{loglevel};
|
||||||
if ( $loglevel ne '' ) {
|
if ( $loglevel ne '' ) {
|
||||||
goto EXIT if $target eq "${policy}:${loglevel}";
|
return 0 if $target eq "${policy}:${loglevel}";
|
||||||
} else {
|
} else {
|
||||||
goto EXIT if $basictarget eq $policy;
|
return 0 if $basictarget eq $policy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
@@ -3046,25 +2980,6 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
my $actionchain; # Name of the action chain
|
my $actionchain; # Name of the action chain
|
||||||
|
|
||||||
if ( $actiontype & ACTION ) {
|
if ( $actiontype & ACTION ) {
|
||||||
#
|
|
||||||
# Verify action 'proto', if any
|
|
||||||
#
|
|
||||||
$proto = determine_action_protocol( $basictarget, $proto );
|
|
||||||
#
|
|
||||||
# Save NAT-oriented column contents
|
|
||||||
#
|
|
||||||
@nat_columns{'dest', 'proto', 'ports' } = ( $dest,
|
|
||||||
$proto eq '-' ? $nat_columns{proto} : $proto,
|
|
||||||
$ports eq '-' ? $nat_columns{ports} : $ports );
|
|
||||||
#
|
|
||||||
# Push the current column array onto the column stack
|
|
||||||
#
|
|
||||||
my @savecolumns = @columns;
|
|
||||||
#
|
|
||||||
# And store the (modified) columns into the columns array for use by perl_action[_tcp]_helper. We
|
|
||||||
# only need the NAT-oriented columns
|
|
||||||
#
|
|
||||||
@columns = ( undef , undef, $dest, $proto, $ports);
|
|
||||||
#
|
#
|
||||||
# Handle 'section' option
|
# Handle 'section' option
|
||||||
#
|
#
|
||||||
@@ -3108,8 +3023,6 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$action = $basictarget; # Remove params, if any, from $action.
|
$action = $basictarget; # Remove params, if any, from $action.
|
||||||
|
|
||||||
@columns = @savecolumns;
|
|
||||||
} elsif ( $actiontype & INLINE ) {
|
} elsif ( $actiontype & INLINE ) {
|
||||||
#
|
#
|
||||||
# process_inline() will call process_rule() recursively for each rule in the action body
|
# process_inline() will call process_rule() recursively for each rule in the action body
|
||||||
@@ -3126,34 +3039,34 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
|
|
||||||
$actionresult = 0;
|
$actionresult = 0;
|
||||||
|
|
||||||
$generated = process_inline( $basictarget,
|
my $generated = process_inline( $basictarget,
|
||||||
$chainref,
|
$chainref,
|
||||||
$prerule . $rule,
|
$prerule . $rule,
|
||||||
$matches1 . $raw_matches,
|
$matches1 . $raw_matches,
|
||||||
$loglevel,
|
$loglevel,
|
||||||
$target,
|
$target,
|
||||||
$param,
|
$param,
|
||||||
$source,
|
$source,
|
||||||
$dest,
|
$dest,
|
||||||
$proto,
|
$proto,
|
||||||
$ports,
|
$ports,
|
||||||
$sports,
|
$sports,
|
||||||
$origdest,
|
$origdest,
|
||||||
$ratelimit,
|
$ratelimit,
|
||||||
$user,
|
$user,
|
||||||
$mark,
|
$mark,
|
||||||
$connlimit,
|
$connlimit,
|
||||||
$time,
|
$time,
|
||||||
$headers,
|
$headers,
|
||||||
$condition,
|
$condition,
|
||||||
$helper,
|
$helper,
|
||||||
$wildcard ) || $actionresult;
|
$wildcard ) || $actionresult;
|
||||||
|
|
||||||
( $actionresult, @columns ) = @$savecolumns;;
|
( $actionresult, @columns ) = @$savecolumns;;
|
||||||
|
|
||||||
$macro_nest_level--;
|
$macro_nest_level--;
|
||||||
|
|
||||||
goto EXIT;
|
return $generated;
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
# Generate Fixed part of the rule
|
# Generate Fixed part of the rule
|
||||||
@@ -3200,7 +3113,7 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
unless ( $section & ( NEW_SECTION | POLICYACTION_SECTION ) ||
|
unless ( $section & ( NEW_SECTION | DEFAULTACTION_SECTION ) ||
|
||||||
$inaction ||
|
$inaction ||
|
||||||
$blacklist ||
|
$blacklist ||
|
||||||
$basictarget eq 'dropInvalid' ) {
|
$basictarget eq 'dropInvalid' ) {
|
||||||
@@ -3336,17 +3249,10 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
$log_action ,
|
$log_action ,
|
||||||
$exceptionrule ,
|
$exceptionrule ,
|
||||||
$usergenerated && ! $loglevel )
|
$usergenerated && ! $loglevel )
|
||||||
unless unreachable_warning( $wildcard || $section == POLICYACTION_SECTION, $chainref );
|
unless unreachable_warning( $wildcard || $section == DEFAULTACTION_SECTION, $chainref );
|
||||||
}
|
}
|
||||||
|
|
||||||
$generated = 1;
|
return 1;
|
||||||
|
|
||||||
EXIT:
|
|
||||||
{
|
|
||||||
%nat_columns = %save_nat_columns;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $generated;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3414,7 +3320,7 @@ sub check_state( $ ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $section & ( NEW_SECTION | POLICYACTION_SECTION ) ) {
|
if ( $section & ( NEW_SECTION | DEFAULTACTION_SECTION ) ) {
|
||||||
if ( $state eq 'NEW' ) {
|
if ( $state eq 'NEW' ) {
|
||||||
#
|
#
|
||||||
# If an INVALID or UNTRACKED rule would be emitted then we must include the state match
|
# If an INVALID or UNTRACKED rule would be emitted then we must include the state match
|
||||||
@@ -3500,60 +3406,27 @@ sub perl_action_helper($$;$$) {
|
|||||||
'', # CurrentParam
|
'', # CurrentParam
|
||||||
@columns );
|
@columns );
|
||||||
} else {
|
} else {
|
||||||
if ( ( $targets{$target} || 0 ) & NATRULE ) {
|
$result = process_rule( $chainref,
|
||||||
$result = process_rule( $chainref,
|
$matches,
|
||||||
$matches,
|
$matches1,
|
||||||
$matches1,
|
merge_target( $actions{$action}, $target ),
|
||||||
merge_target( $actions{$action}, $target ),
|
'', # Current Param
|
||||||
'', # Current Param
|
'-', # Source
|
||||||
'-', # Source
|
'-', # Dest
|
||||||
merge_action_column( # Dest
|
'-', # Proto
|
||||||
$columns[2],
|
'-', # Port(s)
|
||||||
$nat_columns{dest}
|
'-', # Source Port(s)
|
||||||
),
|
'-', # Original Dest
|
||||||
merge_action_column( #Proto
|
'-', # Rate Limit
|
||||||
$columns[3],
|
'-', # User
|
||||||
$nat_columns{proto}
|
'-', # Mark
|
||||||
),
|
'-', # Connlimit
|
||||||
merge_action_column( #Ports
|
'-', # Time
|
||||||
$columns[4],
|
'-', # Headers,
|
||||||
$nat_columns{ports}),
|
'-', # condition,
|
||||||
'-', # Source Port(s)
|
'-', # helper,
|
||||||
'-', # Original Dest
|
0, # Wildcard
|
||||||
'-', # Rate Limit
|
);
|
||||||
'-', # User
|
|
||||||
'-', # Mark
|
|
||||||
'-', # Connlimit
|
|
||||||
'-', # Time
|
|
||||||
'-', # Headers,
|
|
||||||
'-', # condition,
|
|
||||||
'-', # helper,
|
|
||||||
0, # Wildcard
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$result = process_rule( $chainref,
|
|
||||||
$matches,
|
|
||||||
$matches1,
|
|
||||||
merge_target( $actions{$action}, $target ),
|
|
||||||
'', # Current Param
|
|
||||||
'-', # Source
|
|
||||||
'-', # Dest
|
|
||||||
'-', # Proto
|
|
||||||
'-', # Port(s)
|
|
||||||
'-', # Source Port(s)
|
|
||||||
'-', # Original Dest
|
|
||||||
'-', # Rate Limit
|
|
||||||
'-', # User
|
|
||||||
'-', # Mark
|
|
||||||
'-', # Connlimit
|
|
||||||
'-', # Time
|
|
||||||
'-', # Headers,
|
|
||||||
'-', # condition,
|
|
||||||
'-', # helper,
|
|
||||||
0, # Wildcard
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
allow_optimize( $chainref );
|
allow_optimize( $chainref );
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
@@ -3619,8 +3492,7 @@ sub perl_action_tcp_helper($$) {
|
|||||||
'-', # condition,
|
'-', # condition,
|
||||||
'-', # helper,
|
'-', # helper,
|
||||||
0, # Wildcard
|
0, # Wildcard
|
||||||
);
|
);
|
||||||
|
|
||||||
allow_optimize( $chainref );
|
allow_optimize( $chainref );
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
@@ -3955,7 +3827,7 @@ sub process_rules() {
|
|||||||
#
|
#
|
||||||
# No need to finish the NEW section since no rules need to be generated
|
# No need to finish the NEW section since no rules need to be generated
|
||||||
#
|
#
|
||||||
$section = $next_section = POLICYACTION_SECTION;
|
$section = $next_section = DEFAULTACTION_SECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub process_mangle_inline( $$$$$$$$$$$$$$$$$$$$ ) {
|
sub process_mangle_inline( $$$$$$$$$$$$$$$$$$$$ ) {
|
||||||
@@ -4191,10 +4063,10 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
expand_rule( $chainref,
|
expand_rule( $chainref,
|
||||||
$restriction,
|
$restriction,
|
||||||
$prerule ,
|
$prerule ,
|
||||||
do_proto( $proto, $ports, $sports ) .
|
|
||||||
$match .
|
$match .
|
||||||
do_user( $user ) .
|
do_user( $user ) .
|
||||||
do_test( $testval, $mask ) .
|
do_test( $testval, $globals{TC_MASK} ) .
|
||||||
|
do_test( $testval, $globals{TC_MASK} ) .
|
||||||
do_length( $length ) .
|
do_length( $length ) .
|
||||||
do_tos( $tos ) .
|
do_tos( $tos ) .
|
||||||
do_connbytes( $connbytes ) .
|
do_connbytes( $connbytes ) .
|
||||||
@@ -4202,7 +4074,6 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
do_headers( $headers ) .
|
do_headers( $headers ) .
|
||||||
do_probability( $probability ) .
|
do_probability( $probability ) .
|
||||||
do_dscp( $dscp ) .
|
do_dscp( $dscp ) .
|
||||||
do_time( $time ) .
|
|
||||||
do_condition( $condition, $chainref->{name} ) .
|
do_condition( $condition, $chainref->{name} ) .
|
||||||
state_match( $state ) .
|
state_match( $state ) .
|
||||||
$raw_matches ,
|
$raw_matches ,
|
||||||
@@ -4638,52 +4509,6 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
TCPMSS => {
|
|
||||||
defaultchain => FORWARD,
|
|
||||||
allowedchains => FORWARD | POSTROUTING,
|
|
||||||
minparams => 0,
|
|
||||||
maxparams => 2,
|
|
||||||
function => sub () {
|
|
||||||
if ( $proto eq '-' ) {
|
|
||||||
$proto = TCP;
|
|
||||||
} else {
|
|
||||||
fatal_error 'TCPMSS only valid with TCP' unless $proto eq '6' || $proto eq 'tcp';
|
|
||||||
}
|
|
||||||
|
|
||||||
$target = 'TCPMSS ';
|
|
||||||
$matches .= '--tcp-flags SYN,RST SYN ';
|
|
||||||
|
|
||||||
if ( supplied $params ) {
|
|
||||||
my ( $mss, $ipsec ) = split /,/, $params;
|
|
||||||
|
|
||||||
if ( supplied $mss ) {
|
|
||||||
if ( $mss eq 'pmtu' ) {
|
|
||||||
$target .= '--clamp-mss-to-pmtu';
|
|
||||||
} else {
|
|
||||||
my $num = numeric_value $mss;
|
|
||||||
fatal_error "Invalid MSS ($mss)" unless defined $num && $num >= 500 && $num < 65534;
|
|
||||||
$target .= "--set-mss $num";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$target .= '--clamp-mss-to-pmtu';
|
|
||||||
}
|
|
||||||
if ( supplied $ipsec && $ipsec ne 'all' ) {
|
|
||||||
if ( $ipsec eq '-' || $ipsec eq 'none' ) {
|
|
||||||
$matches .= '-m policy --pol none --dir out ';
|
|
||||||
} elsif ( $ipsec eq 'ipsec' ) {
|
|
||||||
$matches .= '-m policy --pol ipsec --dir out ';
|
|
||||||
} else {
|
|
||||||
fatal_error "Invalid ipsec parameter ($ipsec)";
|
|
||||||
}
|
|
||||||
|
|
||||||
require_capability 'POLICY_MATCH', "The $ipsec ipsec option", 's';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$target .= '--clamp-mss-to-pmtu';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
TOS => {
|
TOS => {
|
||||||
defaultchain => 0,
|
defaultchain => 0,
|
||||||
allowedchains => PREROUTING | FORWARD | OUTPUT | POSTROUTING,
|
allowedchains => PREROUTING | FORWARD | OUTPUT | POSTROUTING,
|
||||||
@@ -4707,7 +4532,8 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
my ( $port, $ip, $bad );
|
my ( $port, $ip, $bad );
|
||||||
|
|
||||||
if ( $params ) {
|
if ( $params ) {
|
||||||
( $port, $ip ) = split /,/, $params, 2;
|
( $port, $ip, $bad ) = split_list $params, 'Parameter';
|
||||||
|
fatal_error "Invalid TPROXY specification( TPROXY($params) )" if defined $bad;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $mark = in_hex( $globals{TPROXY_MARK} ) . '/' . in_hex( $globals{TPROXY_MARK} );
|
my $mark = in_hex( $globals{TPROXY_MARK} ) . '/' . in_hex( $globals{TPROXY_MARK} );
|
||||||
@@ -4774,10 +4600,6 @@ sub process_mangle_rule1( $$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
function => sub() {
|
function => sub() {
|
||||||
fatal_error( qq(Action $cmd may not be used in the mangle file) ) unless $actiontype & MANGLE_TABLE;
|
fatal_error( qq(Action $cmd may not be used in the mangle file) ) unless $actiontype & MANGLE_TABLE;
|
||||||
#
|
#
|
||||||
# Verify action 'proto', if any
|
|
||||||
#
|
|
||||||
$proto = determine_action_protocol( $cmd, $proto );
|
|
||||||
#
|
|
||||||
# Create the action:level:tag:param tuple.
|
# Create the action:level:tag:param tuple.
|
||||||
#
|
#
|
||||||
my $normalized_target = normalize_action( $cmd, '', $params );
|
my $normalized_target = normalize_action( $cmd, '', $params );
|
||||||
@@ -5303,23 +5125,18 @@ sub process_mangle_rule( $ ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub process_snat_inline( $$$$$$$$$$$$$$ ) {
|
sub process_snat_inline( $$$$$$$$$$$$$ ) {
|
||||||
my ($inline, $chainref, $params, $loglevel, $source, $dest, $protos, $ports, $ipsec, $mark, $user, $condition, $origdest, $probability ) = @_;
|
my ($inline, $chainref, $params, $source, $dest, $protos, $ports, $ipsec, $mark, $user, $condition, $origdest, $probability ) = @_;
|
||||||
|
|
||||||
my ( $level,
|
|
||||||
$tag ) = split( ':', $loglevel, 2 );
|
|
||||||
my $oldparms = push_action_params( $inline,
|
my $oldparms = push_action_params( $inline,
|
||||||
$chainref,
|
$chainref,
|
||||||
$params,
|
$params,
|
||||||
supplied $level ? $level : 'none',
|
'none',
|
||||||
defined $tag ? $tag : '' ,
|
'' ,
|
||||||
$chainref->{name} );
|
$chainref->{name} );
|
||||||
|
|
||||||
my $actionref = $actions{$inline};
|
my $inlinefile = $actions{$inline}{file};
|
||||||
my $inlinefile = $actionref->{file};
|
my $matches = fetch_inline_matches;
|
||||||
my $options = $actionref->{options};
|
|
||||||
my $nolog = $options & NOLOG_OPT;
|
|
||||||
my $matches = fetch_inline_matches;
|
|
||||||
|
|
||||||
progress_message "..Expanding inline action $inlinefile...";
|
progress_message "..Expanding inline action $inlinefile...";
|
||||||
|
|
||||||
@@ -5353,8 +5170,6 @@ sub process_snat_inline( $$$$$$$$$$$$$$ ) {
|
|||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
$maction = merge_levels( join(':', @actparams{'chain','loglevel','logtag'}), $maction ) unless $nolog;
|
|
||||||
|
|
||||||
$msource = $source if $msource eq '-';
|
$msource = $source if $msource eq '-';
|
||||||
|
|
||||||
if ( $mdest eq '-' ) {
|
if ( $mdest eq '-' ) {
|
||||||
@@ -5399,7 +5214,7 @@ sub process_snat_inline( $$$$$$$$$$$$$$ ) {
|
|||||||
# Process a record in the snat file
|
# Process a record in the snat file
|
||||||
#
|
#
|
||||||
sub process_snat1( $$$$$$$$$$$$ ) {
|
sub process_snat1( $$$$$$$$$$$$ ) {
|
||||||
my ( $chainref, $origaction, $source, $dest, $proto, $ports, $ipsec, $mark, $user, $condition, $origdest, $probability ) = @_;
|
my ( $chainref, $action, $source, $dest, $proto, $ports, $ipsec, $mark, $user, $condition, $origdest, $probability ) = @_;
|
||||||
|
|
||||||
my $inchain;
|
my $inchain;
|
||||||
my $inaction;
|
my $inaction;
|
||||||
@@ -5416,9 +5231,6 @@ sub process_snat1( $$$$$$$$$$$$ ) {
|
|||||||
my $actiontype;
|
my $actiontype;
|
||||||
my $interfaces;
|
my $interfaces;
|
||||||
my $normalized_action;
|
my $normalized_action;
|
||||||
my ( $action, $loglevel ) = split_action( $origaction );
|
|
||||||
my $logaction;
|
|
||||||
my $param;
|
|
||||||
|
|
||||||
if ( $action =~ /^MASQUERADE(\+)?(?:\((.+)\))?$/ ) {
|
if ( $action =~ /^MASQUERADE(\+)?(?:\((.+)\))?$/ ) {
|
||||||
$target = 'MASQUERADE';
|
$target = 'MASQUERADE';
|
||||||
@@ -5427,7 +5239,6 @@ sub process_snat1( $$$$$$$$$$$$ ) {
|
|||||||
$addresses = ( $2 || '' );
|
$addresses = ( $2 || '' );
|
||||||
$options = 'random' if $addresses =~ s/:?random$//;
|
$options = 'random' if $addresses =~ s/:?random$//;
|
||||||
$add_snat_aliases = '';
|
$add_snat_aliases = '';
|
||||||
$logaction = 'MASQ';
|
|
||||||
} elsif ( $action =~ /^SNAT(\+)?\((.+)\)$/ ) {
|
} elsif ( $action =~ /^SNAT(\+)?\((.+)\)$/ ) {
|
||||||
$pre_nat = $1;
|
$pre_nat = $1;
|
||||||
$addresses = $2;
|
$addresses = $2;
|
||||||
@@ -5436,16 +5247,13 @@ sub process_snat1( $$$$$$$$$$$$ ) {
|
|||||||
$options .= ':persistent' if $addresses =~ s/:persistent//;
|
$options .= ':persistent' if $addresses =~ s/:persistent//;
|
||||||
$options .= ':random' if $addresses =~ s/:random//;
|
$options .= ':random' if $addresses =~ s/:random//;
|
||||||
$options =~ s/^://;
|
$options =~ s/^://;
|
||||||
$logaction = 'SNAT';
|
|
||||||
} elsif ( $action =~ /^CONTINUE(\+)?$/ ) {
|
} elsif ( $action =~ /^CONTINUE(\+)?$/ ) {
|
||||||
$add_snat_aliases = 0;
|
$add_snat_aliases = 0;
|
||||||
$actiontype = $builtin_target{$target = 'RETURN'};
|
$actiontype = $builtin_target{$target = 'RETURN'};
|
||||||
$pre_nat = $1;
|
$pre_nat = $1;
|
||||||
$logaction = 'RETURN';
|
|
||||||
} elsif ( $action eq 'MASQUERADE' ) {
|
} elsif ( $action eq 'MASQUERADE' ) {
|
||||||
$actiontype = $builtin_target{$target = 'MASQUERADE'};
|
$actiontype = $builtin_target{$target = 'MASQUERADE'};
|
||||||
$add_snat_aliases = '';
|
$add_snat_aliases = '';
|
||||||
$logaction = 'MASQ';
|
|
||||||
} else {
|
} else {
|
||||||
( $target , $params ) = get_target_param1( $action );
|
( $target , $params ) = get_target_param1( $action );
|
||||||
|
|
||||||
@@ -5453,24 +5261,11 @@ sub process_snat1( $$$$$$$$$$$$ ) {
|
|||||||
|
|
||||||
$actiontype = ( $targets{$target} || 0 );
|
$actiontype = ( $targets{$target} || 0 );
|
||||||
|
|
||||||
if ( $actiontype & LOGRULE ) {
|
fatal_error "Invalid ACTION ($action)" unless $actiontype & ( ACTION | INLINE );
|
||||||
$logaction = 'LOG';
|
|
||||||
if ( $target eq 'LOG' ) {
|
|
||||||
fatal_error 'LOG requires a log level' unless supplied $loglevel;
|
|
||||||
} else {
|
|
||||||
$target = "$target($params)";
|
|
||||||
validate_level( $action );
|
|
||||||
$loglevel = supplied $loglevel ? join( ':', $target, $loglevel ) : $target;
|
|
||||||
$target = 'LOG';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
fatal_error "Invalid ACTION ($action)" unless $actiontype & ( ACTION | INLINE );
|
|
||||||
$logaction = '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $inchain = defined $chainref ) {
|
if ( $inchain = defined $chainref ) {
|
||||||
( $inaction, undef,undef,undef,$param ) = split( /:/, $normalized_action = $chainref->{action}) if $chainref->{action};
|
( $inaction, undef, $interfaces, undef, undef ) = split /:/, $normalized_action = $chainref->{action}, 5 if $chainref->{action};
|
||||||
fatal_error q('+' is not allowed within an action body) if $pre_nat;
|
fatal_error q('+' is not allowed within an action body) if $pre_nat;
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
@@ -5478,8 +5273,6 @@ sub process_snat1( $$$$$$$$$$$$ ) {
|
|||||||
#
|
#
|
||||||
if ( $inaction ) {
|
if ( $inaction ) {
|
||||||
$destnets = $dest;
|
$destnets = $dest;
|
||||||
assert( $param =~ /^(.*)\|/ );
|
|
||||||
$interfaces=$1;
|
|
||||||
} elsif ( $family == F_IPV4 ) {
|
} elsif ( $family == F_IPV4 ) {
|
||||||
if ( $dest =~ /^([^:]+)::([^:]*)$/ ) {
|
if ( $dest =~ /^([^:]+)::([^:]*)$/ ) {
|
||||||
$add_snat_aliases = 0;
|
$add_snat_aliases = 0;
|
||||||
@@ -5493,7 +5286,7 @@ sub process_snat1( $$$$$$$$$$$$ ) {
|
|||||||
$interfaces = $1;
|
$interfaces = $1;
|
||||||
} elsif ( $dest =~ /^([^:]+):([^:]*)$/ ) {
|
} elsif ( $dest =~ /^([^:]+):([^:]*)$/ ) {
|
||||||
my ( $one, $two ) = ( $1, $2 );
|
my ( $one, $two ) = ( $1, $2 );
|
||||||
if ( $2 =~ /\./ || $2 =~ /^[+%!]/ ) {
|
if ( $2 =~ /\./ || $2 =~ /^%/ ) {
|
||||||
$interfaces = $one;
|
$interfaces = $one;
|
||||||
$destnets = $two;
|
$destnets = $two;
|
||||||
} else {
|
} else {
|
||||||
@@ -5721,7 +5514,6 @@ sub process_snat1( $$$$$$$$$$$$ ) {
|
|||||||
process_snat_inline( $target,
|
process_snat_inline( $target,
|
||||||
$chainref,
|
$chainref,
|
||||||
$params,
|
$params,
|
||||||
$loglevel,
|
|
||||||
$source,
|
$source,
|
||||||
supplied $destnets && $destnets ne '-' ? $inaction ? $destnets : join( ':', $interface, $destnets ) : $inaction ? '-' : $interface,
|
supplied $destnets && $destnets ne '-' ? $inaction ? $destnets : join( ':', $interface, $destnets ) : $inaction ? '-' : $interface,
|
||||||
$proto,
|
$proto,
|
||||||
@@ -5736,14 +5528,10 @@ sub process_snat1( $$$$$$$$$$$$ ) {
|
|||||||
if ( $actiontype & ACTION ) {
|
if ( $actiontype & ACTION ) {
|
||||||
fatal_error( qq(Action $target may not be used in the snat file) ) unless $actiontype & NAT_TABLE;
|
fatal_error( qq(Action $target may not be used in the snat file) ) unless $actiontype & NAT_TABLE;
|
||||||
#
|
#
|
||||||
# Verify action 'proto', if any
|
|
||||||
#
|
|
||||||
$proto = determine_action_protocol( $target, $proto );
|
|
||||||
#
|
|
||||||
# Create the action:level:tag:param tuple. Since we don't allow logging out of nat POSTROUTING, we store
|
# Create the action:level:tag:param tuple. Since we don't allow logging out of nat POSTROUTING, we store
|
||||||
# the interface name in the log tag
|
# the interface name in the log tag
|
||||||
#
|
#
|
||||||
my $normalized_target = normalize_action( $target, "$loglevel", "$interface|$params" );
|
my $normalized_target = normalize_action( $target, "none:$interface", $params );
|
||||||
fatal_error( "Action $target invoked Recursively (" . join( '->', map( external_name( $_ ), @actionstack , $normalized_target ) ) . ')' ) if $active{$target};
|
fatal_error( "Action $target invoked Recursively (" . join( '->', map( external_name( $_ ), @actionstack , $normalized_target ) ) . ')' ) if $active{$target};
|
||||||
|
|
||||||
my $ref = use_action( 'nat', $normalized_target );
|
my $ref = use_action( 'nat', $normalized_target );
|
||||||
@@ -5753,6 +5541,9 @@ sub process_snat1( $$$$$$$$$$$$ ) {
|
|||||||
# First reference to this tuple - process_action may modify both $normalized_target and $ref!!!
|
# First reference to this tuple - process_action may modify both $normalized_target and $ref!!!
|
||||||
#
|
#
|
||||||
process_action( $normalized_target, $ref, $chainref->{name} );
|
process_action( $normalized_target, $ref, $chainref->{name} );
|
||||||
|
#
|
||||||
|
# Capture the name of the action chain
|
||||||
|
#
|
||||||
} else {
|
} else {
|
||||||
#
|
#
|
||||||
# We've seen this tuple before
|
# We've seen this tuple before
|
||||||
@@ -5761,12 +5552,6 @@ sub process_snat1( $$$$$$$$$$$$ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$target = $ref->{name};
|
$target = $ref->{name};
|
||||||
|
|
||||||
if ( $actions{$target}{options} & LOGJUMP_OPT ) {
|
|
||||||
$logaction = $target;
|
|
||||||
} else {
|
|
||||||
$loglevel = '';
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
for my $option ( split_list2( $options , 'option' ) ) {
|
for my $option ( split_list2( $options , 'option' ) ) {
|
||||||
if ( $option eq 'random' ) {
|
if ( $option eq 'random' ) {
|
||||||
@@ -5795,8 +5580,8 @@ sub process_snat1( $$$$$$$$$$$$ ) {
|
|||||||
$destnets ,
|
$destnets ,
|
||||||
$origdest ,
|
$origdest ,
|
||||||
$target ,
|
$target ,
|
||||||
$loglevel ,
|
'' ,
|
||||||
$logaction ,
|
'' ,
|
||||||
$exceptionrule ,
|
$exceptionrule ,
|
||||||
'' )
|
'' )
|
||||||
unless unreachable_warning( 0, $chainref );
|
unless unreachable_warning( 0, $chainref );
|
||||||
@@ -5857,23 +5642,15 @@ sub process_snat( )
|
|||||||
sub setup_snat( $ ) # Convert masq->snat if true
|
sub setup_snat( $ ) # Convert masq->snat if true
|
||||||
{
|
{
|
||||||
my $fn;
|
my $fn;
|
||||||
my $have_masq;
|
|
||||||
|
|
||||||
if ( $_[0] ) {
|
convert_masq() if $_[0];
|
||||||
convert_masq();
|
|
||||||
} elsif ( $fn = open_file( 'masq', 1, 1 ) ) {
|
if ( $fn = open_file( 'masq', 1, 1 ) ) {
|
||||||
first_entry( sub { progress_message2 "$doing $fn..."; require_capability 'NAT_ENABLED' , "a non-empty masq file" , 's'; } );
|
first_entry( sub { progress_message2 "$doing $fn..."; require_capability 'NAT_ENABLED' , "a non-empty masq file" , 's'; } );
|
||||||
process_one_masq(0), $have_masq = 1 while read_a_line( NORMAL_READ );
|
process_one_masq(0) while read_a_line( NORMAL_READ );
|
||||||
}
|
} elsif ( $fn = open_file( 'snat', 1, 1 ) ) {
|
||||||
|
first_entry( sub { progress_message2 "$doing $fn..."; require_capability 'NAT_ENABLED' , "a non-empty snat file" , 's'; } );
|
||||||
unless ( $have_masq ) {
|
process_snat while read_a_line( NORMAL_READ );
|
||||||
#
|
|
||||||
# Masq file empty or didn't exist
|
|
||||||
#
|
|
||||||
if ( $fn = open_file( 'snat', 1, 1 ) ) {
|
|
||||||
first_entry( sub { progress_message2 "$doing $fn..."; require_capability 'NAT_ENABLED' , "a non-empty snat file" , 's'; } );
|
|
||||||
process_snat while read_a_line( NORMAL_READ );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -225,11 +225,11 @@ sub handle_in_bandwidth( $$$ ) {
|
|||||||
if ( have_capability 'BASIC_FILTER' ) {
|
if ( have_capability 'BASIC_FILTER' ) {
|
||||||
if ( $in_rate ) {
|
if ( $in_rate ) {
|
||||||
emit( "run_tc filter add dev $physical parent ffff: protocol all prio 10 basic \\",
|
emit( "run_tc filter add dev $physical parent ffff: protocol all prio 10 basic \\",
|
||||||
" police mpu 64 rate ${in_rate}kbit burst $in_burst drop\n" );
|
" police mpu 64 drop rate ${in_rate}kbit burst $in_burst\n" );
|
||||||
} else {
|
} else {
|
||||||
emit( "run_tc filter add dev $physical parent ffff: protocol all prio 10 \\",
|
emit( "run_tc filter add dev $physical parent ffff: protocol all prio 10 \\",
|
||||||
" estimator $in_interval $in_decay basic \\",
|
" estimator $in_interval $in_decay basic \\",
|
||||||
" police avrate ${in_avrate}kbit drop\n" );
|
" police drop avrate ${in_avrate}kbit\n" );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
emit( "run_tc filter add dev $physical parent ffff: protocol all prio 10 \\" ,
|
emit( "run_tc filter add dev $physical parent ffff: protocol all prio 10 \\" ,
|
||||||
@@ -1434,7 +1434,7 @@ sub process_tc_filter2( $$$$$$$$$ ) {
|
|||||||
|
|
||||||
while ( @sportlist ) {
|
while ( @sportlist ) {
|
||||||
my ( $sport, $smask ) = ( shift @sportlist, shift @sportlist );
|
my ( $sport, $smask ) = ( shift @sportlist, shift @sportlist );
|
||||||
$rule .= "\\\n cmp\\( u16 at 0 layer 2 mask 0x$smask eq 0x$sport \\)";
|
$rule .= "\\\n cmp\\( u16 at 0 layer 2 mask $smask eq 0x$sport \\)";
|
||||||
$rule .= ' or' if @sportlist;
|
$rule .= ' or' if @sportlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -90,8 +90,9 @@ our @EXPORT = ( qw( NOTHING
|
|||||||
interface_is_optional
|
interface_is_optional
|
||||||
interface_is_required
|
interface_is_required
|
||||||
find_interfaces_by_option
|
find_interfaces_by_option
|
||||||
|
find_interfaces_by_option1
|
||||||
get_interface_option
|
get_interface_option
|
||||||
get_interface_origin
|
get_interface_origin
|
||||||
interface_has_option
|
interface_has_option
|
||||||
set_interface_option
|
set_interface_option
|
||||||
interface_zone
|
interface_zone
|
||||||
@@ -113,31 +114,31 @@ our $VERSION = 'MODULEVERSION';
|
|||||||
# @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> => {name => <name>,
|
# %zones{<zone1> => {name => <name>,
|
||||||
# type => <zone type> FIREWALL, IP, IPSEC, BPORT;
|
# type => <zone type> FIREWALL, IP, IPSEC, BPORT;
|
||||||
# complex => 0|1
|
# complex => 0|1
|
||||||
# super => 0|1
|
# super => 0|1
|
||||||
# options => { in_out => < policy match string >
|
# options => { in_out => < policy match string >
|
||||||
# in => < policy match string >
|
# in => < policy match string >
|
||||||
# out => < policy match string >
|
# out => < policy match string >
|
||||||
# }
|
# }
|
||||||
# parents => [ <parents> ] Parents, Children and interfaces are listed by name
|
# parents => [ <parents> ] Parents, Children and interfaces are listed by name
|
||||||
# children => [ <children> ]
|
# children => [ <children> ]
|
||||||
# interfaces => { <interfaces1> => 1, ... }
|
# interfaces => { <interfaces1> => 1, ... }
|
||||||
# bridge => <bridge>
|
# bridge => <bridge>
|
||||||
# hosts { <type> } => [ { <interface1> => { ipsec => 'ipsec'|'none'
|
# hosts { <type> } => [ { <interface1> => { ipsec => 'ipsec'|'none'
|
||||||
# options => { <option1> => <value1>
|
# options => { <option1> => <value1>
|
||||||
# ...
|
# ...
|
||||||
# }
|
# }
|
||||||
# hosts => [ <net1> , <net2> , ... ]
|
# hosts => [ <net1> , <net2> , ... ]
|
||||||
# exclusions => [ <net1>, <net2>, ... ]
|
# exclusions => [ <net1>, <net2>, ... ]
|
||||||
# origin => <where defined>
|
# origin => <where defined>
|
||||||
# }
|
# }
|
||||||
# <interface2> => ...
|
# <interface2> => ...
|
||||||
# }
|
# }
|
||||||
# ]
|
# ]
|
||||||
# }
|
# }
|
||||||
# <zone2> => ...
|
# <zone2> => ...
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
# $firewall_zone names the firewall zone.
|
# $firewall_zone names the firewall zone.
|
||||||
#
|
#
|
||||||
@@ -159,27 +160,27 @@ our %reservedName = ( all => 1,
|
|||||||
#
|
#
|
||||||
# @interfaces lists the interface names in the order that they appear in the interfaces file.
|
# @interfaces lists the interface names in the order that they appear in the interfaces file.
|
||||||
#
|
#
|
||||||
# %interfaces { <interface1> => { name => <name of interface>
|
# %interfaces { <interface1> => { name => <name of interface>
|
||||||
# root => <name without trailing '+'>
|
# root => <name without trailing '+'>
|
||||||
# options => { port => undef|1
|
# options => { port => undef|1
|
||||||
# { <option1> } => <val1> , #See %validinterfaceoptions
|
# { <option1> } => <val1> , #See %validinterfaceoptions
|
||||||
# ...
|
# ...
|
||||||
# }
|
# }
|
||||||
# zone => <zone name>
|
# zone => <zone name>
|
||||||
# multizone => undef|1 #More than one zone interfaces through this interface
|
# multizone => undef|1 #More than one zone interfaces through this interface
|
||||||
# nets => <number of nets in interface/hosts records referring to this interface>
|
# nets => <number of nets in interface/hosts records referring to this interface>
|
||||||
# bridge => <bridge name> # Same as ->{name} if not a bridge port.
|
# bridge => <bridge name> # Same as ->{name} if not a bridge port.
|
||||||
# ports => <number of port on this bridge>
|
# ports => <number of port on this bridge>
|
||||||
# ipsec => undef|1 # Has an ipsec host group
|
# ipsec => undef|1 # Has an ipsec host group
|
||||||
# broadcasts => 'none', 'detect' or [ <addr1>, <addr2>, ... ]
|
# broadcasts => 'none', 'detect' or [ <addr1>, <addr2>, ... ]
|
||||||
# number => <ordinal position in the interfaces file>
|
# number => <ordinal position in the interfaces file>
|
||||||
# physical => <physical interface name>
|
# physical => <physical interface name>
|
||||||
# base => <shell variable base representing this interface>
|
# base => <shell variable base representing this interface>
|
||||||
# wildcard => undef|1 # Wildcard Name
|
# wildcard => undef|1 # Wildcard Name
|
||||||
# zones => { zone1 => 1, ... }
|
# zones => { zone1 => 1, ... }
|
||||||
# origin => <where defined>
|
# origin => <where defined>
|
||||||
# }
|
# }
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
# The purpose of the 'base' member is to ensure that the base names associated with the physical interfaces are assigned in
|
# The purpose of the 'base' member is to ensure that the base names associated with the physical interfaces are assigned in
|
||||||
# the same order as the interfaces are encountered in the configuration files.
|
# the same order as the interfaces are encountered in the configuration files.
|
||||||
@@ -252,17 +253,6 @@ use constant { NO_UPDOWN => 1,
|
|||||||
|
|
||||||
our %validinterfaceoptions;
|
our %validinterfaceoptions;
|
||||||
|
|
||||||
our %procinterfaceoptions=( accept_ra => 1,
|
|
||||||
arp_filter => 1,
|
|
||||||
arp_ignore => 1,
|
|
||||||
forward => 1,
|
|
||||||
logmartians => 1,
|
|
||||||
proxyarp => 1,
|
|
||||||
proxyndp => 1,
|
|
||||||
routefilter => 1,
|
|
||||||
sourceroute => 1,
|
|
||||||
);
|
|
||||||
|
|
||||||
our %prohibitunmanaged = (
|
our %prohibitunmanaged = (
|
||||||
blacklist => 1,
|
blacklist => 1,
|
||||||
bridge => 1,
|
bridge => 1,
|
||||||
@@ -327,7 +317,7 @@ sub initialize( $$ ) {
|
|||||||
%mapbase = ();
|
%mapbase = ();
|
||||||
%mapbase1 = ();
|
%mapbase1 = ();
|
||||||
$baseseq = 0;
|
$baseseq = 0;
|
||||||
$minroot = undef;
|
$minroot = 0;
|
||||||
$loopback_interface = '';
|
$loopback_interface = '';
|
||||||
|
|
||||||
%validzoneoptions = ( mss => NUMERIC,
|
%validzoneoptions = ( mss => NUMERIC,
|
||||||
@@ -349,7 +339,7 @@ sub initialize( $$ ) {
|
|||||||
arp_ignore => ENUM_IF_OPTION,
|
arp_ignore => ENUM_IF_OPTION,
|
||||||
blacklist => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
blacklist => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
||||||
bridge => SIMPLE_IF_OPTION,
|
bridge => SIMPLE_IF_OPTION,
|
||||||
dbl => ENUM_IF_OPTION + IF_OPTION_WILDOK,
|
dbl => ENUM_IF_OPTION,
|
||||||
destonly => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
destonly => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
||||||
detectnets => OBSOLETE_IF_OPTION,
|
detectnets => OBSOLETE_IF_OPTION,
|
||||||
dhcp => SIMPLE_IF_OPTION,
|
dhcp => SIMPLE_IF_OPTION,
|
||||||
@@ -373,9 +363,9 @@ sub initialize( $$ ) {
|
|||||||
upnp => SIMPLE_IF_OPTION,
|
upnp => SIMPLE_IF_OPTION,
|
||||||
upnpclient => SIMPLE_IF_OPTION,
|
upnpclient => SIMPLE_IF_OPTION,
|
||||||
mss => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
mss => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
||||||
physical => STRING_IF_OPTION + IF_OPTION_HOST + IF_OPTION_WILDOK,
|
physical => STRING_IF_OPTION + IF_OPTION_HOST,
|
||||||
unmanaged => SIMPLE_IF_OPTION,
|
unmanaged => SIMPLE_IF_OPTION,
|
||||||
wait => NUMERIC_IF_OPTION,
|
wait => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
||||||
);
|
);
|
||||||
%validhostoptions = (
|
%validhostoptions = (
|
||||||
blacklist => 1,
|
blacklist => 1,
|
||||||
@@ -400,7 +390,7 @@ sub initialize( $$ ) {
|
|||||||
%validinterfaceoptions = ( accept_ra => NUMERIC_IF_OPTION,
|
%validinterfaceoptions = ( accept_ra => NUMERIC_IF_OPTION,
|
||||||
blacklist => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
blacklist => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
||||||
bridge => SIMPLE_IF_OPTION,
|
bridge => SIMPLE_IF_OPTION,
|
||||||
dbl => ENUM_IF_OPTION + IF_OPTION_WILDOK,
|
dbl => ENUM_IF_OPTION,
|
||||||
destonly => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
destonly => SIMPLE_IF_OPTION + IF_OPTION_HOST,
|
||||||
dhcp => SIMPLE_IF_OPTION,
|
dhcp => SIMPLE_IF_OPTION,
|
||||||
ignore => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
ignore => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
||||||
@@ -412,18 +402,18 @@ sub initialize( $$ ) {
|
|||||||
optional => SIMPLE_IF_OPTION,
|
optional => SIMPLE_IF_OPTION,
|
||||||
proxyndp => BINARY_IF_OPTION,
|
proxyndp => BINARY_IF_OPTION,
|
||||||
required => SIMPLE_IF_OPTION,
|
required => SIMPLE_IF_OPTION,
|
||||||
routeback => BINARY_IF_OPTION + IF_OPTION_ZONEONLY + IF_OPTION_HOST + IF_OPTION_VSERVER + IF_OPTION_WILDOK,
|
routeback => BINARY_IF_OPTION + IF_OPTION_ZONEONLY + IF_OPTION_HOST + IF_OPTION_VSERVER,
|
||||||
rpfilter => SIMPLE_IF_OPTION,
|
rpfilter => SIMPLE_IF_OPTION,
|
||||||
sfilter => IPLIST_IF_OPTION,
|
sfilter => IPLIST_IF_OPTION,
|
||||||
sourceroute => BINARY_IF_OPTION,
|
sourceroute => BINARY_IF_OPTION,
|
||||||
tcpflags => BINARY_IF_OPTION + IF_OPTION_HOST,
|
tcpflags => BINARY_IF_OPTION + IF_OPTION_HOST,
|
||||||
mss => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
mss => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
||||||
forward => BINARY_IF_OPTION,
|
forward => BINARY_IF_OPTION,
|
||||||
physical => STRING_IF_OPTION + IF_OPTION_HOST + IF_OPTION_WILDOK,
|
physical => STRING_IF_OPTION + IF_OPTION_HOST,
|
||||||
unmanaged => SIMPLE_IF_OPTION,
|
unmanaged => SIMPLE_IF_OPTION,
|
||||||
upnp => SIMPLE_IF_OPTION,
|
upnp => SIMPLE_IF_OPTION,
|
||||||
upnpclient => SIMPLE_IF_OPTION,
|
upnpclient => SIMPLE_IF_OPTION,
|
||||||
wait => NUMERIC_IF_OPTION,
|
wait => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
||||||
);
|
);
|
||||||
%validhostoptions = (
|
%validhostoptions = (
|
||||||
blacklist => 1,
|
blacklist => 1,
|
||||||
@@ -711,40 +701,6 @@ sub haveipseczones() {
|
|||||||
0;
|
0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Returns 1 if the two interfaces passed are related
|
|
||||||
#
|
|
||||||
sub interface_match( $$ ) {
|
|
||||||
my ( $piface, $ciface ) = @_;
|
|
||||||
|
|
||||||
return 1 if $piface eq $ciface;
|
|
||||||
|
|
||||||
my ( $pifaceref, $cifaceref ) = @interfaces{$piface, $ciface};
|
|
||||||
|
|
||||||
return 1 if $piface eq $cifaceref->{bridge};
|
|
||||||
return 1 if $ciface eq $pifaceref->{bridge};
|
|
||||||
|
|
||||||
if ( defined $minroot ) {
|
|
||||||
if ( $piface =~ /\+$/ ) {
|
|
||||||
my $root = $pifaceref->{root};
|
|
||||||
my $rlength = length( $root );
|
|
||||||
while ( length( $ciface ) >= $rlength ) {
|
|
||||||
return 1 if $ciface eq $root;
|
|
||||||
chop $ciface;
|
|
||||||
}
|
|
||||||
} elsif ( $ciface =~ /\+$/ ) {
|
|
||||||
my $root = $cifaceref->{root};
|
|
||||||
my $rlength = length( $root );
|
|
||||||
while ( length( $piface ) >= $rlength ) {
|
|
||||||
return 1 if $piface eq $root;
|
|
||||||
chop $piface;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Report about zones.
|
# Report about zones.
|
||||||
#
|
#
|
||||||
@@ -782,7 +738,7 @@ sub zone_report()
|
|||||||
if ( $family == F_IPV4 ) {
|
if ( $family == F_IPV4 ) {
|
||||||
progress_message_nocompress " $iref->{physical}:$grouplist";
|
progress_message_nocompress " $iref->{physical}:$grouplist";
|
||||||
} else {
|
} else {
|
||||||
progress_message_nocompress " $iref->{physical}:[$grouplist]";
|
progress_message_nocompress " $iref->{physical}:<$grouplist>";
|
||||||
}
|
}
|
||||||
$printed = 1;
|
$printed = 1;
|
||||||
}
|
}
|
||||||
@@ -791,17 +747,6 @@ sub zone_report()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PARENT:
|
|
||||||
for my $p ( @{$zoneref->{parents}} ) {
|
|
||||||
for my $pi ( keys ( %{$zones{$p}{interfaces}} ) ) {
|
|
||||||
for my $ci ( keys( %{$zoneref->{interfaces}} ) ) {
|
|
||||||
next PARENT if interface_match( $pi, $ci );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
warning_message "Zone $zone is defined as a sub-zone of $p, yet the two zones have no interface in common";
|
|
||||||
}
|
|
||||||
|
|
||||||
unless ( $printed ) {
|
unless ( $printed ) {
|
||||||
fatal_error "No bridge has been associated with zone $zone" if $type & BPORT && ! $zoneref->{bridge};
|
fatal_error "No bridge has been associated with zone $zone" if $type & BPORT && ! $zoneref->{bridge};
|
||||||
warning_message "*** $zone is an EMPTY ZONE ***" unless $type == FIREWALL;
|
warning_message "*** $zone is an EMPTY ZONE ***" unless $type == FIREWALL;
|
||||||
@@ -1214,16 +1159,15 @@ sub process_interface( $$ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $wildcard = 0;
|
my $wildcard = 0;
|
||||||
my $physwild = 0;
|
|
||||||
my $root;
|
my $root;
|
||||||
|
|
||||||
if ( $interface =~ /\+$/ ) {
|
if ( $interface =~ /\+$/ ) {
|
||||||
$wildcard = $physwild = 1; # Default physical name is the logical name
|
$wildcard = 1;
|
||||||
$root = substr( $interface, 0, -1 );
|
$root = substr( $interface, 0, -1 );
|
||||||
$roots{$root} = $interface;
|
$roots{$root} = $interface;
|
||||||
my $len = length $root;
|
my $len = length $root;
|
||||||
|
|
||||||
if ( defined $minroot ) {
|
if ( $minroot ) {
|
||||||
$minroot = $len if $minroot > $len;
|
$minroot = $len if $minroot > $len;
|
||||||
} else {
|
} else {
|
||||||
$minroot = $len;
|
$minroot = $len;
|
||||||
@@ -1269,6 +1213,8 @@ sub process_interface( $$ ) {
|
|||||||
my %hostoptions = ( dynamic => 0 );
|
my %hostoptions = ( dynamic => 0 );
|
||||||
|
|
||||||
for my $option (split_list1 $options, 'option' ) {
|
for my $option (split_list1 $options, 'option' ) {
|
||||||
|
next if $option eq '-';
|
||||||
|
|
||||||
( $option, my $value ) = split /=/, $option;
|
( $option, my $value ) = split /=/, $option;
|
||||||
|
|
||||||
fatal_error "Invalid Interface option ($option)" unless my $type = $validinterfaceoptions{$option};
|
fatal_error "Invalid Interface option ($option)" unless my $type = $validinterfaceoptions{$option};
|
||||||
@@ -1305,6 +1251,7 @@ sub process_interface( $$ ) {
|
|||||||
} elsif ( $type == BINARY_IF_OPTION ) {
|
} elsif ( $type == BINARY_IF_OPTION ) {
|
||||||
$value = 1 unless defined $value;
|
$value = 1 unless defined $value;
|
||||||
fatal_error "Option value for '$option' must be 0 or 1" unless ( $value eq '0' || $value eq '1' );
|
fatal_error "Option value for '$option' must be 0 or 1" unless ( $value eq '0' || $value eq '1' );
|
||||||
|
fatal_error "The '$option' option may not be used with a wild-card interface name" if $wildcard && ! $type && IF_OPTION_WILDOK;
|
||||||
$options{$option} = $value;
|
$options{$option} = $value;
|
||||||
$hostoptions{$option} = $value if $hostopt;
|
$hostoptions{$option} = $value if $hostopt;
|
||||||
} elsif ( $type == ENUM_IF_OPTION ) {
|
} elsif ( $type == ENUM_IF_OPTION ) {
|
||||||
@@ -1328,6 +1275,7 @@ sub process_interface( $$ ) {
|
|||||||
assert( 0 );
|
assert( 0 );
|
||||||
}
|
}
|
||||||
} elsif ( $type == NUMERIC_IF_OPTION ) {
|
} elsif ( $type == NUMERIC_IF_OPTION ) {
|
||||||
|
fatal_error "The '$option' option may not be specified on a wildcard interface" if $wildcard && ! $type && IF_OPTION_WILDOK;
|
||||||
$value = $defaultinterfaceoptions{$option} unless defined $value;
|
$value = $defaultinterfaceoptions{$option} unless defined $value;
|
||||||
fatal_error "The '$option' option requires a value" unless defined $value;
|
fatal_error "The '$option' option requires a value" unless defined $value;
|
||||||
my $numval = numeric_value $value;
|
my $numval = numeric_value $value;
|
||||||
@@ -1379,9 +1327,7 @@ sub process_interface( $$ ) {
|
|||||||
|
|
||||||
fatal_error "Duplicate physical interface name ($value)" if ( $interfaces{$value} && ! $port );
|
fatal_error "Duplicate physical interface name ($value)" if ( $interfaces{$value} && ! $port );
|
||||||
|
|
||||||
$physwild = ( $value =~ /\+$/ );
|
fatal_error "The type of 'physical' name ($value) doesn't match the type of interface name ($interface)" if $wildcard && ! $value =~ /\+$/;
|
||||||
fatal_error "The type of 'physical' name ($value) doesn't match the type of interface name ($interface)" if $wildcard && ! $physwild;
|
|
||||||
|
|
||||||
$physical = $value;
|
$physical = $value;
|
||||||
} else {
|
} else {
|
||||||
assert(0);
|
assert(0);
|
||||||
@@ -1409,14 +1355,6 @@ sub process_interface( $$ ) {
|
|||||||
$options{ignore} = 0;
|
$options{ignore} = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for my $option ( keys %options ) {
|
|
||||||
if ( $root ) {
|
|
||||||
warning_message( "The '$option' option is ignored when used with a wildcard physical name" ) if $physwild && $procinterfaceoptions{$option};
|
|
||||||
} else {
|
|
||||||
warning_message( "The '$option' option is ignored when used with interface name '+'" ) unless $validinterfaceoptions{$option} & IF_OPTION_WILDOK;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $netsref eq 'dynamic' ) {
|
if ( $netsref eq 'dynamic' ) {
|
||||||
my $ipset = $family == F_IPV4 ? "${zone}" : "6_${zone}";
|
my $ipset = $family == F_IPV4 ? "${zone}" : "6_${zone}";
|
||||||
$ipset = join( '_', $ipset, var_base1( $physical ) ) unless $zoneref->{options}{in_out}{dynamic_shared};
|
$ipset = join( '_', $ipset, var_base1( $physical ) ) unless $zoneref->{options}{in_out}{dynamic_shared};
|
||||||
@@ -1475,7 +1413,6 @@ sub process_interface( $$ ) {
|
|||||||
zones => {},
|
zones => {},
|
||||||
origin => shortlineinfo( '' ),
|
origin => shortlineinfo( '' ),
|
||||||
wildcard => $wildcard,
|
wildcard => $wildcard,
|
||||||
physwild => $physwild, # Currently unused
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$interfaces{$physical} = $interfaceref if $physical ne $interface;
|
$interfaces{$physical} = $interfaceref if $physical ne $interface;
|
||||||
@@ -1634,11 +1571,13 @@ sub known_interface($)
|
|||||||
|
|
||||||
my $iface = $interface;
|
my $iface = $interface;
|
||||||
|
|
||||||
if ( defined $minroot ) {
|
if ( $minroot ) {
|
||||||
#
|
#
|
||||||
# We have wildcard interfaces -- see if this interface matches one of their roots
|
# We have wildcard interfaces -- see if this interface matches one of their roots
|
||||||
#
|
#
|
||||||
while ( length $iface >= $minroot ) {
|
while ( length $iface > $minroot ) {
|
||||||
|
chop $iface;
|
||||||
|
|
||||||
if ( my $i = $roots{$iface} ) {
|
if ( my $i = $roots{$iface} ) {
|
||||||
#
|
#
|
||||||
# Found one
|
# Found one
|
||||||
@@ -1660,8 +1599,6 @@ sub known_interface($)
|
|||||||
};
|
};
|
||||||
return $interfaceref;
|
return $interfaceref;
|
||||||
}
|
}
|
||||||
|
|
||||||
chop $iface;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1875,8 +1812,7 @@ sub find_interfaces_by_option( $;$ ) {
|
|||||||
for my $interface ( @interfaces ) {
|
for my $interface ( @interfaces ) {
|
||||||
my $interfaceref = $interfaces{$interface};
|
my $interfaceref = $interfaces{$interface};
|
||||||
|
|
||||||
next unless $interfaceref->{root}; # Don't return '+' interface
|
next unless $interfaceref->{root};
|
||||||
next if $procinterfaceoptions{$option} && $interfaceref->{physwild}; # Ignore /proc options on wildcard interface
|
|
||||||
|
|
||||||
my $optionsref = $interfaceref->{options};
|
my $optionsref = $interfaceref->{options};
|
||||||
if ( $nonzero ) {
|
if ( $nonzero ) {
|
||||||
@@ -1891,6 +1827,35 @@ sub find_interfaces_by_option( $;$ ) {
|
|||||||
\@ints;
|
\@ints;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Returns reference to array of interfaces with the passed option. Unlike the preceding function, this one:
|
||||||
|
#
|
||||||
|
# - All entries in %interfaces are searched.
|
||||||
|
# - Returns a two-element list; the second element indicates whether any members of the list have wildcard physical names
|
||||||
|
#
|
||||||
|
sub find_interfaces_by_option1( $ ) {
|
||||||
|
my $option = $_[0];
|
||||||
|
my @ints = ();
|
||||||
|
my $wild = 0;
|
||||||
|
|
||||||
|
for my $interface ( @interfaces ) {
|
||||||
|
my $interfaceref = $interfaces{$interface};
|
||||||
|
|
||||||
|
next unless defined $interfaceref->{physical};
|
||||||
|
|
||||||
|
my $optionsref = $interfaceref->{options};
|
||||||
|
|
||||||
|
if ( $optionsref && defined $optionsref->{$option} ) {
|
||||||
|
$wild ||= $interfaceref->{wildcard};
|
||||||
|
push @ints , $interface
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return unless defined wantarray;
|
||||||
|
|
||||||
|
wantarray ? ( \@ints, $wild ) : \@ints;
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Return the value of an option for an interface
|
# Return the value of an option for an interface
|
||||||
#
|
#
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# (c) 1999-2017 - Tom Eastep (teastep@shorewall.net)
|
# (c) 1999-2016 - Tom Eastep (teastep@shorewall.net)
|
||||||
#
|
#
|
||||||
# This program is part of Shorewall.
|
# This program is part of Shorewall.
|
||||||
#
|
#
|
||||||
@@ -369,7 +369,7 @@ replace_default_route() # $1 = USE_DEFAULT_RT
|
|||||||
delete_default_routes() # $1 = table number
|
delete_default_routes() # $1 = table number
|
||||||
{
|
{
|
||||||
$IP -$g_family route ls table $1 | grep -F default | grep -vF metric | while read route; do
|
$IP -$g_family route ls table $1 | grep -F default | grep -vF metric | while read route; do
|
||||||
qt $IP -$g_family route del $route table $1
|
qt $IP -$g_family route del $route
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -421,7 +421,7 @@ restore_default_route() # $1 = USE_DEFAULT_RT
|
|||||||
conditionally_flush_conntrack() {
|
conditionally_flush_conntrack() {
|
||||||
|
|
||||||
if [ -n "$g_purge" ]; then
|
if [ -n "$g_purge" ]; then
|
||||||
if [ -n "$(mywhich conntrack)" ]; then
|
if [ -n $(mywhich conntrack) ]; then
|
||||||
conntrack -F
|
conntrack -F
|
||||||
else
|
else
|
||||||
error_message "WARNING: The '-p' option requires the conntrack utility which does not appear to be installed on this system"
|
error_message "WARNING: The '-p' option requires the conntrack utility which does not appear to be installed on this system"
|
||||||
@@ -899,7 +899,7 @@ detect_dynamic_gateway() { # $1 = interface
|
|||||||
#
|
#
|
||||||
# Detect the gateway through an interface
|
# Detect the gateway through an interface
|
||||||
#
|
#
|
||||||
detect_gateway() # $1 = interface $2 = table number
|
detect_gateway() # $1 = interface
|
||||||
{
|
{
|
||||||
local interface
|
local interface
|
||||||
interface=$1
|
interface=$1
|
||||||
@@ -912,8 +912,6 @@ detect_gateway() # $1 = interface $2 = table number
|
|||||||
# Maybe there's a default route through this gateway already
|
# Maybe there's a default route through this gateway already
|
||||||
#
|
#
|
||||||
[ -n "$gateway" ] || gateway=$(find_gateway $($IP -4 route list dev $interface | grep ^default))
|
[ -n "$gateway" ] || gateway=$(find_gateway $($IP -4 route list dev $interface | grep ^default))
|
||||||
|
|
||||||
[ -z "$gateway" -a -n "$2" ] && gateway=$(find_gateway $($IP -4 route list dev $interface table $2 | grep ^default))
|
|
||||||
#
|
#
|
||||||
# Last hope -- is there a load-balancing route through the interface?
|
# Last hope -- is there a load-balancing route through the interface?
|
||||||
#
|
#
|
||||||
|
@@ -78,13 +78,11 @@ reload_command() {
|
|||||||
detect_configuration
|
detect_configuration
|
||||||
define_firewall
|
define_firewall
|
||||||
status=$?
|
status=$?
|
||||||
|
if [ -n "$SUBSYSLOCK" ]; then
|
||||||
if [ $status -eq 0 ]; then
|
[ $status -eq 0 ] && touch $SUBSYSLOCK || rm -f $SUBSYSLOCK
|
||||||
[ -n "$SUBSYSLOCK" ] && touch $SUBSYSLOCK
|
|
||||||
progress_message3 "done."
|
|
||||||
else
|
|
||||||
[ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ $status -eq 0 ] && progress_message3 "done."
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -129,10 +127,8 @@ g_counters=
|
|||||||
g_compiled=
|
g_compiled=
|
||||||
g_file=
|
g_file=
|
||||||
g_docker=
|
g_docker=
|
||||||
g_dockeringress=
|
|
||||||
g_dockernetwork=
|
g_dockernetwork=
|
||||||
g_forcereload=
|
g_forcereload=
|
||||||
g_fallback=
|
|
||||||
|
|
||||||
[ -n "$SERVICEDIR" ] && SUBSYSLOCK=
|
[ -n "$SERVICEDIR" ] && SUBSYSLOCK=
|
||||||
|
|
||||||
@@ -268,10 +264,8 @@ case "$COMMAND" in
|
|||||||
error_message "$g_product is not running"
|
error_message "$g_product is not running"
|
||||||
status=2
|
status=2
|
||||||
elif [ $# -eq 1 ]; then
|
elif [ $# -eq 1 ]; then
|
||||||
for table in raw mangle nat filter; do
|
$g_tool -Z
|
||||||
qt $g_tool -t $table -Z
|
$g_tool -t mangle -Z
|
||||||
done
|
|
||||||
|
|
||||||
date > ${VARDIR}/restarted
|
date > ${VARDIR}/restarted
|
||||||
status=0
|
status=0
|
||||||
progress_message3 "$g_product Counters Reset"
|
progress_message3 "$g_product Counters Reset"
|
||||||
@@ -424,12 +418,9 @@ case "$COMMAND" in
|
|||||||
[ $# -ne 1 ] && usage 2
|
[ $# -ne 1 ] && usage 2
|
||||||
mutex_on
|
mutex_on
|
||||||
if product_is_started; then
|
if product_is_started; then
|
||||||
COMMAND=disable
|
|
||||||
detect_configuration $1
|
detect_configuration $1
|
||||||
disable_provider $1 Yes
|
COMMAND=enable disable_provider $1 Yes
|
||||||
COMMAND=enable
|
COMMAND=disable enable_provider $1 Yes
|
||||||
detect_configuration $1
|
|
||||||
enable_provider $1 Yes
|
|
||||||
fi
|
fi
|
||||||
mutex_off
|
mutex_off
|
||||||
status=0
|
status=0
|
||||||
|
@@ -77,7 +77,7 @@ UNTRACKED_LOG_LEVEL=
|
|||||||
|
|
||||||
ARPTABLES=
|
ARPTABLES=
|
||||||
|
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
CONFIG_PATH="${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
||||||
|
|
||||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||||
|
|
||||||
@@ -205,6 +205,8 @@ MINIUPNPD=No
|
|||||||
|
|
||||||
MARK_IN_FORWARD_CHAIN=No
|
MARK_IN_FORWARD_CHAIN=No
|
||||||
|
|
||||||
|
MODULE_SUFFIX="ko ko.xz"
|
||||||
|
|
||||||
MULTICAST=No
|
MULTICAST=No
|
||||||
|
|
||||||
MUTEX_TIMEOUT=60
|
MUTEX_TIMEOUT=60
|
||||||
@@ -247,8 +249,6 @@ TRACK_RULES=No
|
|||||||
|
|
||||||
USE_DEFAULT_RT=Yes
|
USE_DEFAULT_RT=Yes
|
||||||
|
|
||||||
USE_NFLOG_SIZE=No
|
|
||||||
|
|
||||||
USE_PHYSICAL_NAMES=No
|
USE_PHYSICAL_NAMES=No
|
||||||
|
|
||||||
USE_RT_NAMES=No
|
USE_RT_NAMES=No
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Shorewall - Sample Interfaces File for one-interface configuration.
|
# Shorewall - Sample Interfaces File for one-interface configuration.
|
||||||
# Copyright (C) 2006-2017 by the Shorewall Team
|
# Copyright (C) 2006-2015 by the Shorewall Team
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
@@ -14,4 +14,4 @@
|
|||||||
?FORMAT 2
|
?FORMAT 2
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#ZONE INTERFACE OPTIONS
|
#ZONE INTERFACE OPTIONS
|
||||||
net NET_IF dhcp,tcpflags,logmartians,nosmurfs,sourceroute=0,physical=eth0
|
net eth0 dhcp,tcpflags,logmartians,nosmurfs,sourceroute=0
|
||||||
|
@@ -88,7 +88,7 @@ UNTRACKED_LOG_LEVEL=
|
|||||||
|
|
||||||
ARPTABLES=
|
ARPTABLES=
|
||||||
|
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
CONFIG_PATH="${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
||||||
|
|
||||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||||
|
|
||||||
@@ -216,6 +216,8 @@ MINIUPNPD=No
|
|||||||
|
|
||||||
MARK_IN_FORWARD_CHAIN=No
|
MARK_IN_FORWARD_CHAIN=No
|
||||||
|
|
||||||
|
MODULE_SUFFIX="ko ko.xz"
|
||||||
|
|
||||||
MULTICAST=No
|
MULTICAST=No
|
||||||
|
|
||||||
MUTEX_TIMEOUT=60
|
MUTEX_TIMEOUT=60
|
||||||
@@ -258,8 +260,6 @@ TRACK_RULES=No
|
|||||||
|
|
||||||
USE_DEFAULT_RT=Yes
|
USE_DEFAULT_RT=Yes
|
||||||
|
|
||||||
USE_NFLOG_SIZE=No
|
|
||||||
|
|
||||||
USE_PHYSICAL_NAMES=No
|
USE_PHYSICAL_NAMES=No
|
||||||
|
|
||||||
USE_RT_NAMES=No
|
USE_RT_NAMES=No
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Shorewall - Sample Interfaces File for three-interface configuration.
|
# Shorewall - Sample Interfaces File for three-interface configuration.
|
||||||
# Copyright (C) 2006-2017 by the Shorewall Team
|
# Copyright (C) 2006-2015 by the Shorewall Team
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
@@ -14,6 +14,6 @@
|
|||||||
?FORMAT 2
|
?FORMAT 2
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#ZONE INTERFACE OPTIONS
|
#ZONE INTERFACE OPTIONS
|
||||||
net NET_IF tcpflags,dhcp,nosmurfs,routefilter,logmartians,sourceroute=0,physical=eth0
|
net eth0 tcpflags,dhcp,nosmurfs,routefilter,logmartians,sourceroute=0
|
||||||
loc LOC_IF tcpflags,nosmurfs,routefilter,logmartians,physical=eth1
|
loc eth1 tcpflags,nosmurfs,routefilter,logmartians
|
||||||
dmz DMZ_IF tcpflags,nosmurfs,routefilter,logmartians,physical=eth2
|
dmz eth2 tcpflags,nosmurfs,routefilter,logmartians
|
||||||
|
@@ -85,7 +85,7 @@ UNTRACKED_LOG_LEVEL=
|
|||||||
|
|
||||||
ARPTABLES=
|
ARPTABLES=
|
||||||
|
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
CONFIG_PATH="${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
||||||
|
|
||||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||||
|
|
||||||
@@ -213,6 +213,8 @@ MINIUPNPD=No
|
|||||||
|
|
||||||
MARK_IN_FORWARD_CHAIN=No
|
MARK_IN_FORWARD_CHAIN=No
|
||||||
|
|
||||||
|
MODULE_SUFFIX="ko ko.xz"
|
||||||
|
|
||||||
MULTICAST=No
|
MULTICAST=No
|
||||||
|
|
||||||
MUTEX_TIMEOUT=60
|
MUTEX_TIMEOUT=60
|
||||||
@@ -255,8 +257,6 @@ TRACK_RULES=No
|
|||||||
|
|
||||||
USE_DEFAULT_RT=Yes
|
USE_DEFAULT_RT=Yes
|
||||||
|
|
||||||
USE_NFLOG_SIZE=No
|
|
||||||
|
|
||||||
USE_PHYSICAL_NAMES=No
|
USE_PHYSICAL_NAMES=No
|
||||||
|
|
||||||
USE_RT_NAMES=No
|
USE_RT_NAMES=No
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Shorewall - Sample SNAT/Masqueradee File for three-interface configuration.
|
# Shorewall - Sample SNAT/Masqueradee File for three-interface configuration.
|
||||||
# Copyright (C) 2006-2017 by the Shorewall Team
|
# Copyright (C) 2006-2016 by the Shorewall Team
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
@@ -20,4 +20,4 @@
|
|||||||
MASQUERADE 10.0.0.0/8,\
|
MASQUERADE 10.0.0.0/8,\
|
||||||
169.254.0.0/16,\
|
169.254.0.0/16,\
|
||||||
172.16.0.0/12,\
|
172.16.0.0/12,\
|
||||||
192.168.0.0/16 NET_IF
|
192.168.0.0/16 eth0
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Shorewall - Sample Stoppedrules File for three-interface configuration.
|
# Shorewall - Sample Stoppedrules File for three-interface configuration.
|
||||||
# Copyright (C) 2012-2017 by the Shorewall Team
|
# Copyright (C) 2012-2015 by the Shorewall Team
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
@@ -13,8 +13,8 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#ACTION SOURCE DEST PROTO DEST SOURCE
|
#ACTION SOURCE DEST PROTO DEST SOURCE
|
||||||
# PORT(S) PORT(S)
|
# PORT(S) PORT(S)
|
||||||
ACCEPT LOC_IF -
|
ACCEPT eth1 -
|
||||||
ACCEPT - LOC_IF
|
ACCEPT - eth1
|
||||||
ACCEPT DMZ_IF -
|
ACCEPT eth2 -
|
||||||
ACCEPT - DMZ_IF
|
ACCEPT - eth2
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Shorewall - Sample Interfaces File for two-interface configuration.
|
# Shorewall - Sample Interfaces File for two-interface configuration.
|
||||||
# Copyright (C) 2006-2017 by the Shorewall Team
|
# Copyright (C) 2006-2015 by the Shorewall Team
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
@@ -14,5 +14,5 @@
|
|||||||
?FORMAT 2
|
?FORMAT 2
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#ZONE INTERFACE OPTIONS
|
#ZONE INTERFACE OPTIONS
|
||||||
net NET_IF dhcp,tcpflags,nosmurfs,routefilter,logmartians,sourceroute=0,physical=eth0
|
net eth0 dhcp,tcpflags,nosmurfs,routefilter,logmartians,sourceroute=0
|
||||||
loc LOC_IF tcpflags,nosmurfs,routefilter,logmartians,physical=eth1
|
loc eth1 tcpflags,nosmurfs,routefilter,logmartians
|
||||||
|
@@ -88,7 +88,7 @@ UNTRACKED_LOG_LEVEL=
|
|||||||
|
|
||||||
ARPTABLES=
|
ARPTABLES=
|
||||||
|
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
CONFIG_PATH="${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
||||||
|
|
||||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||||
|
|
||||||
@@ -216,6 +216,8 @@ MINIUPNPD=No
|
|||||||
|
|
||||||
MARK_IN_FORWARD_CHAIN=No
|
MARK_IN_FORWARD_CHAIN=No
|
||||||
|
|
||||||
|
MODULE_SUFFIX="ko ko.xz"
|
||||||
|
|
||||||
MULTICAST=No
|
MULTICAST=No
|
||||||
|
|
||||||
MUTEX_TIMEOUT=60
|
MUTEX_TIMEOUT=60
|
||||||
@@ -258,8 +260,6 @@ TRACK_RULES=No
|
|||||||
|
|
||||||
USE_DEFAULT_RT=Yes
|
USE_DEFAULT_RT=Yes
|
||||||
|
|
||||||
USE_NFLOG_SIZE=No
|
|
||||||
|
|
||||||
USE_PHYSICAL_NAMES=No
|
USE_PHYSICAL_NAMES=No
|
||||||
|
|
||||||
USE_RT_NAMES=No
|
USE_RT_NAMES=No
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Shorewall - Sample SNAT/Masqueradee File for two-interface configuration.
|
# Shorewall - Sample SNAT/Masqueradee File for two-interface configuration.
|
||||||
# Copyright (C) 2006-2017 by the Shorewall Team
|
# Copyright (C) 2006-2016 by the Shorewall Team
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
@@ -20,4 +20,4 @@
|
|||||||
MASQUERADE 10.0.0.0/8,\
|
MASQUERADE 10.0.0.0/8,\
|
||||||
169.254.0.0/16,\
|
169.254.0.0/16,\
|
||||||
172.16.0.0/12,\
|
172.16.0.0/12,\
|
||||||
192.168.0.0/16 NET_IF
|
192.168.0.0/16 eth0
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Shorewall - Sample Stoppedrules File for two-interface configuration.
|
# Shorewall - Sample Stoppedrules File for two-interface configuration.
|
||||||
# Copyright (C) 2012-2017 by the Shorewall Team
|
# Copyright (C) 2012-2015 by the Shorewall Team
|
||||||
#
|
#
|
||||||
# This library is free software; you can redistribute it and/or
|
# This library is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU Lesser General Public
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
@@ -13,5 +13,5 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
#ACTION SOURCE DEST PROTO DEST SOURCE
|
#ACTION SOURCE DEST PROTO DEST SOURCE
|
||||||
# PORT(S) PORT(S)
|
# PORT(S) PORT(S)
|
||||||
ACCEPT LOC_IF -
|
ACCEPT eth1 -
|
||||||
ACCEPT - LOC_IF
|
ACCEPT - eth1
|
||||||
|
@@ -21,46 +21,33 @@ allowMcast inline # Silently Allow Multicast
|
|||||||
AutoBL noinline # Auto-blacklist IPs that exceed thesholds
|
AutoBL noinline # Auto-blacklist IPs that exceed thesholds
|
||||||
AutoBLL noinline # Helper for AutoBL
|
AutoBLL noinline # Helper for AutoBL
|
||||||
BLACKLIST logjump,section # Add sender to the dynamic blacklist
|
BLACKLIST logjump,section # Add sender to the dynamic blacklist
|
||||||
?if __ADDRTYPE
|
|
||||||
Broadcast inline,audit # Handles Broadcast/Anycast
|
|
||||||
?else
|
|
||||||
Broadcast noinline,audit # Handles Broadcast/Anycast
|
Broadcast noinline,audit # Handles Broadcast/Anycast
|
||||||
?endif
|
DNSAmp # Matches one-question recursive DNS queries
|
||||||
DNSAmp proto=17 # Matches one-question recursive DNS queries
|
|
||||||
Drop # Default Action for DROP policy (deprecated)
|
Drop # Default Action for DROP policy (deprecated)
|
||||||
dropBcast inline # Silently Drop Broadcast
|
dropBcast inline # Silently Drop Broadcast
|
||||||
dropBcasts inline # Silently Drop Broadcast
|
|
||||||
dropInvalid inline # Drops packets in the INVALID conntrack state
|
dropInvalid inline # Drops packets in the INVALID conntrack state
|
||||||
dropMcast inline # Silently Drop Multicast
|
dropMcast inline # Silently Drop Multicast
|
||||||
dropNotSyn noinline,proto=6 # Silently Drop Non-syn TCP packets
|
dropNotSyn noinline # Silently Drop Non-syn TCP packets
|
||||||
DropDNSrep inline,proto=17 # Drops DNS replies
|
DropDNSrep inline # Drops DNS replies
|
||||||
DropSmurfs noinline # Drop smurf packets
|
DropSmurfs noinline # Drop smurf packets
|
||||||
Established inline,\ # Handles packets in the ESTABLISHED state
|
Established inline,\ # Handles packets in the ESTABLISHED state
|
||||||
state=ESTABLISHED #
|
state=ESTABLISHED #
|
||||||
FIN inline,audit,\ # Handles ACK,FIN packets
|
|
||||||
proto=6
|
|
||||||
forwardUPnP noinline # Allow traffic that upnpd has redirected from 'upnp' interfaces.
|
forwardUPnP noinline # Allow traffic that upnpd has redirected from 'upnp' interfaces.
|
||||||
GlusterFS inline # Handles GlusterFS
|
GlusterFS inline # Handles GlusterFS
|
||||||
IfEvent noinline # Perform an action based on an event
|
IfEvent noinline # Perform an action based on an event
|
||||||
Invalid inline,audit,\ # Handles packets in the INVALID conntrack state
|
Invalid inline,audit,\ # Handles packets in the INVALID conntrack state
|
||||||
state=INVALID #
|
state=INVALID #
|
||||||
Limit noinline # Limit the rate of connections from each individual IP address
|
Limit noinline # Limit the rate of connections from each individual IP address
|
||||||
?if __ADDRTYPE
|
|
||||||
Multicast inline,audit # Handles Multicast
|
|
||||||
?else
|
|
||||||
Multicast noinline,audit # Handles Multicast
|
Multicast noinline,audit # Handles Multicast
|
||||||
?endif
|
|
||||||
New inline,state=NEW # Handles packets in the NEW conntrack state
|
New inline,state=NEW # Handles packets in the NEW conntrack state
|
||||||
NotSyn inline,audit,\ # Handles TCP packets which do not have SYN=1 and ACK=0
|
NotSyn inline,audit # Handles TCP packets which do not have SYN=1 and ACK=0
|
||||||
proto=6
|
rejNotSyn noinline # Silently Reject Non-syn TCP packets
|
||||||
rejNotSyn noinline,proto=6 # Silently Reject Non-syn TCP packets
|
|
||||||
Reject # Default Action for REJECT policy (deprecated)
|
Reject # Default Action for REJECT policy (deprecated)
|
||||||
Related inline,\ # Handles packets in the RELATED conntrack state
|
Related inline,\ # Handles packets in the RELATED conntrack state
|
||||||
state=RELATED #
|
state=RELATED #
|
||||||
ResetEvent inline # Reset an Event
|
ResetEvent inline # Reset an Event
|
||||||
RST inline,audit,\ # Handle packets with RST set
|
RST inline,audit # Handle packets with RST set
|
||||||
proto=6
|
|
||||||
SetEvent inline # Initialize an event
|
SetEvent inline # Initialize an event
|
||||||
TCPFlags proto=6 # Handle bad flag combinations.
|
TCPFlags # Handle bad flag combinations.
|
||||||
Untracked inline,\ # Handles packets in the UNTRACKED conntrack state
|
Untracked inline,\ # Handles packets in the UNTRACKED conntrack state
|
||||||
state=UNTRACKED #
|
state=UNTRACKED #
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
#
|
|
||||||
# Shorewall -- /etc/shorewall/disabled
|
|
||||||
#
|
|
||||||
# Add commands below that you want executed when an optional
|
|
||||||
# interface is successfully disabled using the 'disable' command
|
|
||||||
#
|
|
||||||
# When the commands are invoked:
|
|
||||||
#
|
|
||||||
# $1 contains the physical name of the interface
|
|
||||||
# $2 contains the logical name of the interface
|
|
||||||
# $3 contains the name of the provider associated with the interface,
|
|
||||||
if any
|
|
@@ -1,12 +0,0 @@
|
|||||||
#
|
|
||||||
# Shorewall -- /etc/shorewall/enabled
|
|
||||||
#
|
|
||||||
# Add commands below that you want executed when an optional
|
|
||||||
# interface is successfully enabled using the 'enable' command
|
|
||||||
#
|
|
||||||
# When the commands are invoked:
|
|
||||||
#
|
|
||||||
# $1 contains the physical name of the interface
|
|
||||||
# $2 contains the logical name of the interface
|
|
||||||
# $3 contains the name of the provider associated with the interface,
|
|
||||||
if any
|
|
@@ -77,7 +77,7 @@ UNTRACKED_LOG_LEVEL=
|
|||||||
|
|
||||||
ARPTABLES=
|
ARPTABLES=
|
||||||
|
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
CONFIG_PATH="${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
||||||
|
|
||||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||||
|
|
||||||
@@ -205,6 +205,8 @@ MARK_IN_FORWARD_CHAIN=No
|
|||||||
|
|
||||||
MINIUPNPD=No
|
MINIUPNPD=No
|
||||||
|
|
||||||
|
MODULE_SUFFIX=ko
|
||||||
|
|
||||||
MULTICAST=No
|
MULTICAST=No
|
||||||
|
|
||||||
MUTEX_TIMEOUT=60
|
MUTEX_TIMEOUT=60
|
||||||
@@ -247,8 +249,6 @@ TRACK_RULES=No
|
|||||||
|
|
||||||
USE_DEFAULT_RT=Yes
|
USE_DEFAULT_RT=Yes
|
||||||
|
|
||||||
USE_NFLOG_SIZE=No
|
|
||||||
|
|
||||||
USE_PHYSICAL_NAMES=No
|
USE_PHYSICAL_NAMES=No
|
||||||
|
|
||||||
USE_RT_NAMES=No
|
USE_RT_NAMES=No
|
||||||
|
@@ -3,4 +3,4 @@
|
|||||||
#
|
#
|
||||||
# /usr/share/shorewall/configpath
|
# /usr/share/shorewall/configpath
|
||||||
#
|
#
|
||||||
CONFIG_PATH=":${CONFDIR}/shorewall:${SHAREDIR}/shorewall"
|
CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -211,35 +211,30 @@ get_config() {
|
|||||||
LOG_VERBOSITY=-1
|
LOG_VERBOSITY=-1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${g_export}${g_test}" ]; then
|
if [ -n "$SHOREWALL_SHELL" -a -z "$g_export" ]; then
|
||||||
if [ -n "$SHOREWALL_SHELL" ]; 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
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$IP" ]; then
|
if [ -n "$IP" ]; then
|
||||||
case "$IP" in
|
case "$IP" in
|
||||||
*/*)
|
*/*)
|
||||||
if [ ! -x "$IP" ] ; then
|
if [ ! -x "$IP" ] ; then
|
||||||
fatal_error "The program specified in IP ($IP) does not exist or is not executable"
|
fatal_error "The program specified in IP ($IP) does not exist or is not executable"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
prog="$(mywhich $IP 2> /dev/null)"
|
prog="$(mywhich $IP 2> /dev/null)"
|
||||||
if [ -z "$prog" ] ; then
|
if [ -z "$prog" ] ; then
|
||||||
fatal_error "Can't find $IP executable"
|
fatal_error "Can't find $IP executable"
|
||||||
fi
|
fi
|
||||||
IP=$prog
|
IP=$prog
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
|
||||||
IP='ip'
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
[ -n "$SHOREWALL_SHELL" ] || SHOREWALL_SHELL=/bin/sh
|
IP='ip'
|
||||||
[ -n "$IP" ] || IP='ip'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $VERBOSITY in
|
case $VERBOSITY in
|
||||||
@@ -775,10 +770,6 @@ check_command() {
|
|||||||
g_profile=Yes
|
g_profile=Yes
|
||||||
option=${option#p}
|
option=${option#p}
|
||||||
;;
|
;;
|
||||||
t*)
|
|
||||||
g_test=Yes
|
|
||||||
option=${option#t}
|
|
||||||
;;
|
|
||||||
d*)
|
d*)
|
||||||
g_debug=Yes;
|
g_debug=Yes;
|
||||||
option=${option#d}
|
option=${option#d}
|
||||||
@@ -863,10 +854,6 @@ update_command() {
|
|||||||
g_profile=Yes
|
g_profile=Yes
|
||||||
option=${option#p}
|
option=${option#p}
|
||||||
;;
|
;;
|
||||||
t*)
|
|
||||||
g_test=Yes
|
|
||||||
option=${option#t}
|
|
||||||
;;
|
|
||||||
d*)
|
d*)
|
||||||
g_debug=Yes;
|
g_debug=Yes;
|
||||||
option=${option#d}
|
option=${option#d}
|
||||||
@@ -1540,8 +1527,6 @@ remote_reload_command() # $* = original arguments less the command.
|
|||||||
litedir="${VARDIR}-lite"
|
litedir="${VARDIR}-lite"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
g_export=Yes
|
|
||||||
|
|
||||||
if [ -f $g_shorewalldir/${PRODUCT}.conf ]; then
|
if [ -f $g_shorewalldir/${PRODUCT}.conf ]; then
|
||||||
if [ -f $g_shorewalldir/params ]; then
|
if [ -f $g_shorewalldir/params ]; then
|
||||||
. $g_shorewalldir/params
|
. $g_shorewalldir/params
|
||||||
@@ -1571,16 +1556,18 @@ remote_reload_command() # $* = original arguments less the command.
|
|||||||
|
|
||||||
progress_message "Getting Capabilities on system $system..."
|
progress_message "Getting Capabilities on system $system..."
|
||||||
if [ $g_family -eq 4 ]; then
|
if [ $g_family -eq 4 ]; then
|
||||||
if ! rsh_command "MODULESDIR=$MODULESDIR IPTABLES=$IPTABLES DONT_LOAD=\"$DONT_LOAD\" $libexec/shorewall-lite/shorecap" > $g_shorewalldir/capabilities; then
|
if ! rsh_command "MODULESDIR=$MODULESDIR MODULE_SUFFIX=\"$MODULE_SUFFIX\" IPTABLES=$IPTABLES DONT_LOAD=\"$DONT_LOAD\" $libexec/shorewall-lite/shorecap" > $g_shorewalldir/capabilities; then
|
||||||
fatal_error "Capturing capabilities on system $system failed"
|
fatal_error "Capturing capabilities on system $system failed"
|
||||||
fi
|
fi
|
||||||
elif ! rsh_command "MODULESDIR=$MODULESDIR IP6TABLES=$IP6TABLES DONT_LOAD=\"$DONT_LOAD\" $libexec/shorewall6-lite/shorecap" > $g_shorewalldir/capabilities; then
|
elif ! rsh_command "MODULESDIR=$MODULESDIR MODULE_SUFFIX=\"$MODULE_SUFFIX\" IP6TABLES=$IP6TABLES DONT_LOAD=\"$DONT_LOAD\" $libexec/shorewall6-lite/shorecap" > $g_shorewalldir/capabilities; then
|
||||||
fatal_error "Capturing capabilities on system $system failed"
|
fatal_error "Capturing capabilities on system $system failed"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
file=$(resolve_file $g_shorewalldir/firewall)
|
file=$(resolve_file $g_shorewalldir/firewall)
|
||||||
|
|
||||||
|
g_export=Yes
|
||||||
|
|
||||||
program=$sbindir/${PRODUCT}-lite
|
program=$sbindir/${PRODUCT}-lite
|
||||||
#
|
#
|
||||||
# Handle nonstandard remote VARDIR
|
# Handle nonstandard remote VARDIR
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/accounting</command>
|
<command>/etc/shorewall/accounting</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -783,19 +783,29 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/accounting</para>
|
<para>/etc/shorewall/accounting</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/accounting</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>See ALSO</title>
|
<title>See ALSO</title>
|
||||||
|
|
||||||
<para><ulink
|
<para><ulink
|
||||||
url="shorewall-logging.htm">shorewall-logging(5)</ulink></para>
|
url="/Accounting.html">http://www.shorewall.net/Accounting.html
|
||||||
|
</ulink></para>
|
||||||
|
|
||||||
|
<para><ulink
|
||||||
|
url="/shorewall_logging.html">http://www.shorewall.net/shorewall_logging.html</ulink></para>
|
||||||
|
|
||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-actions(5), shorewall-blacklist(5),
|
||||||
|
shorewall-hosts(5), shorewall_interfaces(5), shorewall-ipsets(5),
|
||||||
|
shorewall-maclist(5), shorewall-masq(5), shorewall-nat(5),
|
||||||
|
shorewall-netmap(5), shorewall-params(5), shorewall-policy(5),
|
||||||
|
shorewall-providers(5), shorewall-proxyarp(5), shorewall-rtrules(5),
|
||||||
|
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/actions</command>
|
<command>/etc/shorewall/actions</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -148,8 +148,8 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>Added in Shorewall 5.0.7. Specifies that this action is
|
<para>Added in Shorewall 5.0.7. Specifies that this action is
|
||||||
to be used in <ulink
|
to be used in <ulink
|
||||||
url="/manpages/shorewall-mangle.html">shorewall-mangle(5)</ulink>
|
url="/manpages/shorewall-mangle.html">shorewall-mangle(5)</ulink> rather
|
||||||
rather than <ulink
|
than <ulink
|
||||||
url="/manpages/shorewall-rules.html">shorewall-rules(5)</ulink>.</para>
|
url="/manpages/shorewall-rules.html">shorewall-rules(5)</ulink>.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -160,11 +160,11 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>Added in Shorewall 5.0.13. Specifies that this action is
|
<para>Added in Shorewall 5.0.13. Specifies that this action is
|
||||||
to be used in <ulink
|
to be used in <ulink
|
||||||
url="/manpages/shorewall-snat.html">shorewall-snat(5)</ulink>
|
url="/manpages/shorewall-snat.html">shorewall-snat(5)</ulink> rather
|
||||||
rather than <ulink
|
than <ulink
|
||||||
url="/manpages/shorewall-rules.html">shorewall-rules(5)</ulink>.
|
url="/manpages/shorewall-rules.html">shorewall-rules(5)</ulink>. The
|
||||||
The <option>mangle</option> and <option>nat</option> options
|
<option>mangle</option> and <option>nat</option> options are
|
||||||
are mutually exclusive.</para>
|
mutually exclusive.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -191,27 +191,6 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>proto</option>=<replaceable>protocol</replaceable></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Added in Shorewall 5.1.10. Specifies that the action is
|
|
||||||
only usable with the specified
|
|
||||||
<replaceable>protocol</replaceable> (name or number). When the
|
|
||||||
action is invoked with no protocol specified in the PROTO
|
|
||||||
column, or if the action is used as a Policy Action, the named
|
|
||||||
<replaceable>protocol</replaceable> will be assumed. If a
|
|
||||||
protocol is specified in the PROTO column of an invocation,
|
|
||||||
then it must match the named
|
|
||||||
<replaceable>protocol</replaceable>.</para>
|
|
||||||
|
|
||||||
<para>The <option>proto</option> option has no effect if the
|
|
||||||
<option>inline</option> or <option>builtin</option> option is
|
|
||||||
specified. A warning is issued if <option>proto</option> is
|
|
||||||
specified along with <option>builtin</option>.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>section</option></term>
|
<term><option>section</option></term>
|
||||||
|
|
||||||
@@ -227,7 +206,7 @@
|
|||||||
<para>Given that neither the <filename>snat</filename> nor the
|
<para>Given that neither the <filename>snat</filename> nor the
|
||||||
<filename>mangle</filename> file is sectioned, this parameter
|
<filename>mangle</filename> file is sectioned, this parameter
|
||||||
has no effect when <option>mangle</option> or
|
has no effect when <option>mangle</option> or
|
||||||
<option>nat</option> is specified.</para>
|
<option>nat</option> is specified. </para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -260,8 +239,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/actions</para>
|
<para>/etc/shorewall/actions</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/actions</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -270,6 +247,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/Actions.html">http://www.shorewall.net/Actions.html</ulink></para>
|
url="/Actions.html">http://www.shorewall.net/Actions.html</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-blacklist(5),
|
||||||
|
shorewall-hosts(5), shorewall_interfaces(5), shorewall-ipsets(5),
|
||||||
|
shorewall-maclist(5), shorewall-masq(5), shorewall-nat(5),
|
||||||
|
shorewall-netmap(5), shorewall-params(5), shorewall-policy(5),
|
||||||
|
shorewall-providers(5), shorewall-proxyarp(5), shorewall-rtrules(5),
|
||||||
|
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -25,8 +25,6 @@
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
|
|
||||||
<para>IPv4 only.</para>
|
|
||||||
|
|
||||||
<para>This file was added in Shorewall 4.5.12 and is used to describe
|
<para>This file was added in Shorewall 4.5.12 and is used to describe
|
||||||
low-level rules managed by arptables (8). These rules only affect Address
|
low-level rules managed by arptables (8). These rules only affect Address
|
||||||
Resolution Protocol (ARP), Reverse Address Resolution Protocol (RARP) and
|
Resolution Protocol (ARP), Reverse Address Resolution Protocol (RARP) and
|
||||||
@@ -379,10 +377,4 @@ SNAT:10.1.10.11 - eth1:10.1.10.0/24 1</programlis
|
|||||||
|
|
||||||
<para>/etc/shorewall/arprules</para>
|
<para>/etc/shorewall/arprules</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
|
||||||
<title>See ALSO</title>
|
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
|
||||||
</refsect1>
|
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/blrules</command>
|
<command>/etc/shorewall/blrules</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -27,9 +27,12 @@
|
|||||||
|
|
||||||
<para>This file is used to perform blacklisting and whitelisting.</para>
|
<para>This file is used to perform blacklisting and whitelisting.</para>
|
||||||
|
|
||||||
<para>Rules in this file are applied depending on the setting of BLACKLIST
|
<para>Rules in this file are applied depending on the setting of
|
||||||
in <ulink
|
BLACKLISTNEWONLY in <ulink
|
||||||
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5).</para>
|
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5). If
|
||||||
|
BLACKLISTNEWONLY=No, then they are applied regardless of the connection
|
||||||
|
tracking state of the packet. If BLACKLISTNEWONLY=Yes, they are applied to
|
||||||
|
connections in the NEW and INVALID states.</para>
|
||||||
|
|
||||||
<para>The format of rules in this file is the same as the format of rules
|
<para>The format of rules in this file is the same as the format of rules
|
||||||
in <ulink url="/manpages/shorewall-rules.html">shorewall-rules
|
in <ulink url="/manpages/shorewall-rules.html">shorewall-rules
|
||||||
@@ -115,10 +118,10 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>A_DROP</term>
|
<term>A_DROP and A_DROP!</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Audited version of DROP. Requires AUDIT_TARGET support
|
<para>Audited versions of DROP. Requires AUDIT_TARGET support
|
||||||
in the kernel and ip6tables.</para>
|
in the kernel and ip6tables.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -167,7 +170,7 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>queues matching packets to a back end logging daemon via
|
<para>queues matching packets to a back end logging daemon via
|
||||||
a netlink socket then continues to the next rule. See <ulink
|
a netlink socket then continues to the next rule. See <ulink
|
||||||
url="shorewall-logging.html">shorewall-logging(5)</ulink>.</para>
|
url="/shorewall_logging.html">http://www.shorewall.net/shorewall_logging.html</ulink>.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -258,7 +261,7 @@
|
|||||||
<para>You may also specify <emphasis role="bold">NFLOG</emphasis>
|
<para>You may also specify <emphasis role="bold">NFLOG</emphasis>
|
||||||
(must be in upper case) as a log level.This will log to the NFLOG
|
(must be in upper case) as a log level.This will log to the NFLOG
|
||||||
target for routing to a separate log through use of ulogd (<ulink
|
target for routing to a separate log through use of ulogd (<ulink
|
||||||
url="shorewall-logging.html">shorewall-logging.htm</ulink>).</para>
|
url="http://www.netfilter.org/projects/ulogd/index.html">http://www.netfilter.org/projects/ulogd/index.html</ulink>).</para>
|
||||||
|
|
||||||
<para>Actions specifying logging may be followed by a log tag (a
|
<para>Actions specifying logging may be followed by a log tag (a
|
||||||
string of alphanumeric characters) which is appended to the string
|
string of alphanumeric characters) which is appended to the string
|
||||||
@@ -273,11 +276,11 @@
|
|||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Examples</title>
|
<title>Example</title>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 1:</term>
|
<term>Example 1:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Drop Teredo packets from the net.</para>
|
<para>Drop Teredo packets from the net.</para>
|
||||||
@@ -287,28 +290,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 2:</term>
|
<term>Example 2:</term>
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Don't subject packets from 2001:DB8::/64 to the remaining
|
|
||||||
rules in the file.</para>
|
|
||||||
|
|
||||||
<programlisting>WHITELIST net:[2001:DB8::/64] all</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>IPv6 Example 1:</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Drop Teredo packets from the net.</para>
|
|
||||||
|
|
||||||
<programlisting>DROP net:[2001::/32] all</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>IPv6 Example 2:</term>
|
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Don't subject packets from 2001:DB8::/64 to the remaining
|
<para>Don't subject packets from 2001:DB8::/64 to the remaining
|
||||||
@@ -324,8 +306,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/blrules</para>
|
<para>/etc/shorewall/blrules</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/blrules</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -337,6 +317,12 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-hosts(5), shorewall-interfaces(5), shorewall-maclist(5),
|
||||||
|
shorewall6-netmap(5),shorewall-params(5), shorewall-policy(5),
|
||||||
|
shorewall-providers(5), shorewall-rtrules(5), shorewall-routestopped(5),
|
||||||
|
shorewall-rules(5), shorewall.conf(5), shorewall-secmarks(5),
|
||||||
|
shorewall-tcclasses(5), shorewall-tcdevices(5), shorewall-mangle(5),
|
||||||
|
shorewall-tos(5), shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/conntrack</command>
|
<command>/etc/shorewall/conntrack</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
<emphasis role="bold">conntrack</emphasis>.</para>
|
<emphasis role="bold">conntrack</emphasis>.</para>
|
||||||
|
|
||||||
<para>The file supports three different column layouts: FORMAT 1, FORMAT
|
<para>The file supports three different column layouts: FORMAT 1, FORMAT
|
||||||
2, and FORMAT 3 with FORMAT 1 being the default. The three differ as
|
2, and FORMAT 3, FORMAT 1 being the default. The three differ as
|
||||||
follows:</para>
|
follows:</para>
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
@@ -311,9 +311,9 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para><option>ULOG</option></para>
|
<para><option>ULOG</option></para>
|
||||||
|
|
||||||
<para>IPv4 only. Added in Shoreawll 4.6.0. Queues the packet to
|
<para>Added in Shoreawll 4.6.0. Queues the packet to a backend
|
||||||
a backend logging daemon using the ULOG netfilter target with
|
logging daemon using the ULOG netfilter target with the
|
||||||
the specified <replaceable>ulog-parameters</replaceable>.</para>
|
specified <replaceable>ulog-parameters</replaceable>.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
@@ -447,7 +447,7 @@
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>This form combines the preceding two and requires that
|
<para>This form combines the preceding two and requires that
|
||||||
both the incoming interface and source address match.</para>
|
both the incoming interace and source address match.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -543,7 +543,7 @@
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>This form combines the preceding two and requires that
|
<para>This form combines the preceding two and requires that
|
||||||
both the outgoing interface and destination address
|
both the outgoing interace and destination address
|
||||||
match.</para>
|
match.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -689,57 +689,31 @@
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>EXAMPLE</title>
|
<title>EXAMPLE</title>
|
||||||
|
|
||||||
<para>IPv4 Example 1:</para>
|
<para>Example 1:</para>
|
||||||
|
|
||||||
<programlisting>#ACTION SOURCE DEST PROTO DPORT SPORT USER
|
<programlisting>#ACTION SOURCE DEST PROTO DPORT SPORT USER
|
||||||
CT:helper:ftp(expevents=new) fw - tcp 21 </programlisting>
|
CT:helper:ftp(expevents=new) fw - tcp 21 </programlisting>
|
||||||
|
|
||||||
<para>IPv4 Example 2 (Shorewall 4.5.10 or later):</para>
|
<para>Example 2 (Shorewall 4.5.10 or later):</para>
|
||||||
|
|
||||||
<para>Drop traffic to/from all zones to IP address 1.2.3.4</para>
|
<para>Drop traffic to/from all zones to IP address 1.2.3.4</para>
|
||||||
|
|
||||||
<programlisting>?FORMAT 2
|
<programlisting>FORMAT 2
|
||||||
#ACTION SOURCE DEST PROTO DPORT SPORT USER
|
#ACTION SOURCE DEST PROTO DPORT SPORT USER
|
||||||
DROP all-:1.2.3.4 -
|
DROP all-:1.2.3.4 -
|
||||||
DROP all 1.2.3.4</programlisting>
|
DROP all 1.2.3.4</programlisting>
|
||||||
|
|
||||||
<para>or<programlisting>?FORMAT 3
|
<para>or<programlisting>FORMAT 3
|
||||||
#ACTION SOURCE DEST PROTO DPORT SPORT USER
|
#ACTION SOURCE DEST PROTO DPORT SPORT USER
|
||||||
DROP:P 1.2.3.4 -
|
DROP:P 1.2.3.4 -
|
||||||
DROP:PO - 1.2.3.4
|
DROP:PO - 1.2.3.4
|
||||||
</programlisting></para>
|
</programlisting></para>
|
||||||
|
|
||||||
<para>IPv6 Example 1:</para>
|
|
||||||
|
|
||||||
<para>Use the FTP helper for TCP port 21 connections from the firewall
|
|
||||||
itself.</para>
|
|
||||||
|
|
||||||
<programlisting>FORMAT 2
|
|
||||||
#ACTION SOURCE DEST PROTO DPORT SPORT USER
|
|
||||||
CT:helper:ftp(expevents=new) fw - tcp 21 </programlisting>
|
|
||||||
|
|
||||||
<para>IPv6 Example 2 (Shorewall 4.5.10 or later):</para>
|
|
||||||
|
|
||||||
<para>Drop traffic to/from all zones to IP address 2001:1.2.3::4</para>
|
|
||||||
|
|
||||||
<programlisting>FORMAT 2
|
|
||||||
#ACTION SOURCE DEST PROTO DPORT SPORT USER
|
|
||||||
DROP all-:2001:1.2.3::4 -
|
|
||||||
DROP all 2001:1.2.3::4
|
|
||||||
</programlisting>
|
|
||||||
|
|
||||||
<para>or<programlisting>FORMAT 3
|
|
||||||
#ACTION SOURCE DEST PROTO DPORT SPORT USER
|
|
||||||
DROP:P 2001:1.2.3::4 -
|
|
||||||
DROP:PO - 2001:1.2.3::4</programlisting></para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/conntrack</para>
|
<para>/etc/shorewall/conntrack</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/conntrack</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -748,6 +722,14 @@ DROP:PO - 2001:1.2.3::4</programlisting><
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-masq(5), shorewall-nat(5),
|
||||||
|
shorewall-netmap(5), shorewall-params(5), shorewall-policy(5),
|
||||||
|
shorewall-providers(5), shorewall-proxyarp(5), shorewall-rtrules(5),
|
||||||
|
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -25,12 +25,8 @@
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
|
|
||||||
<para>IPv4 only.</para>
|
|
||||||
|
|
||||||
<para>Use this file to list the destinations for which you want to disable
|
<para>Use this file to list the destinations for which you want to disable
|
||||||
ECN (Explicit Congestion Notification). Use of this file is deprecated in
|
ECN (Explicit Congestion Notification).</para>
|
||||||
favor of ECN rules in <ulink
|
|
||||||
url="/manpages/shorewall-mangle.html">shorewall-mangle</ulink>(8).</para>
|
|
||||||
|
|
||||||
<para>The columns in the file are as follows.</para>
|
<para>The columns in the file are as follows.</para>
|
||||||
|
|
||||||
@@ -69,6 +65,14 @@
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>See ALSO</title>
|
<title>See ALSO</title>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcclasses(5),
|
||||||
|
shorewall-tcdevices(5), shorewall-mangle(5), shorewall-tos(5),
|
||||||
|
shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -49,10 +49,9 @@
|
|||||||
|
|
||||||
<para>Beginning in Shorewall 4.4.13, the second form of exclusion is
|
<para>Beginning in Shorewall 4.4.13, the second form of exclusion is
|
||||||
allowed after <emphasis role="bold">all</emphasis> and <emphasis
|
allowed after <emphasis role="bold">all</emphasis> and <emphasis
|
||||||
role="bold">any</emphasis> in the SOURCE and DEST columns of <ulink
|
role="bold">any</emphasis> in the SOURCE and DEST columns of
|
||||||
url="/manpages/shorewall-rules.html">shorewall-rules</ulink>(5). It allows
|
/etc/shorewall/rules. It allows you to omit arbitrary zones from the list
|
||||||
you to omit arbitrary zones from the list generated by those key
|
generated by those key words.</para>
|
||||||
words.</para>
|
|
||||||
|
|
||||||
<warning>
|
<warning>
|
||||||
<para>If you omit a sub-zone and there is an explicit or explicit
|
<para>If you omit a sub-zone and there is an explicit or explicit
|
||||||
@@ -118,7 +117,7 @@ ACCEPT all!z2 net tcp 22</programlisting>
|
|||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 1 - All IPv4 addresses except 192.168.3.4</term>
|
<term>Example 1 - All IPv4 addresses except 192.168.3.4</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>!192.168.3.4</para>
|
<para>!192.168.3.4</para>
|
||||||
@@ -126,8 +125,8 @@ ACCEPT all!z2 net tcp 22</programlisting>
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 2 - All IPv4 addresses except the network
|
<term>Example 2 - All IPv4 addresses except the network 192.168.1.0/24
|
||||||
192.168.1.0/24 and the host 10.2.3.4</term>
|
and the host 10.2.3.4</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>!192.168.1.0/24,10.1.3.4</para>
|
<para>!192.168.1.0/24,10.1.3.4</para>
|
||||||
@@ -135,7 +134,7 @@ ACCEPT all!z2 net tcp 22</programlisting>
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 3 - All IPv4 addresses except the range
|
<term>Example 3 - All IPv4 addresses except the range
|
||||||
192.168.1.3-192.168.1.12 and the network 10.0.0.0/8</term>
|
192.168.1.3-192.168.1.12 and the network 10.0.0.0/8</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -144,8 +143,8 @@ ACCEPT all!z2 net tcp 22</programlisting>
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 4 - The network 192.168.1.0/24 except hosts
|
<term>Example 4 - The network 192.168.1.0/24 except hosts 192.168.1.3
|
||||||
192.168.1.3 and 192.168.1.9</term>
|
and 192.168.1.9</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>192.168.1.0/24!192.168.1.3,192.168.1.9</para>
|
<para>192.168.1.0/24!192.168.1.3,192.168.1.9</para>
|
||||||
@@ -177,6 +176,14 @@ ACCEPT all!z2 net tcp 22</programlisting>
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>See ALSO</title>
|
<title>See ALSO</title>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcclasses(5),
|
||||||
|
shorewall-tcdevices(5), shorewall-mangle(5), shorewall-tos(5),
|
||||||
|
shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/hosts</command>
|
<command>/etc/shorewall/hosts</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -270,8 +270,6 @@ vpn ppp+:192.168.3.0/24</programlisting></para>
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/hosts</para>
|
<para>/etc/shorewall/hosts</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/hosts</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -280,6 +278,14 @@ vpn ppp+:192.168.3.0/24</programlisting></para>
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall_interfaces(5), shorewall-ipsets(5),
|
||||||
|
shorewall-maclist(5), shorewall-masq(5), shorewall-nat(5),
|
||||||
|
shorewall-nesting(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcclasses(5),
|
||||||
|
shorewall-tcdevices(5), shorewall-mangle(5), shorewall-tos(5),
|
||||||
|
shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -165,6 +165,14 @@
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>See ALSO</title>
|
<title>See ALSO</title>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcclasses(5),
|
||||||
|
shorewall-tcdevices(5), shorewall-mangle(5), shorewall-tos(5),
|
||||||
|
shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/interfaces</command>
|
<command>/etc/shorewall/interfaces</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -104,7 +104,9 @@ loc eth2 -</programlisting>
|
|||||||
<para>You may use wildcards here by specifying a prefix followed by
|
<para>You may use wildcards here by specifying a prefix followed by
|
||||||
the plus sign ("+"). For example, if you want to make an entry that
|
the plus sign ("+"). For example, if you want to make an entry that
|
||||||
applies to all PPP interfaces, use 'ppp+'; that would match ppp0,
|
applies to all PPP interfaces, use 'ppp+'; that would match ppp0,
|
||||||
ppp1, ppp2, …</para>
|
ppp1, ppp2, … Please note that the '+' means '<emphasis
|
||||||
|
role="bold">one</emphasis> or more additional characters' so 'ppp'
|
||||||
|
does not match 'ppp+'.</para>
|
||||||
|
|
||||||
<para>When using Shorewall versions before 4.1.4, care must be
|
<para>When using Shorewall versions before 4.1.4, care must be
|
||||||
exercised when using wildcards where there is another zone that uses
|
exercised when using wildcards where there is another zone that uses
|
||||||
@@ -112,10 +114,7 @@ loc eth2 -</programlisting>
|
|||||||
url="/manpages/shorewall-nesting.html">shorewall-nesting</ulink>(5)
|
url="/manpages/shorewall-nesting.html">shorewall-nesting</ulink>(5)
|
||||||
for a discussion of this problem.</para>
|
for a discussion of this problem.</para>
|
||||||
|
|
||||||
<para>Shorewall allows '+' as an interface name, but that usage is
|
<para>Shorewall allows '+' as an interface name.</para>
|
||||||
deprecated. A better approach is to specify
|
|
||||||
'<option>physical</option>=+' in the OPTIONS column (see
|
|
||||||
below).</para>
|
|
||||||
|
|
||||||
<para>There is no need to define the loopback interface (lo) in this
|
<para>There is no need to define the loopback interface (lo) in this
|
||||||
file.</para>
|
file.</para>
|
||||||
@@ -196,76 +195,27 @@ loc eth2 -</programlisting>
|
|||||||
should have no embedded white-space.</para>
|
should have no embedded white-space.</para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis
|
|
||||||
role="bold">accept_ra</emphasis>[={0|1|2}]</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>IPv6 only; added in Shorewall 4.5.16. Values are:</para>
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>0</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Do not accept Router Advertisements.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>1</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Accept Route Advertisements if forwarding is
|
|
||||||
disabled.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>2</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Overrule forwarding behavior. Accept Route
|
|
||||||
Advertisements even if forwarding is enabled.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
|
|
||||||
<para>If the option is specified without a value, then the
|
|
||||||
value 1 is assumed.</para>
|
|
||||||
|
|
||||||
<note>
|
|
||||||
<para>This option does not work with a wild-card <emphasis
|
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">arp_filter[={0|1}]</emphasis></term>
|
<term><emphasis role="bold">arp_filter[={0|1}]</emphasis></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only. If specified, this interface will only
|
<para>If specified, this interface will only respond to ARP
|
||||||
respond to ARP who-has requests for IP addresses configured on
|
who-has requests for IP addresses configured on the interface.
|
||||||
the interface. If not specified, the interface can respond to
|
If not specified, the interface can respond to ARP who-has
|
||||||
ARP who-has requests for IP addresses on any of the firewall's
|
requests for IP addresses on any of the firewall's interface.
|
||||||
interface. The interface must be up when Shorewall is
|
The interface must be up when Shorewall is started.</para>
|
||||||
started.</para>
|
|
||||||
|
|
||||||
<para>Only those interfaces with the
|
<para>Only those interfaces with the
|
||||||
<option>arp_filter</option> option will have their setting
|
<option>arp_filter</option> option will have their setting
|
||||||
changed; the value assigned to the setting will be the value
|
changed; the value assigned to the setting will be the value
|
||||||
specified (if any) or 1 if no value is given.</para>
|
specified (if any) or 1 if no value is given.</para>
|
||||||
|
|
||||||
|
<para/>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>This option does not work with a wild-card <emphasis
|
<para>This option does not work with a wild-card
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
<replaceable>interface</replaceable> name (e.g., eth0.+) in
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
the INTERFACE column.</para>
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
</note>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -275,8 +225,8 @@ loc eth2 -</programlisting>
|
|||||||
role="bold">arp_ignore</emphasis>[=<emphasis>number</emphasis>]</term>
|
role="bold">arp_ignore</emphasis>[=<emphasis>number</emphasis>]</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only. If specified, this interface will respond to
|
<para>If specified, this interface will respond to arp
|
||||||
arp requests based on the value of <emphasis>number</emphasis>
|
requests based on the value of <emphasis>number</emphasis>
|
||||||
(defaults to 1).</para>
|
(defaults to 1).</para>
|
||||||
|
|
||||||
<para>1 - reply only if the target IP address is local address
|
<para>1 - reply only if the target IP address is local address
|
||||||
@@ -294,14 +244,16 @@ loc eth2 -</programlisting>
|
|||||||
|
|
||||||
<para>8 - do not reply for all local addresses</para>
|
<para>8 - do not reply for all local addresses</para>
|
||||||
|
|
||||||
|
<para/>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>This option does not work with a wild-card <emphasis
|
<para>This option does not work with a wild-card
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
<replaceable>interface</replaceable> name (e.g., eth0.+) in
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
the INTERFACE column.</para>
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
|
<para/>
|
||||||
|
|
||||||
<warning>
|
<warning>
|
||||||
<para>Do not specify <emphasis
|
<para>Do not specify <emphasis
|
||||||
role="bold">arp_ignore</emphasis> for any interface involved
|
role="bold">arp_ignore</emphasis> for any interface involved
|
||||||
@@ -459,8 +411,8 @@ loc eth2 -</programlisting>
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>the interface is a <ulink
|
<para>the interface is a <ulink
|
||||||
url="/SimpleBridge.html">simple bridge</ulink> with a DHCP
|
url="/SimpleBridge.html">simple bridge</ulink> with a
|
||||||
server on one port and DHCP clients on another
|
DHCP server on one port and DHCP clients on another
|
||||||
port.</para>
|
port.</para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
@@ -479,25 +431,6 @@ loc eth2 -</programlisting>
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">forward</emphasis>[={0|1}]</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>IPv6 only Sets the
|
|
||||||
/proc/sys/net/ipv6/conf/interface/forwarding option to the
|
|
||||||
specified value. If no value is supplied, then 1 is
|
|
||||||
assumed.</para>
|
|
||||||
|
|
||||||
<note>
|
|
||||||
<para>This option does not work with a wild-card <emphasis
|
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">ignore[=1]</emphasis></term>
|
<term><emphasis role="bold">ignore[=1]</emphasis></term>
|
||||||
|
|
||||||
@@ -534,15 +467,15 @@ loc eth2 -</programlisting>
|
|||||||
role="bold">logmartians[={0|1}]</emphasis></term>
|
role="bold">logmartians[={0|1}]</emphasis></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only. Turn on kernel martian logging (logging of
|
<para>Turn on kernel martian logging (logging of packets with
|
||||||
packets with impossible source addresses. It is strongly
|
impossible source addresses. It is strongly suggested that if
|
||||||
suggested that if you set <emphasis
|
you set <emphasis role="bold">routefilter</emphasis> on an
|
||||||
role="bold">routefilter</emphasis> on an interface that you
|
interface that you also set <emphasis
|
||||||
also set <emphasis role="bold">logmartians</emphasis>. Even if
|
role="bold">logmartians</emphasis>. Even if you do not specify
|
||||||
you do not specify the <option>routefilter</option> option, it
|
the <option>routefilter</option> option, it is a good idea to
|
||||||
is a good idea to specify <option>logmartians</option> because
|
specify <option>logmartians</option> because your distribution
|
||||||
your distribution may have enabled route filtering without you
|
may have enabled route filtering without you knowing
|
||||||
knowing it.</para>
|
it.</para>
|
||||||
|
|
||||||
<para>Only those interfaces with the
|
<para>Only those interfaces with the
|
||||||
<option>logmartians</option> option will have their setting
|
<option>logmartians</option> option will have their setting
|
||||||
@@ -564,11 +497,9 @@ loc eth2 -</programlisting>
|
|||||||
<para/>
|
<para/>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>This option does not work with a wild-card <emphasis
|
<para>This option does not work with a wild-card
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
<replaceable>interface</replaceable> name (e.g., eth0.+) in
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
the INTERFACE column.</para>
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
@@ -645,8 +576,8 @@ loc eth2 -</programlisting>
|
|||||||
<term><emphasis role="bold">nosmurfs</emphasis></term>
|
<term><emphasis role="bold">nosmurfs</emphasis></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only. Filter packets for smurfs (packets with a
|
<para>Filter packets for smurfs (packets with a broadcast
|
||||||
broadcast address as the source).</para>
|
address as the source).</para>
|
||||||
|
|
||||||
<para>Smurfs will be optionally logged based on the setting of
|
<para>Smurfs will be optionally logged based on the setting of
|
||||||
SMURF_LOG_LEVEL in <ulink
|
SMURF_LOG_LEVEL in <ulink
|
||||||
@@ -665,9 +596,9 @@ loc eth2 -</programlisting>
|
|||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>a <filename
|
<para>a <filename
|
||||||
class="directory">/proc/sys/net/ipv[46]/conf/</filename>
|
class="directory">/proc/sys/net/ipv4/conf/</filename>
|
||||||
entry for the interface cannot be modified (including for
|
entry for the interface cannot be modified (including for
|
||||||
proxy ARP or proxy NDP).</para>
|
proxy ARP).</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -695,10 +626,7 @@ loc eth2 -</programlisting>
|
|||||||
|
|
||||||
<para>If the <emphasis>interface</emphasis> name is a wildcard
|
<para>If the <emphasis>interface</emphasis> name is a wildcard
|
||||||
name (ends with '+'), then the physical
|
name (ends with '+'), then the physical
|
||||||
<emphasis>name</emphasis> must also end in '+'. The physical
|
<emphasis>name</emphasis> must also end in '+'.</para>
|
||||||
<replaceable>name</replaceable> may end in '+' (or be exactly
|
|
||||||
'+') when the <replaceable>interface</replaceable> name is not
|
|
||||||
a wildcard name.</para>
|
|
||||||
|
|
||||||
<para>If <option>physical</option> is not specified, then it's
|
<para>If <option>physical</option> is not specified, then it's
|
||||||
value defaults to the <emphasis>interface</emphasis>
|
value defaults to the <emphasis>interface</emphasis>
|
||||||
@@ -710,7 +638,7 @@ loc eth2 -</programlisting>
|
|||||||
<term><emphasis role="bold">proxyarp[={0|1}]</emphasis></term>
|
<term><emphasis role="bold">proxyarp[={0|1}]</emphasis></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only. Sets
|
<para>Sets
|
||||||
/proc/sys/net/ipv4/conf/<emphasis>interface</emphasis>/proxy_arp.
|
/proc/sys/net/ipv4/conf/<emphasis>interface</emphasis>/proxy_arp.
|
||||||
Do NOT use this option if you are employing Proxy ARP through
|
Do NOT use this option if you are employing Proxy ARP through
|
||||||
entries in <ulink
|
entries in <ulink
|
||||||
@@ -720,13 +648,9 @@ loc eth2 -</programlisting>
|
|||||||
url="http://tldp.org/HOWTO/Proxy-ARP-Subnet/index.html">http://tldp.org/HOWTO/Proxy-ARP-Subnet/index.html.
|
url="http://tldp.org/HOWTO/Proxy-ARP-Subnet/index.html">http://tldp.org/HOWTO/Proxy-ARP-Subnet/index.html.
|
||||||
</ulink></para>
|
</ulink></para>
|
||||||
|
|
||||||
<note>
|
<para><emphasis role="bold">Note</emphasis>: This option does
|
||||||
<para>This option does not work with a wild-card <emphasis
|
not work with a wild-card <replaceable>interface</replaceable>
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
name (e.g., eth0.+) in the INTERFACE column.</para>
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
|
||||||
|
|
||||||
<para>Only those interfaces with the <option>proxyarp</option>
|
<para>Only those interfaces with the <option>proxyarp</option>
|
||||||
option will have their setting changed; the value assigned to
|
option will have their setting changed; the value assigned to
|
||||||
@@ -735,28 +659,6 @@ loc eth2 -</programlisting>
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">proxyndp</emphasis>[={0|1}]</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>IPv6 only. Sets
|
|
||||||
/proc/sys/net/ipv6/conf/<emphasis>interface</emphasis>/proxy_ndp.</para>
|
|
||||||
|
|
||||||
<note>
|
|
||||||
<para>This option does not work with a wild-card <emphasis
|
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
|
||||||
|
|
||||||
<para>Only those interfaces with the <option>proxyndp</option>
|
|
||||||
option will have their setting changed; the value assigned to
|
|
||||||
the setting will be the value specified (if any) or 1 if no
|
|
||||||
value is given.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">required</emphasis></term>
|
<term><emphasis role="bold">required</emphasis></term>
|
||||||
|
|
||||||
@@ -798,8 +700,8 @@ loc eth2 -</programlisting>
|
|||||||
role="bold">routefilter[={0|1|2}]</emphasis></term>
|
role="bold">routefilter[={0|1|2}]</emphasis></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only. Turn on kernel route filtering for this
|
<para>Turn on kernel route filtering for this interface
|
||||||
interface (anti-spoofing measure).</para>
|
(anti-spoofing measure).</para>
|
||||||
|
|
||||||
<para>Only those interfaces with the
|
<para>Only those interfaces with the
|
||||||
<option>routefilter</option> option will have their setting
|
<option>routefilter</option> option will have their setting
|
||||||
@@ -812,11 +714,9 @@ loc eth2 -</programlisting>
|
|||||||
filtering.</para>
|
filtering.</para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>This option does not work with a wild-card <emphasis
|
<para>This option does not work with a wild-card
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
<replaceable>interface</replaceable> name (e.g., eth0.+) in
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
the INTERFACE column.</para>
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
<para>This option can also be enabled globally via the
|
<para>This option can also be enabled globally via the
|
||||||
@@ -925,11 +825,9 @@ loc eth2 -</programlisting>
|
|||||||
specified (if any) or 1 if no value is given.</para>
|
specified (if any) or 1 if no value is given.</para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>This option does not work with a wild-card <emphasis
|
<para>This option does not work with a wild-card
|
||||||
role="bold">physical</emphasis> name (e.g., eth0.+).
|
<replaceable>interface</replaceable> name (e.g., eth0.+) in
|
||||||
Beginning with Shorewall 5.1.10, If this option is
|
the INTERFACE column.</para>
|
||||||
specified, a warning is issued and the option is
|
|
||||||
ignored.</para>
|
|
||||||
</note>
|
</note>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -987,14 +885,11 @@ loc eth2 -</programlisting>
|
|||||||
<member><emphasis
|
<member><emphasis
|
||||||
role="bold">routefilter</emphasis></member>
|
role="bold">routefilter</emphasis></member>
|
||||||
|
|
||||||
<member><emphasis
|
|
||||||
role="bold">proxyarp</emphasis></member>
|
|
||||||
|
|
||||||
<member><emphasis
|
|
||||||
role="bold">proxyudp</emphasis></member>
|
|
||||||
|
|
||||||
<member><emphasis
|
<member><emphasis
|
||||||
role="bold">sourceroute</emphasis></member>
|
role="bold">sourceroute</emphasis></member>
|
||||||
|
|
||||||
|
<member><emphasis
|
||||||
|
role="bold">proxyndp</emphasis></member>
|
||||||
</simplelist>
|
</simplelist>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
@@ -1007,9 +902,7 @@ loc eth2 -</programlisting>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>Incoming requests from this interface may be remapped
|
<para>Incoming requests from this interface may be remapped
|
||||||
via UPNP (upnpd). See <ulink
|
via UPNP (upnpd). See <ulink
|
||||||
url="/UPnP.html">http://www.shorewall.net/UPnP.html</ulink>.
|
url="/UPnP.html">http://www.shorewall.net/UPnP.html</ulink>.</para>
|
||||||
Supported in IPv4 and in IPv6 in Shorewall 5.1.4 and
|
|
||||||
later.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -1023,8 +916,7 @@ loc eth2 -</programlisting>
|
|||||||
causes Shorewall to detect the default gateway through the
|
causes Shorewall to detect the default gateway through the
|
||||||
interface and to accept UDP packets from that gateway. Note
|
interface and to accept UDP packets from that gateway. Note
|
||||||
that, like all aspects of UPnP, this is a security hole so use
|
that, like all aspects of UPnP, this is a security hole so use
|
||||||
this option at your own risk. Supported in IPv4 and in IPv6 in
|
this option at your own risk.</para>
|
||||||
Shorewall 5.1.4 and later.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -1051,7 +943,7 @@ loc eth2 -</programlisting>
|
|||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 1:</term>
|
<term>Example 1:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Suppose you have eth0 connected to a DSL modem and eth1
|
<para>Suppose you have eth0 connected to a DSL modem and eth1
|
||||||
@@ -1064,7 +956,7 @@ loc eth2 -</programlisting>
|
|||||||
|
|
||||||
<para>Your entries for this setup would look like:</para>
|
<para>Your entries for this setup would look like:</para>
|
||||||
|
|
||||||
<programlisting>?FORMAT 1
|
<programlisting>FORMAT 1
|
||||||
#ZONE INTERFACE BROADCAST OPTIONS
|
#ZONE INTERFACE BROADCAST OPTIONS
|
||||||
net eth0 206.191.149.223 dhcp
|
net eth0 206.191.149.223 dhcp
|
||||||
loc eth1 192.168.1.255
|
loc eth1 192.168.1.255
|
||||||
@@ -1079,7 +971,7 @@ dmz eth2 192.168.2.255</programlisting>
|
|||||||
<para>The same configuration without specifying broadcast addresses
|
<para>The same configuration without specifying broadcast addresses
|
||||||
is:</para>
|
is:</para>
|
||||||
|
|
||||||
<programlisting>?FORMAT 2
|
<programlisting>FORMAT 2
|
||||||
#ZONE INTERFACE OPTIONS
|
#ZONE INTERFACE OPTIONS
|
||||||
net eth0 dhcp
|
net eth0 dhcp
|
||||||
loc eth1
|
loc eth1
|
||||||
@@ -1094,7 +986,7 @@ dmz eth2</programlisting>
|
|||||||
<para>You have a simple dial-in system with no Ethernet
|
<para>You have a simple dial-in system with no Ethernet
|
||||||
connections.</para>
|
connections.</para>
|
||||||
|
|
||||||
<programlisting>?FORMAT 2
|
<programlisting>FORMAT 2
|
||||||
#ZONE INTERFACE OPTIONS
|
#ZONE INTERFACE OPTIONS
|
||||||
net ppp0 -</programlisting>
|
net ppp0 -</programlisting>
|
||||||
</listitem>
|
</listitem>
|
||||||
@@ -1107,7 +999,7 @@ net ppp0 -</programlisting>
|
|||||||
<para>You have a bridge with no IP address and you want to allow
|
<para>You have a bridge with no IP address and you want to allow
|
||||||
traffic through the bridge.</para>
|
traffic through the bridge.</para>
|
||||||
|
|
||||||
<programlisting>?FORMAT 2
|
<programlisting>FORMAT 2
|
||||||
#ZONE INTERFACE OPTIONS
|
#ZONE INTERFACE OPTIONS
|
||||||
- br0 bridge</programlisting>
|
- br0 bridge</programlisting>
|
||||||
</listitem>
|
</listitem>
|
||||||
@@ -1119,8 +1011,6 @@ net ppp0 -</programlisting>
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/interfaces</para>
|
<para>/etc/shorewall/interfaces</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/interfaces</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -1129,6 +1019,13 @@ net ppp0 -</programlisting>
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall-maclist(5),
|
||||||
|
shorewall-masq(5), shorewall-nat(5), shorewall-netmap(5),
|
||||||
|
shorewall-params(5), shorewall-policy(5), shorewall-providers(5),
|
||||||
|
shorewall-proxyarp(5), shorewall-rtrules(5), shorewall-routestopped(5),
|
||||||
|
shorewall-rules(5), shorewall.conf(5), shorewall-secmarks(5),
|
||||||
|
shorewall-tcclasses(5), shorewall-tcdevices(5), shorewall-mangle(5),
|
||||||
|
shorewall-tos(5), shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -251,44 +251,34 @@
|
|||||||
|
|
||||||
<para>/etc/shorewall/accounting</para>
|
<para>/etc/shorewall/accounting</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/accounting</para>
|
|
||||||
|
|
||||||
<para>/etc/shorewall/blrules</para>
|
<para>/etc/shorewall/blrules</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/blrules</para>
|
|
||||||
|
|
||||||
<para>/etc/shorewall/hosts -- <emphasis role="bold">Note:</emphasis>
|
<para>/etc/shorewall/hosts -- <emphasis role="bold">Note:</emphasis>
|
||||||
Multiple matches enclosed in +[...] may not be used in this file.</para>
|
Multiple matches enclosed in +[...] may not be used in this file.</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/hosts -- <emphasis role="bold">Note:</emphasis>
|
|
||||||
Multiple matches enclosed in +[...] may not be used in this file.</para>
|
|
||||||
|
|
||||||
<para>/etc/shorewall/maclist -- <emphasis role="bold">Note:</emphasis>
|
<para>/etc/shorewall/maclist -- <emphasis role="bold">Note:</emphasis>
|
||||||
Multiple matches enclosed in +[...] may not be used in this file.</para>
|
Multiple matches enclosed in +[...] may not be used in this file.</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/maclist -- <emphasis role="bold">Note:</emphasis>
|
<para>/etc/shorewall/masq</para>
|
||||||
Multiple matches enclosed in +[...] may not be used in this file.</para>
|
|
||||||
|
|
||||||
<para>/etc/shorewall/rules</para>
|
<para>/etc/shorewall/rules</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/rules</para>
|
|
||||||
|
|
||||||
<para>/etc/shorewall/secmarks</para>
|
<para>/etc/shorewall/secmarks</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/secmarks</para>
|
|
||||||
|
|
||||||
<para>/etc/shorewall/mangle</para>
|
<para>/etc/shorewall/mangle</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/mangle</para>
|
|
||||||
|
|
||||||
<para>/etc/shorewall/snat</para>
|
|
||||||
|
|
||||||
<para>/etc/shorewall6/snat</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>See ALSO</title>
|
<title>See ALSO</title>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-maclist(5), shorewall-masq(5), shorewall-nat(5),
|
||||||
|
shorewall-netmap(5), shorewall-params(5), shorewall-policy(5),
|
||||||
|
shorewall-providers(5), shorewall-proxyarp(5), shorewall-rtrules(5),
|
||||||
|
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -1,385 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
|
||||||
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
|
|
||||||
<refentry>
|
|
||||||
<refmeta>
|
|
||||||
<refentrytitle>shorewall-logging</refentrytitle>
|
|
||||||
|
|
||||||
<manvolnum>5</manvolnum>
|
|
||||||
|
|
||||||
<refmiscinfo>Configuration Files</refmiscinfo>
|
|
||||||
</refmeta>
|
|
||||||
|
|
||||||
<refnamediv>
|
|
||||||
<refname>logging</refname>
|
|
||||||
|
|
||||||
<refpurpose>Shorewall logging</refpurpose>
|
|
||||||
</refnamediv>
|
|
||||||
|
|
||||||
<refsynopsisdiv>
|
|
||||||
<cmdsynopsis>
|
|
||||||
<command><replaceable>action</replaceable>:<replaceable>level</replaceable></command>
|
|
||||||
</cmdsynopsis>
|
|
||||||
|
|
||||||
<cmdsynopsis>
|
|
||||||
<command>NFLOG(<replaceable>nflog-parameters</replaceable>)</command>
|
|
||||||
</cmdsynopsis>
|
|
||||||
|
|
||||||
<cmdsynopsis>
|
|
||||||
<command>ULOG(<replaceable>ulog-parameters</replaceable>)</command>
|
|
||||||
</cmdsynopsis>
|
|
||||||
</refsynopsisdiv>
|
|
||||||
|
|
||||||
<refsect1>
|
|
||||||
<title>Description</title>
|
|
||||||
|
|
||||||
<para>The disposition of packets entering a Shorewall firewall is
|
|
||||||
determined by one of a number of Shorewall facilities. Only some of these
|
|
||||||
facilities permit logging.</para>
|
|
||||||
|
|
||||||
<orderedlist>
|
|
||||||
<listitem>
|
|
||||||
<para>The packet is part of an established connection. While the
|
|
||||||
packet can be logged using LOG rules in the ESTABLISHED section of
|
|
||||||
<ulink
|
|
||||||
url="manpages/shorewall-rules.html">/etc/shorewall/rules</ulink>, that
|
|
||||||
is not recommended because of the large amount of information that may
|
|
||||||
be logged.</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>The packet represents a connection request that is related to an
|
|
||||||
established connection (such as a <ulink url="FTP.html">data
|
|
||||||
connection associated with an FTP control connection</ulink>). These
|
|
||||||
packets may be logged using LOG rules in the RELATED section of <ulink
|
|
||||||
url="manpages/shorewall-rules.html">shorewall-rules(5)</ulink>.</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>The packet is rejected because of an option in <ulink
|
|
||||||
url="manpages/shorewall.conf.html">shorewall.conf</ulink>(5) or <ulink
|
|
||||||
url="manpages/shorewall-interfaces.html">shorewall-interfaces(5)</ulink>.
|
|
||||||
These packets can be logged by setting the appropriate logging-related
|
|
||||||
option in <ulink
|
|
||||||
url="manpages/shorewall.conf.html">/etc/shorewall/shorewall.conf</ulink>.</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>The packet matches a rule in <ulink
|
|
||||||
url="manpages/shorewall-rules.html">shorewall-rules</ulink>(5). By
|
|
||||||
including a syslog level (see below) in the ACTION column of a rule
|
|
||||||
(e.g., <quote>ACCEPT<emphasis role="bold">:info</emphasis> net $FW tcp
|
|
||||||
22</quote>), the connection attempt will be logged at that
|
|
||||||
level.</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>The packet doesn't match a rule so it is handled by a policy
|
|
||||||
defined in <ulink
|
|
||||||
url="manpages/shorewall-policy.html">shorewall-policy(5)</ulink>.
|
|
||||||
These may be logged by specifying a syslog level in the LOG LEVEL
|
|
||||||
column of the policy's entry (e.g., <quote>loc net ACCEPT <emphasis
|
|
||||||
role="bold">info</emphasis></quote>).</para>
|
|
||||||
</listitem>
|
|
||||||
</orderedlist>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<refsect1>
|
|
||||||
<title>Default Logging</title>
|
|
||||||
|
|
||||||
<para>By default, Shorewall directs Netfilter to log using syslog (8).
|
|
||||||
Syslog classifies log messages by a <emphasis>facility</emphasis> and a
|
|
||||||
<emphasis>priority</emphasis> (using the notation
|
|
||||||
<emphasis>facility.priority</emphasis>).</para>
|
|
||||||
|
|
||||||
<para>The facilities defined by syslog are <emphasis>auth, authpriv, cron,
|
|
||||||
daemon, kern, lpr, mail, mark, news, syslog, user, uucp</emphasis> and
|
|
||||||
<emphasis>local0</emphasis> through <emphasis>local7.</emphasis></para>
|
|
||||||
|
|
||||||
<para>Throughout the Shorewall documentation, the term
|
|
||||||
<emphasis>level</emphasis> rather than <emphasis>priority is used,
|
|
||||||
</emphasis>since <emphasis>level</emphasis> is the term used by Netfilter.
|
|
||||||
The syslog documentation uses the term
|
|
||||||
<emphasis>priority</emphasis>.</para>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<refsect1>
|
|
||||||
<title>Syslog Levels</title>
|
|
||||||
|
|
||||||
<para>Syslog levels are a method of describing to syslog (8) the
|
|
||||||
importance of a message. A number of Shorewall parameters have a syslog
|
|
||||||
level as their value.</para>
|
|
||||||
|
|
||||||
<para>Valid levels are:</para>
|
|
||||||
|
|
||||||
<simplelist>
|
|
||||||
<member>7 - <emphasis role="bold">debug</emphasis> (Debug-level
|
|
||||||
messages)</member>
|
|
||||||
|
|
||||||
<member>6 - <emphasis role="bold">info</emphasis>
|
|
||||||
(Informational)</member>
|
|
||||||
|
|
||||||
<member>5 - <emphasis role="bold">notice</emphasis> (Normal but
|
|
||||||
significant Condition)</member>
|
|
||||||
|
|
||||||
<member>4 - <emphasis role="bold">warning</emphasis> (Warning
|
|
||||||
Condition)</member>
|
|
||||||
|
|
||||||
<member>3 - <emphasis role="bold">err</emphasis> (Error
|
|
||||||
Condition)</member>
|
|
||||||
|
|
||||||
<member>2 - <emphasis role="bold">crit</emphasis> (Critical
|
|
||||||
Conditions)</member>
|
|
||||||
|
|
||||||
<member>1 - <emphasis role="bold">alert</emphasis> (must be handled
|
|
||||||
immediately)</member>
|
|
||||||
|
|
||||||
<member>0 - <emphasis role="bold">emerg</emphasis> (System is
|
|
||||||
unusable)</member>
|
|
||||||
</simplelist>
|
|
||||||
|
|
||||||
<para>For most Shorewall logging, a level of 6 (info) is appropriate.
|
|
||||||
Shorewall log messages are generated by Netfilter and are logged using the
|
|
||||||
<emphasis>kern</emphasis> facility and the level that you specify. If you
|
|
||||||
are unsure of the level to choose, 6 (info) is a safe bet. You may specify
|
|
||||||
levels by name or by number.</para>
|
|
||||||
|
|
||||||
<para>Beginning with Shorewall 4.5.5, the <replaceable>level</replaceable>
|
|
||||||
name or number may be optionally followed by a comma-separated list of one
|
|
||||||
or more<replaceable> log options</replaceable>. The list is enclosed in
|
|
||||||
parentheses. Log options cause additional information to be included in
|
|
||||||
each log message.</para>
|
|
||||||
|
|
||||||
<para>Valid log options are:</para>
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">ip_options</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Log messages will include the option settings from the IP
|
|
||||||
header.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">macdecode</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Decode the MAC address and protocol.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">tcp_sequence</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Include TCP sequence numbers.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">tcp_options</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Include options from the TCP header.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">uid</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Include the UID of the sending program; only valid for packets
|
|
||||||
originating on the firewall itself.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
|
|
||||||
<para>Example: <emphasis
|
|
||||||
role="bold">info(tcp_options,tcp_sequence)</emphasis></para>
|
|
||||||
|
|
||||||
<para>Syslogd writes log messages to files (typically in <filename
|
|
||||||
class="directory">/var/log/</filename>*) based on their facility and
|
|
||||||
level. The mapping of these facility/level pairs to log files is done in
|
|
||||||
/etc/syslog.conf (5). If you make changes to this file, you must restart
|
|
||||||
syslogd before the changes can take effect.</para>
|
|
||||||
|
|
||||||
<para>Syslog may also write to your system console. See <ulink
|
|
||||||
url="FAQ.htm#faq16">Shorewall FAQ 16</ulink> for ways to avoid having
|
|
||||||
Shorewall messages written to the console.</para>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<refsect1>
|
|
||||||
<title>Configuring a Separate Log for Shorewall Messages (ulogd)</title>
|
|
||||||
|
|
||||||
<para>There are a couple of limitations to syslogd-based logging:</para>
|
|
||||||
|
|
||||||
<orderedlist>
|
|
||||||
<listitem>
|
|
||||||
<para>If you give, for example, kern.info its own log destination then
|
|
||||||
that destination will also receive all kernel messages of levels 5
|
|
||||||
(notice) through 0 (emerg).</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>All kernel.info messages will go to that destination and not
|
|
||||||
just those from Netfilter.</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Netfilter (Shorewall) messages show up in
|
|
||||||
<command>dmesg</command>.</para>
|
|
||||||
</listitem>
|
|
||||||
</orderedlist>
|
|
||||||
|
|
||||||
<para>If your kernel has NFLOG target support (and most vendor-supplied
|
|
||||||
kernels do), you may also specify a log level of NFLOG (must be all caps).
|
|
||||||
When NFLOG is used, Shorewall will direct Netfilter to log the related
|
|
||||||
messages via the NFLOG target which will send them to a process called
|
|
||||||
<quote>ulogd</quote>. The ulogd program is included in most
|
|
||||||
distributions.</para>
|
|
||||||
|
|
||||||
<note>
|
|
||||||
<para>The NFLOG logging mechanism is <emphasis
|
|
||||||
role="underline">completely separate</emphasis> from syslog. Once you
|
|
||||||
switch to NFLOG, the settings in <filename>/etc/syslog.conf</filename>
|
|
||||||
have absolutely no effect on your Shorewall logging (except for
|
|
||||||
Shorewall status messages which still go to syslog).</para>
|
|
||||||
</note>
|
|
||||||
|
|
||||||
<para>You will need to change all instances of log levels (usually
|
|
||||||
<quote>info</quote>) in your Shorewall configuration files to
|
|
||||||
<quote>NFLOG</quote> - this includes entries in the policy, rules and
|
|
||||||
shorewall.conf files. If you initially installed using Shorewall 5.1.2 or
|
|
||||||
later, you can simply change the setting of LOG_LEVEL in
|
|
||||||
shorewall.conf.</para>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<refsect1>
|
|
||||||
<title>Understanding the Contents of Shorewall Log Messages</title>
|
|
||||||
|
|
||||||
<para>For general information on the contents of Netfilter log messages,
|
|
||||||
see <ulink
|
|
||||||
url="http://logi.cc/en/2010/07/netfilter-log-format/">http://logi.cc/en/2010/07/netfilter-log-format/</ulink>.</para>
|
|
||||||
|
|
||||||
<para>For Shorewall-specific information, see <ulink
|
|
||||||
url="/FAQ.htm#faq17">FAQ #17</ulink>.</para>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<refsect1>
|
|
||||||
<title>Customizing the Content of Shorewall Log Messages</title>
|
|
||||||
|
|
||||||
<para>In a Shorewall logging rule, the log level can be followed by a
|
|
||||||
<firstterm>log tag</firstterm> as in "DROP:NFLOG:junk". The generated log
|
|
||||||
message will include "<emphasis>chain-name</emphasis> junk DROP".</para>
|
|
||||||
|
|
||||||
<para>By setting the LOGTAGONLY option to Yes in <ulink
|
|
||||||
url="/manpages/shorewall.conf.html">shorewall.conf(5)</ulink> or <ulink
|
|
||||||
url="/manpages6/shorewall6.conf.html">shorewall6.conf(5)</ulink>, the
|
|
||||||
disposition ('DROP' in the above example) will be omitted. Consider the
|
|
||||||
following rule:</para>
|
|
||||||
|
|
||||||
<programlisting>#ACTION SOURCE DEST PROTO
|
|
||||||
REJECT(icmp-proto-unreachable):notice:IPv6 loc net 41 # who's using IPv6 tunneling</programlisting>
|
|
||||||
|
|
||||||
<para>This rule generates the following warning at compile time:</para>
|
|
||||||
|
|
||||||
<simplelist>
|
|
||||||
<member>WARNING: Log Prefix shortened to "Shorewall:IPv6:REJECT(icmp-p "
|
|
||||||
/etc/shorewall/rules (line 212)</member>
|
|
||||||
</simplelist>
|
|
||||||
|
|
||||||
<para>and produces the rather ugly prefix "Shorewall:IPv6:REJECT(icmp-p
|
|
||||||
".</para>
|
|
||||||
|
|
||||||
<para>Now consider this similar rule:</para>
|
|
||||||
|
|
||||||
<programlisting>#ACTION SOURCE DEST PROTO
|
|
||||||
REJECT(icmp-proto-unreachable):notice:IPv6,tunneling loc net 41 # who's using IPv6 tunneling</programlisting>
|
|
||||||
|
|
||||||
<para>With LOGTAGONLY=Yes, no warning is generated and the prefix becomes
|
|
||||||
"Shorewall:IPv6:tunneling:"</para>
|
|
||||||
|
|
||||||
<para>See the <ulink url="shorewall.conf.html">shorewall[6].conf man
|
|
||||||
page</ulink> for further information about how LOGTAGONLY=Yes can be
|
|
||||||
used.</para>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<refsect1>
|
|
||||||
<title>Log Backends</title>
|
|
||||||
|
|
||||||
<para>Netfilter logging allows configuration of multiple backends. Logging
|
|
||||||
backends provide the The low-level forward of log messages. There are
|
|
||||||
currently three backends:</para>
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>LOG (ipt_LOG and ip6t_LOG).</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Normal kernel-based logging to a syslog daemon.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>ULOG (ipt_ULOG)</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>ULOG logging as described ablve. Only available for
|
|
||||||
IPv4.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>netlink (nfnetlink_log)</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>The logging backend behind NFLOG, defined above.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
|
|
||||||
<para>The currently-available and currently-selected IPv4 and IPv6
|
|
||||||
backends are shown in /proc/sys/net/netfilter/nf_log:</para>
|
|
||||||
|
|
||||||
<programlisting>cat /proc/net/netfilter/nf_log
|
|
||||||
0 NONE (nfnetlink_log)
|
|
||||||
1 NONE (nfnetlink_log)
|
|
||||||
2 ipt_ULOG (ipt_ULOG,ipt_LOG,nfnetlink_log)
|
|
||||||
3 NONE (nfnetlink_log)
|
|
||||||
4 NONE (nfnetlink_log)
|
|
||||||
5 NONE (nfnetlink_log)
|
|
||||||
6 NONE (nfnetlink_log)
|
|
||||||
7 NONE (nfnetlink_log)
|
|
||||||
8 NONE (nfnetlink_log)
|
|
||||||
9 NONE (nfnetlink_log)
|
|
||||||
10 ip6t_LOG (ip6t_LOG,nfnetlink_log)
|
|
||||||
11 NONE (nfnetlink_log)
|
|
||||||
12 NONE (nfnetlink_log)</programlisting>
|
|
||||||
|
|
||||||
<para>The magic numbers (0-12) are Linux address family numbers (AF_INET
|
|
||||||
is 2 and AF_INET6 is 10).</para>
|
|
||||||
|
|
||||||
<para>The name immediately following the number is the currently-selected
|
|
||||||
backend, and the ones in parentheses are the ones that are available. You
|
|
||||||
can change the currently selected backend by echoing it's name into
|
|
||||||
/proc/net/netfilter/nf_log.<replaceable>number</replaceable>.</para>
|
|
||||||
|
|
||||||
<para>Example - change the IPv4 backend to LOG:</para>
|
|
||||||
|
|
||||||
<programlisting>sysctl net.netfilter.nf_log.2=ipt_LOG</programlisting>
|
|
||||||
|
|
||||||
<para>Beginning with Shorewall 4.6.4, you can configure the backend using
|
|
||||||
the LOG_BACKEND option in <ulink
|
|
||||||
url="manpages/shorewall.conf.html">shorewall.conf(5)</ulink> and <ulink
|
|
||||||
url="manpages6/shorewall6.conf.html">shorewall6.conf(5)</ulink>.</para>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<refsect1>
|
|
||||||
<title>SEE ALSO</title>
|
|
||||||
|
|
||||||
<para><ulink
|
|
||||||
url="/shorewall_logging.htm">http://www.shorewall.net/shorewall_logging.html</ulink></para>
|
|
||||||
</refsect1>
|
|
||||||
</refentry>
|
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/maclist</command>
|
<command>/etc/shorewall/maclist</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -97,8 +97,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/maclist</para>
|
<para>/etc/shorewall/maclist</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/maclist</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -110,6 +108,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-masq(5), shorewall-nat(5),
|
||||||
|
shorewall-netmap(5), shorewall-params(5), shorewall-policy(5),
|
||||||
|
shorewall-providers(5), shorewall-proxyarp(5), shorewall-rtrules(5),
|
||||||
|
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,17 +18,31 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/mangle</command>
|
<command>/etc/shorewall/mangle</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
|
|
||||||
<para>This file was introduced in Shorewall 4.6.0 and replaces <ulink
|
<para>This file was introduced in Shorewall 4.6.0 and is intended to
|
||||||
|
replace <ulink
|
||||||
url="/manpages/shorewall-tcrules.html">shorewall-tcrules(5)</ulink>. This
|
url="/manpages/shorewall-tcrules.html">shorewall-tcrules(5)</ulink>. This
|
||||||
file is only processed by the compiler if:</para>
|
file is only processed by the compiler if:</para>
|
||||||
|
|
||||||
|
<orderedlist numeration="loweralpha">
|
||||||
|
<listitem>
|
||||||
|
<para>No file named 'tcrules' exists on the current CONFIG_PATH (see
|
||||||
|
<ulink url="/manpages/shorewall.conf.html">shorewall.conf(5)</ulink>);
|
||||||
|
or</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>The first file named 'tcrules' found on the CONFIG_PATH contains
|
||||||
|
no non-commentary entries.</para>
|
||||||
|
</listitem>
|
||||||
|
</orderedlist>
|
||||||
|
|
||||||
<para>Entries in this file cause packets to be marked as a means of
|
<para>Entries in this file cause packets to be marked as a means of
|
||||||
classifying them for traffic control or policy routing.</para>
|
classifying them for traffic control or policy routing.</para>
|
||||||
|
|
||||||
@@ -103,7 +117,9 @@
|
|||||||
SOURCE is $FW, the generated rule is always placed in the OUTPUT
|
SOURCE is $FW, the generated rule is always placed in the OUTPUT
|
||||||
chain. If DEST is '$FW', then the rule is placed in the INPUT chain.
|
chain. If DEST is '$FW', then the rule is placed in the INPUT chain.
|
||||||
Additionally, a <replaceable>chain-designator</replaceable> may not
|
Additionally, a <replaceable>chain-designator</replaceable> may not
|
||||||
be specified in an action body.</para>
|
be specified in an action body unless the action is declared as
|
||||||
|
<option>inline</option> in <ulink
|
||||||
|
url="/manpages6/shorewall6-actions.html">shorewall-actions</ulink>(5).</para>
|
||||||
|
|
||||||
<para>Where a command takes parameters, those parameters are
|
<para>Where a command takes parameters, those parameters are
|
||||||
enclosed in parentheses ("(....)") and separated by commas.</para>
|
enclosed in parentheses ("(....)") and separated by commas.</para>
|
||||||
@@ -349,9 +365,8 @@ DIVERTHA - - tcp</programlisting>
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Added in Shorewall 5.0.6 as an alternative to entries in
|
<para>Added in Shorewall 5.0.6 as an alternative to entries in
|
||||||
<ulink
|
<ulink url="/manpages/shorewall-ecn.html">shorewall-ecn(5)</ulink>. If a
|
||||||
url="/manpages/shorewall-ecn.html">shorewall-ecn(5)</ulink>.
|
PROTO is specified, it must be 'tcp' (6). If no PROTO is
|
||||||
If a PROTO is specified, it must be 'tcp' (6). If no PROTO is
|
|
||||||
supplied, TCP is assumed. This action causes all ECN bits in
|
supplied, TCP is assumed. This action causes all ECN bits in
|
||||||
the TCP header to be cleared.</para>
|
the TCP header to be cleared.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@@ -674,43 +689,6 @@ SAME $FW 0.0.0.0/0 tcp 80,443</programlisting>
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis
|
|
||||||
role="bold">TCPMSS</emphasis>([<replaceable>mss</replaceable>[,<replaceable>ipsec</replaceable>]])</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Added in Shorewall 5.1.9. This target only applies to
|
|
||||||
TCP traffic and alters the MSS value in SYN packets. It may be
|
|
||||||
used in the FORWARD and POSTROUTING chains; the default is
|
|
||||||
FORWARD.</para>
|
|
||||||
|
|
||||||
<para>The <replaceable>mss</replaceable> parameter may be
|
|
||||||
either <option>pmtu</option> or an integer in the range
|
|
||||||
500:65533. The value <option>pmtu</option> automatically
|
|
||||||
clamps the MSS value to (path_MTU - 40 for IPv4; -60 for
|
|
||||||
IPv6). This may not function as desired where asymmetric
|
|
||||||
routes with differing path MTU exist — the kernel uses the
|
|
||||||
path MTU which it would use to send packets from itself to the
|
|
||||||
source and destination IP addresses. Prior to Linux 2.6.25,
|
|
||||||
only the path MTU to the destination IP address was considered
|
|
||||||
by this option; subsequent kernels also consider the path MTU
|
|
||||||
to the source IP address. If an integer is given, the MSS
|
|
||||||
option is set to the specified value. If the MSS of the packet
|
|
||||||
is already lower than <replaceable>mss</replaceable>, it will
|
|
||||||
not be increased (from Linux 2.6.25 onwards) to avoid more
|
|
||||||
problems with hosts relying on a proper MSS. If
|
|
||||||
<replaceable>mss</replaceable> is omitted,
|
|
||||||
<option>pmtu</option> is assumed.</para>
|
|
||||||
|
|
||||||
<para>The <replaceable>ipsec</replaceable> parameter
|
|
||||||
determines whether the rule applies to IPSEC traffic
|
|
||||||
(<option>ipsec</option> is passed), non-IPSEC traffic
|
|
||||||
(<option>none</option> is passed) or both
|
|
||||||
(<option>all</option> is passed). If omitted,
|
|
||||||
<option>all</option> is assumed.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis
|
<term><emphasis
|
||||||
role="bold">TOS</emphasis>(<replaceable>tos</replaceable>[/<replaceable>mask</replaceable>])</term>
|
role="bold">TOS</emphasis>(<replaceable>tos</replaceable>[/<replaceable>mask</replaceable>])</term>
|
||||||
@@ -747,7 +725,7 @@ Normal-Service => 0x00</programlisting>
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis
|
<term><emphasis
|
||||||
role="bold">TPROXY</emphasis>([<replaceable>port</replaceable>[,<replaceable>address</replaceable>]])</term>
|
role="bold">TPROXY</emphasis>([<replaceable>port</replaceable>][,<replaceable>address</replaceable>])</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Transparently redirects a packet without altering the IP
|
<para>Transparently redirects a packet without altering the IP
|
||||||
@@ -937,8 +915,7 @@ Normal-Service => 0x00</programlisting>
|
|||||||
Matches packets leaving the firewall through the named
|
Matches packets leaving the firewall through the named
|
||||||
interface. May not be used in the PREROUTING chain (:P in the
|
interface. May not be used in the PREROUTING chain (:P in the
|
||||||
mark column or no chain qualifier and MARK_IN_FORWARD_CHAIN=No
|
mark column or no chain qualifier and MARK_IN_FORWARD_CHAIN=No
|
||||||
in <ulink
|
in <ulink url="/manpages/shorewall.conf">shorewall.conf</ulink>
|
||||||
url="/manpages/shorewall.conf">shorewall.conf</ulink>
|
|
||||||
(5)).</para>
|
(5)).</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -1566,7 +1543,7 @@ Normal-Service => 0x00</programlisting>
|
|||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 1:</term>
|
<term>Example 1:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Mark all ICMP echo traffic with packet mark 1. Mark all peer
|
<para>Mark all ICMP echo traffic with packet mark 1. Mark all peer
|
||||||
@@ -1595,7 +1572,7 @@ Normal-Service => 0x00</programlisting>
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 2:</term>
|
<term>Example 2:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>SNAT outgoing connections on eth0 from 192.168.1.0/24 in
|
<para>SNAT outgoing connections on eth0 from 192.168.1.0/24 in
|
||||||
@@ -1607,41 +1584,12 @@ Normal-Service => 0x00</programlisting>
|
|||||||
#ACTION SOURCE DEST PROTO DPORT SPORT USER TEST
|
#ACTION SOURCE DEST PROTO DPORT SPORT USER TEST
|
||||||
CONNMARK(1-3):F 192.168.1.0/24 eth0 ; state=NEW
|
CONNMARK(1-3):F 192.168.1.0/24 eth0 ; state=NEW
|
||||||
|
|
||||||
/etc/shorewall/snat:
|
/etc/shorewall/masq:
|
||||||
|
|
||||||
#ACTION SOURCE DEST ...
|
#INTERFACE SOURCE ADDRESS ...
|
||||||
SNAT(1.1.1.1) eth0:192.168.1.0/24 - { mark=1:C }
|
eth0 192.168.1.0/24 1.1.1.1 ; mark=1:C
|
||||||
SNAT(1.1.1.3) eth0:192.168.1.0/24 - { mark=2:C }
|
eth0 192.168.1.0/24 1.1.1.3 ; mark=2:C
|
||||||
SNAT(1.1.1.4) eth0:192.168.1.0/24 - { mark=3:C }</programlisting>
|
eth0 192.168.1.0/24 1.1.1.4 ; mark=3:C</programlisting>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>IPv6 Example 1:</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Mark all ICMP echo traffic with packet mark 1. Mark all peer
|
|
||||||
to peer traffic with packet mark 4.</para>
|
|
||||||
|
|
||||||
<para>This is a little more complex than otherwise expected. Since
|
|
||||||
the ipp2p module is unable to determine all packets in a connection
|
|
||||||
are P2P packets, we mark the entire connection as P2P if any of the
|
|
||||||
packets are determined to match.</para>
|
|
||||||
|
|
||||||
<para>We assume packet/connection mark 0 means unclassified.</para>
|
|
||||||
|
|
||||||
<programlisting> #ACTION SOURCE DEST PROTO DPORT SPORT USER TEST
|
|
||||||
MARK(1):T ::/0 ::/0 icmp echo-request
|
|
||||||
MARK(1):T ::/0 ::/0 icmp echo-reply
|
|
||||||
RESTORE:T ::/0 ::/0 all - - - 0
|
|
||||||
CONTINUE:T ::/0 ::/0 all - - - !0
|
|
||||||
MARK(4):T ::/0 ::/0 ipp2p:all
|
|
||||||
SAVE:T ::/0 ::/0 all - - - !0</programlisting>
|
|
||||||
|
|
||||||
<para>If a packet hasn't been classified (packet mark is 0), copy
|
|
||||||
the connection mark to the packet mark. If the packet mark is set,
|
|
||||||
we're done. If the packet is P2P, set the packet mark to 4. If the
|
|
||||||
packet mark has been set, save it to the connection mark.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
@@ -1651,8 +1599,6 @@ Normal-Service => 0x00</programlisting>
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/mangle</para>
|
<para>/etc/shorewall/mangle</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/mangle</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -1670,6 +1616,14 @@ Normal-Service => 0x00</programlisting>
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-ecn(5), shorewall-exclusion(5),
|
||||||
|
shorewall-hosts(5), shorewall_interfaces(5), shorewall-ipsets(5),
|
||||||
|
shorewall-maclist(5), shorewall-masq(5), shorewall-nat(5),
|
||||||
|
shorewall-netmap(5), shorewall-params(5), shorewall-policy(5),
|
||||||
|
shorewall-providers(5), shorewall-proxyarp(5), shorewall-rtrules(5),
|
||||||
|
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-tos(5), shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/masq</command>
|
<command>/etc/shorewall/masq</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -579,7 +579,7 @@
|
|||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 1:</term>
|
<term>Example 1:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You have a simple masquerading setup where eth0 connects to a
|
<para>You have a simple masquerading setup where eth0 connects to a
|
||||||
@@ -594,7 +594,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 2:</term>
|
<term>Example 2:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You add a router to your local network to connect subnet
|
<para>You add a router to your local network to connect subnet
|
||||||
@@ -607,7 +607,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 3:</term>
|
<term>Example 3:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You have an IPSEC tunnel through ipsec0 and you want to
|
<para>You have an IPSEC tunnel through ipsec0 and you want to
|
||||||
@@ -620,7 +620,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 4:</term>
|
<term>Example 4:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You want all outgoing traffic from 192.168.1.0/24 through eth0
|
<para>You want all outgoing traffic from 192.168.1.0/24 through eth0
|
||||||
@@ -634,7 +634,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 5:</term>
|
<term>Example 5:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You want all outgoing SMTP traffic entering the firewall from
|
<para>You want all outgoing SMTP traffic entering the firewall from
|
||||||
@@ -654,7 +654,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 6:</term>
|
<term>Example 6:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Connections leaving on eth0 and destined to any host defined
|
<para>Connections leaving on eth0 and destined to any host defined
|
||||||
@@ -667,7 +667,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 7:</term>
|
<term>Example 7:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>SNAT outgoing connections on eth0 from 192.168.1.0/24 in
|
<para>SNAT outgoing connections on eth0 from 192.168.1.0/24 in
|
||||||
@@ -689,7 +689,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 8:</term>
|
<term>Example 8:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Your eth1 has two public IP addresses: 70.90.191.121 and
|
<para>Your eth1 has two public IP addresses: 70.90.191.121 and
|
||||||
@@ -716,49 +716,6 @@
|
|||||||
</programlisting>
|
</programlisting>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>IPv6 Example 1:</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>You have a simple 'masquerading' setup where eth0 connects to
|
|
||||||
a DSL or cable modem and eth1 connects to your local network with
|
|
||||||
subnet 2001:470:b:787::0/64</para>
|
|
||||||
|
|
||||||
<para>Your entry in the file will be:</para>
|
|
||||||
|
|
||||||
<programlisting> #INTERFACE SOURCE ADDRESS
|
|
||||||
eth0 2001:470:b:787::0/64 -</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>IPv6 Example 2:</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Your sit1 interface has two public IP addresses:
|
|
||||||
2001:470:a:227::1 and 2001:470:b:227::1. You want to use the
|
|
||||||
iptables statistics match to masquerade outgoing connections evenly
|
|
||||||
between these two addresses.</para>
|
|
||||||
|
|
||||||
<programlisting>/etc/shorewall/masq:
|
|
||||||
|
|
||||||
#INTERFACE SOURCE ADDRESS
|
|
||||||
INLINE(sit1) ::/0 2001:470:a:227::1 ; -m statistic --mode random --probability 0.50
|
|
||||||
sit1 ::/0 2001:470:a:227::2
|
|
||||||
</programlisting>
|
|
||||||
|
|
||||||
<para>If INLINE_MATCHES=Yes in <ulink
|
|
||||||
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5),
|
|
||||||
then these rules may be specified as follows:</para>
|
|
||||||
|
|
||||||
<programlisting>/etc/shorewall/masq:
|
|
||||||
|
|
||||||
#INTERFACE SOURCE ADDRESS
|
|
||||||
sit1 ::/0 2001:470:a:227::1 ; -m statistic --mode random --probability 0.50
|
|
||||||
sit1 ::/0 2001:470:a:227::2</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
@@ -766,8 +723,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/masq</para>
|
<para>/etc/shorewall/masq</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/masq</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -776,6 +731,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-exclusion(5), shorewall-hosts(5),
|
||||||
|
shorewall_interfaces(5), shorewall-ipsets(5), shorewall-maclist(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcclasses(5),
|
||||||
|
shorewall-tcdevices(5), shorewall-mangle(5), shorewall-tos(5),
|
||||||
|
shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,11 +18,11 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/usr/share/shorewall[6]/modules</command>
|
<command>/usr/share/shorewall/modules</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
|
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/usr/share/shorewall[6]/helpers</command>
|
<command>/usr/share/shorewall/helpers</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
<para>The <replaceable>modulename</replaceable> names a kernel module
|
<para>The <replaceable>modulename</replaceable> names a kernel module
|
||||||
(without suffix). Shorewall will search for modules based on your
|
(without suffix). Shorewall will search for modules based on your
|
||||||
MODULESDIR setting in <ulink
|
MODULESDIR and MODULE_SUFFIX settings in <ulink
|
||||||
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(8). The
|
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(8). The
|
||||||
<replaceable>moduleoption</replaceable>s are passed to modprobe (if
|
<replaceable>moduleoption</replaceable>s are passed to modprobe (if
|
||||||
installed) or to insmod.</para>
|
installed) or to insmod.</para>
|
||||||
@@ -82,19 +82,19 @@
|
|||||||
<para>/etc/shorewall/modules</para>
|
<para>/etc/shorewall/modules</para>
|
||||||
|
|
||||||
<para>/etc/shorewall/helpers</para>
|
<para>/etc/shorewall/helpers</para>
|
||||||
|
|
||||||
<para>/usr/share/shorewall6/modules</para>
|
|
||||||
|
|
||||||
<para>/usr/share/shorewall6/helpers</para>
|
|
||||||
|
|
||||||
<para>/etc/shorewall6/modules</para>
|
|
||||||
|
|
||||||
<para>/etc/shorewall6/helpers</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>See ALSO</title>
|
<title>See ALSO</title>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcclasses(5),
|
||||||
|
shorewall-tcdevices(5), shorewall-mangle(5), shorewall-tos(5),
|
||||||
|
shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -34,8 +34,6 @@
|
|||||||
url="/FAQ.htm#faq1">http://www.shorewall.net/FAQ.htm#faq1</ulink>. Also,
|
url="/FAQ.htm#faq1">http://www.shorewall.net/FAQ.htm#faq1</ulink>. Also,
|
||||||
in many cases, Proxy ARP (<ulink
|
in many cases, Proxy ARP (<ulink
|
||||||
url="/manpages/shorewall-proxyarp.html">shorewall-proxyarp</ulink>(5))
|
url="/manpages/shorewall-proxyarp.html">shorewall-proxyarp</ulink>(5))
|
||||||
or Proxy-NDP(<ulink
|
|
||||||
url="/manpages6/shorewall6-proxyndp.html">shorewall6-proxyndp</ulink>(5))
|
|
||||||
is a better solution that one-to-one NAT.</para>
|
is a better solution that one-to-one NAT.</para>
|
||||||
</warning>
|
</warning>
|
||||||
|
|
||||||
@@ -210,8 +208,6 @@ all all REJECT info
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/nat</para>
|
<para>/etc/shorewall/nat</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/nat</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -223,6 +219,14 @@ all all REJECT info
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-netmap(5), shorewall-params(5), shorewall-policy(5),
|
||||||
|
shorewall-providers(5), shorewall-proxyarp(5), shorewall-rtrules(5),
|
||||||
|
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -200,16 +200,6 @@
|
|||||||
<para>/etc/shorewall/policy</para>
|
<para>/etc/shorewall/policy</para>
|
||||||
|
|
||||||
<para>/etc/shorewall/rules</para>
|
<para>/etc/shorewall/rules</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/zones</para>
|
|
||||||
|
|
||||||
<para>/etc/shorewall6/interfaces</para>
|
|
||||||
|
|
||||||
<para>/etc/shorewall6/hosts</para>
|
|
||||||
|
|
||||||
<para>/etc/shorewall6/policy</para>
|
|
||||||
|
|
||||||
<para>/etc/shorewall6/rules</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/netmap</command>
|
<command>/etc/shorewall/netmap</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -44,6 +44,8 @@
|
|||||||
role="bold">SNAT}</emphasis></term>
|
role="bold">SNAT}</emphasis></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
|
<para>Must be DNAT or SNAT</para>
|
||||||
|
|
||||||
<para>If DNAT, traffic entering INTERFACE and addressed to NET1 has
|
<para>If DNAT, traffic entering INTERFACE and addressed to NET1 has
|
||||||
its destination address rewritten to the corresponding address in
|
its destination address rewritten to the corresponding address in
|
||||||
NET2.</para>
|
NET2.</para>
|
||||||
@@ -167,8 +169,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/netmap</para>
|
<para>/etc/shorewall/netmap</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/netmap</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -180,6 +180,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-params(5), shorewall-policy(5),
|
||||||
|
shorewall-providers(5), shorewall-proxyarp(5), shorewall-rtrules(5),
|
||||||
|
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/params</command>
|
<command>/etc/shorewall/params</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
|
|
||||||
<programlisting>NET_IF=eth0
|
<programlisting>NET_IF=eth0
|
||||||
NET_BCAST=130.252.100.255
|
NET_BCAST=130.252.100.255
|
||||||
NET_OPTIONS=routefilter</programlisting>
|
NET_OPTIONS=routefilter,norfc1918</programlisting>
|
||||||
|
|
||||||
<para>Example <ulink
|
<para>Example <ulink
|
||||||
url="/manpages/shorewall-interfaces.html">shorewall-interfaces</ulink>(5)
|
url="/manpages/shorewall-interfaces.html">shorewall-interfaces</ulink>(5)
|
||||||
@@ -119,15 +119,13 @@ net $NET_IF $NET_BCAST $NET_OPTIONS</programlisting>
|
|||||||
<para>This is the same as if the interfaces file had contained:</para>
|
<para>This is the same as if the interfaces file had contained:</para>
|
||||||
|
|
||||||
<programlisting>ZONE INTERFACE BROADCAST OPTIONS
|
<programlisting>ZONE INTERFACE BROADCAST OPTIONS
|
||||||
net eth0 130.252.100.255 routefilter</programlisting>
|
net eth0 130.252.100.255 routefilter,norfc1918</programlisting>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/params</para>
|
<para>/etc/shorewall/params</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/params</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -136,6 +134,14 @@ net eth0 130.252.100.255 routefilter</programlisting>
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Variables">http://www.shorewall.net/configuration_file_basics.htm#Variables</ulink></para>
|
url="/configuration_file_basics.htm#Variables">http://www.shorewall.net/configuration_file_basics.htm#Variables</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-policy(5),
|
||||||
|
shorewall-providers(5), shorewall-proxyarp(5), shorewall-rtrules(5),
|
||||||
|
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/policy</command>
|
<command>/etc/shorewall/policy</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -33,30 +33,25 @@
|
|||||||
<para>The order of entries in this file is important</para>
|
<para>The order of entries in this file is important</para>
|
||||||
|
|
||||||
<para>This file determines what to do with a new connection request if
|
<para>This file determines what to do with a new connection request if
|
||||||
we don't get a match from the <ulink
|
we don't get a match from the /etc/shorewall/rules file . For each
|
||||||
url="/manpages/shorewall-blrules.html">shorewall-blrules</ulink>(5) or
|
source/destination pair, the file is processed in order until a match is
|
||||||
<ulink url="/manpages/shorewall-rules.html">shorewall-rules</ulink>(5)
|
found ("all" will match any source or destination).</para>
|
||||||
files. For each source/destination pair, the file is processed in order
|
|
||||||
until a match is found ("all" will match any source or
|
|
||||||
destination).</para>
|
|
||||||
</important>
|
</important>
|
||||||
|
|
||||||
<important>
|
<important>
|
||||||
<para>Intra-zone policies are pre-defined</para>
|
<para>Intra-zone policies are pre-defined</para>
|
||||||
|
|
||||||
<para>For $FW and for all of the zones defined in <ulink
|
<para>For $FW and for all of the zones defined in /etc/shorewall/zones,
|
||||||
url="/manpages/shorewall-zones.html">shorewall-zones</ulink>(5), the
|
the POLICY for connections from the zone to itself is ACCEPT (with no
|
||||||
POLICY for connections from the zone to itself is ACCEPT (with no
|
|
||||||
logging or TCP connection rate limiting) but may be overridden by an
|
logging or TCP connection rate limiting) but may be overridden by an
|
||||||
entry in this file. The overriding entry must be explicit (specifying
|
entry in this file. The overriding entry must be explicit (specifying
|
||||||
the zone name in both SOURCE and DEST) or it must use "all+" (Shorewall
|
the zone name in both SOURCE and DEST) or it must use "all+" (Shorewall
|
||||||
4.5.17 or later).</para>
|
4.5.17 or later).</para>
|
||||||
|
|
||||||
<para>Similarly, if you have IMPLICIT_CONTINUE=Yes in <ulink
|
<para>Similarly, if you have IMPLICIT_CONTINUE=Yes in shorewall.conf,
|
||||||
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5), then the
|
then the implicit policy to/from any sub-zone is CONTINUE. These
|
||||||
implicit policy to/from any sub-zone is CONTINUE. These implicit
|
implicit CONTINUE policies may also be overridden by an explicit entry
|
||||||
CONTINUE policies may also be overridden by an explicit entry in this
|
in this file.</para>
|
||||||
file.</para>
|
|
||||||
</important>
|
</important>
|
||||||
|
|
||||||
<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
|
||||||
@@ -279,8 +274,8 @@
|
|||||||
separate log through use of ulogd (<ulink
|
separate log through use of ulogd (<ulink
|
||||||
url="http://www.netfilter.org/projects/ulogd/index.html">http://www.netfilter.org/projects/ulogd/index.html</ulink>).</para>
|
url="http://www.netfilter.org/projects/ulogd/index.html">http://www.netfilter.org/projects/ulogd/index.html</ulink>).</para>
|
||||||
|
|
||||||
<para>For a description of logging, see <ulink
|
<para>For a description of log levels, see <ulink
|
||||||
url="/shorewall_logging.html">shorewall-logging(5)</ulink>.</para>
|
url="/shorewall_logging.html">http://www.shorewall.net/shorewall_logging.html</ulink>.</para>
|
||||||
|
|
||||||
<para>If you don't want to log but need to specify the following
|
<para>If you don't want to log but need to specify the following
|
||||||
column, place "-" here.</para>
|
column, place "-" here.</para>
|
||||||
@@ -401,8 +396,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/policy</para>
|
<para>/etc/shorewall/policy</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/policy</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -411,6 +404,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcclasses(5),
|
||||||
|
shorewall-tcdevices(5), shorewall-mangle(5), shorewall-tos(5),
|
||||||
|
shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -82,11 +82,14 @@
|
|||||||
url="/manpages/shorewall-mangle.html">shorewall-mangle(5)</ulink>
|
url="/manpages/shorewall-mangle.html">shorewall-mangle(5)</ulink>
|
||||||
file to direct packets to this provider.</para>
|
file to direct packets to this provider.</para>
|
||||||
|
|
||||||
<para>If PROVIDER_OFFSET is non-zero in <ulink
|
<para>If HIGH_ROUTE_MARKS=Yes in <ulink
|
||||||
url="/manpages/shorewall.conf.html">shorewall.conf(5)</ulink>, then
|
url="/manpages/shorewall.conf.html">shorewall.conf(5)</ulink>, then
|
||||||
the value must be a multiple of 2^^PROVIDER_OFFSET. In all cases, the
|
the value must be a multiple of 256 between 256 and 65280 or their
|
||||||
number of significant bits may not exceed PROVIDER_OFFSET +
|
hexadecimal equivalents (0x0100 and 0xff00 with the low-order byte
|
||||||
PROVIDER_BITS.</para>
|
of the value being zero). Otherwise, the value must be between 1 and
|
||||||
|
255. Each provider must be assigned a unique mark value. This column
|
||||||
|
may be omitted if you don't use packet marking to direct connections
|
||||||
|
to a particular provider.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -113,9 +116,9 @@
|
|||||||
listed in <ulink
|
listed in <ulink
|
||||||
url="/manpages/shorewall-interfaces.html">shorewall-interfaces(5)</ulink>.
|
url="/manpages/shorewall-interfaces.html">shorewall-interfaces(5)</ulink>.
|
||||||
In general, that interface should not have the
|
In general, that interface should not have the
|
||||||
<option>proxyarp</option> or <option>proxyndp</option> option
|
<option>proxyarp</option> option specified unless
|
||||||
specified unless <option>loose</option> is given in the OPTIONS
|
<option>loose</option> is given in the OPTIONS column of this
|
||||||
column of this entry.</para>
|
entry.</para>
|
||||||
|
|
||||||
<para>Where more than one provider is serviced through a single
|
<para>Where more than one provider is serviced through a single
|
||||||
interface, the <emphasis>interface</emphasis> must be followed by a
|
interface, the <emphasis>interface</emphasis> must be followed by a
|
||||||
@@ -214,14 +217,7 @@
|
|||||||
BALANCE_PROVIDERS=Yes, <option>balance=1</option> is assumed
|
BALANCE_PROVIDERS=Yes, <option>balance=1</option> is assumed
|
||||||
unless the <option>fallback</option>, <option>loose</option>,
|
unless the <option>fallback</option>, <option>loose</option>,
|
||||||
<option>load</option> or <option>tproxy</option> option is
|
<option>load</option> or <option>tproxy</option> option is
|
||||||
specified.I</para>
|
specified.</para>
|
||||||
|
|
||||||
<caution>
|
|
||||||
<para>In IPV6, the <option>balance</option> option does not
|
|
||||||
cause balanced default routes to be created; it rather
|
|
||||||
causes a sequence of default routes with different metrics
|
|
||||||
to be created.</para>
|
|
||||||
</caution>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -344,14 +340,6 @@
|
|||||||
<para>Prior to Shorewall 4.4.24, the option is ignored with a
|
<para>Prior to Shorewall 4.4.24, the option is ignored with a
|
||||||
warning message if USE_DEFAULT_RT=Yes in
|
warning message if USE_DEFAULT_RT=Yes in
|
||||||
<filename>shorewall.conf</filename>.</para>
|
<filename>shorewall.conf</filename>.</para>
|
||||||
|
|
||||||
<caution>
|
|
||||||
<para>In IPV6, specifying the <option>fallback</option>
|
|
||||||
option on multiple providers does not cause balanced
|
|
||||||
fallback routes to be created; it rather causes a sequence
|
|
||||||
of fallback routes with different metrics to be
|
|
||||||
created.</para>
|
|
||||||
</caution>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -438,14 +426,6 @@
|
|||||||
<command>enable</command> and <command>reenable</command>
|
<command>enable</command> and <command>reenable</command>
|
||||||
commands can reenable the provider.</para>
|
commands can reenable the provider.</para>
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
<important>
|
|
||||||
<para>RESTORE_DEFAULT_OPTION=Yes in shorewall[6].conf is not
|
|
||||||
recommended when the <option>persistent</option> option is
|
|
||||||
used, as restoring default routes to the main routing table
|
|
||||||
can prevent link status monitors such as foolsm from
|
|
||||||
correctly detecting non-working providers.</para>
|
|
||||||
</important>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
@@ -481,7 +461,7 @@
|
|||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 1:</term>
|
<term>Example 1:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You run squid in your DMZ on IP address 192.168.2.99. Your DMZ
|
<para>You run squid in your DMZ on IP address 192.168.2.99. Your DMZ
|
||||||
@@ -493,7 +473,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 2:</term>
|
<term>Example 2:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>eth0 connects to ISP 1. The IP address of eth0 is
|
<para>eth0 connects to ISP 1. The IP address of eth0 is
|
||||||
@@ -511,36 +491,6 @@
|
|||||||
ISP2 2 2 main eth1 130.252.99.254 track,balance eth2</programlisting>
|
ISP2 2 2 main eth1 130.252.99.254 track,balance eth2</programlisting>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>IPv6 Example 1:</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>You run squid in your DMZ on IP address 2002:ce7c:92b4:1::2.
|
|
||||||
Your DMZ interface is eth2</para>
|
|
||||||
|
|
||||||
<programlisting> #NAME NUMBER MARK DUPLICATE INTERFACE GATEWAY OPTIONS
|
|
||||||
Squid 1 1 - eth2 2002:ce7c:92b4:1::2 -</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>IPv6 Example 2:</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>eth0 connects to ISP 1. The ISP's gateway router has IP
|
|
||||||
address 2001:ce7c:92b4:1::2.</para>
|
|
||||||
|
|
||||||
<para>eth1 connects to ISP 2. The ISP's gateway router has IP
|
|
||||||
address 2001:d64c:83c9:12::8b.</para>
|
|
||||||
|
|
||||||
<para>eth2 connects to a local network.</para>
|
|
||||||
|
|
||||||
<programlisting> #NAME NUMBER MARK DUPLICATE INTERFACE GATEWAY OPTIONS COPY
|
|
||||||
ISP1 1 1 main eth0 2001:ce7c:92b4:1::2 track eth2
|
|
||||||
ISP2 2 2 main eth1 2001:d64c:83c9:12::8b track eth2</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
@@ -548,8 +498,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/providers</para>
|
<para>/etc/shorewall/providers</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/providers</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -561,6 +509,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-proxyarp(5), shorewall-rtrules(5),
|
||||||
|
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -25,8 +25,6 @@
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
|
|
||||||
<para>IPv4 only.</para>
|
|
||||||
|
|
||||||
<para>This file is used to define Proxy ARP. There is one entry in this
|
<para>This file is used to define Proxy ARP. There is one entry in this
|
||||||
file for each IP address to be proxied.</para>
|
file for each IP address to be proxied.</para>
|
||||||
|
|
||||||
@@ -141,6 +139,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-rtrules(5),
|
||||||
|
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/routes</command>
|
<command>/etc/shorewall/routes</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -109,8 +109,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/routes</para>
|
<para>/etc/shorewall/routes</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/routes</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -119,6 +117,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcclasses(5),
|
||||||
|
shorewall-tcdevices(5), shorewall-mangle(5), shorewall-tos(5),
|
||||||
|
shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/rtrules</command>
|
<command>/etc/shorewall/rtrules</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 2:</term>
|
<term>Example 2:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You use OpenVPN (routed setup /tunX) in combination with
|
<para>You use OpenVPN (routed setup /tunX) in combination with
|
||||||
@@ -199,8 +199,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/rtrules</para>
|
<para>/etc/shorewall/rtrules</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/rtrules</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -212,6 +210,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/rules</command>
|
<command>/etc/shorewall/rules</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -54,8 +54,7 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>This section was added in Shorewall 4.4.23. Rules in this
|
<para>This section was added in Shorewall 4.4.23. Rules in this
|
||||||
section are applied, regardless of the connection tracking state of
|
section are applied, regardless of the connection tracking state of
|
||||||
the packet and are applied before rules in the other
|
the packet.</para>
|
||||||
sections.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -67,7 +66,7 @@
|
|||||||
this section.</para>
|
this section.</para>
|
||||||
|
|
||||||
<para>The only ACTIONs allowed in this section are ACCEPT, DROP,
|
<para>The only ACTIONs allowed in this section are ACCEPT, DROP,
|
||||||
REJECT, LOG, NFLOG, NFQUEUE and QUEUE</para>
|
REJECT, LOG, NFQUEUE and QUEUE</para>
|
||||||
|
|
||||||
<para>There is an implicit ACCEPT rule inserted at the end of this
|
<para>There is an implicit ACCEPT rule inserted at the end of this
|
||||||
section.</para>
|
section.</para>
|
||||||
@@ -82,7 +81,7 @@
|
|||||||
section.</para>
|
section.</para>
|
||||||
|
|
||||||
<para>The only ACTIONs allowed in this section are ACCEPT, DROP,
|
<para>The only ACTIONs allowed in this section are ACCEPT, DROP,
|
||||||
REJECT, LOG, NFLOG, NFQUEUE and QUEUE</para>
|
REJECT, LOG, NFQUEUE and QUEUE</para>
|
||||||
|
|
||||||
<para>There is an implicit rule added at the end of this section
|
<para>There is an implicit rule added at the end of this section
|
||||||
that invokes the RELATED_DISPOSITION (<ulink
|
that invokes the RELATED_DISPOSITION (<ulink
|
||||||
@@ -98,7 +97,7 @@
|
|||||||
processed by rules in this section.</para>
|
processed by rules in this section.</para>
|
||||||
|
|
||||||
<para>The only Actions allowed in this section are ACCEPT, DROP,
|
<para>The only Actions allowed in this section are ACCEPT, DROP,
|
||||||
REJECT, LOG, NFLOG, NFQUEUE and QUEUE.</para>
|
REJECT, LOG, NFQUEUE and QUEUE.</para>
|
||||||
|
|
||||||
<para>There is an implicit rule added at the end of this section
|
<para>There is an implicit rule added at the end of this section
|
||||||
that invokes the INVALID_DISPOSITION (<ulink
|
that invokes the INVALID_DISPOSITION (<ulink
|
||||||
@@ -114,7 +113,7 @@
|
|||||||
processed by rules in this section.</para>
|
processed by rules in this section.</para>
|
||||||
|
|
||||||
<para>The only Actions allowed in this section are ACCEPT, DROP,
|
<para>The only Actions allowed in this section are ACCEPT, DROP,
|
||||||
REJECT, LOG, NFLOG, NFQUEUE and QUEUE.</para>
|
REJECT, LOG, NFQUEUE and QUEUE.</para>
|
||||||
|
|
||||||
<para>There is an implicit rule added at the end of this section
|
<para>There is an implicit rule added at the end of this section
|
||||||
that invokes the UNTRACKED_DISPOSITION (<ulink
|
that invokes the UNTRACKED_DISPOSITION (<ulink
|
||||||
@@ -212,8 +211,7 @@
|
|||||||
role="bold">DNAT</emphasis>[<emphasis
|
role="bold">DNAT</emphasis>[<emphasis
|
||||||
role="bold">-</emphasis>] or <emphasis
|
role="bold">-</emphasis>] or <emphasis
|
||||||
role="bold">REDIRECT</emphasis>[<emphasis
|
role="bold">REDIRECT</emphasis>[<emphasis
|
||||||
role="bold">-</emphasis>] rules. Use with IPv6 requires
|
role="bold">-</emphasis>] rules.</para>
|
||||||
Shorewall 4.5.14 or later.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -234,7 +232,7 @@
|
|||||||
<para>The name of an <emphasis>action</emphasis> declared in
|
<para>The name of an <emphasis>action</emphasis> declared in
|
||||||
<ulink
|
<ulink
|
||||||
url="/manpages/shorewall-actions.html">shorewall-actions</ulink>(5)
|
url="/manpages/shorewall-actions.html">shorewall-actions</ulink>(5)
|
||||||
or in /usr/share/shorewall[6]/actions.std.</para>
|
or in /usr/share/shorewall/actions.std.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -288,8 +286,7 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>Added in Shorewall 4.4.20. Audited versions of ACCEPT,
|
<para>Added in Shorewall 4.4.20. Audited versions of ACCEPT,
|
||||||
ACCEPT+ and ACCEPT! respectively. Require AUDIT_TARGET support
|
ACCEPT+ and ACCEPT! respectively. Require AUDIT_TARGET support
|
||||||
in the kernel and iptables. A_ACCEPT+ with IPv6 requires
|
in the kernel and iptables.</para>
|
||||||
Shorewall 4.5.14 or later.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -404,8 +401,7 @@
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Forward the request to another system (and optionally
|
<para>Forward the request to another system (and optionally
|
||||||
another port). Use with IPv6 requires Shorewall 4.5.14 or
|
another port).</para>
|
||||||
later.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -418,8 +414,7 @@
|
|||||||
<para>Like <emphasis role="bold">DNAT</emphasis> but only
|
<para>Like <emphasis role="bold">DNAT</emphasis> but only
|
||||||
generates the <emphasis role="bold">DNAT</emphasis> iptables
|
generates the <emphasis role="bold">DNAT</emphasis> iptables
|
||||||
rule and not the companion <emphasis
|
rule and not the companion <emphasis
|
||||||
role="bold">ACCEPT</emphasis> rule. Use with IPv6 requires
|
role="bold">ACCEPT</emphasis> rule.</para>
|
||||||
Shorewall 4.5.14 or later.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -501,11 +496,11 @@
|
|||||||
[<replaceable>option</replaceable> ...])</term>
|
[<replaceable>option</replaceable> ...])</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only. This action allows you to specify an iptables
|
<para>This action allows you to specify an iptables target
|
||||||
target with options (e.g., 'IPTABLES(MARK --set-xmark
|
with options (e.g., 'IPTABLES(MARK --set-xmark 0x01/0xff)'. If
|
||||||
0x01/0xff)'. If the <replaceable>iptables-target</replaceable>
|
the <replaceable>iptables-target</replaceable> is not one
|
||||||
is not one recognized by Shorewall, the following error
|
recognized by Shorewall, the following error message will be
|
||||||
message will be issued:</para>
|
issued:</para>
|
||||||
|
|
||||||
<programlisting> ERROR: Unknown target (<replaceable>iptables-target</replaceable>)</programlisting>
|
<programlisting> ERROR: Unknown target (<replaceable>iptables-target</replaceable>)</programlisting>
|
||||||
|
|
||||||
@@ -526,39 +521,6 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis
|
|
||||||
role="bold">IP6TABLES</emphasis>({<replaceable>ip6tables-target</replaceable>
|
|
||||||
[<replaceable>option</replaceable> ...])</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>IPv6 only. This action allows you to specify an
|
|
||||||
ip6tables target with options (e.g., 'IPTABLES(MARK
|
|
||||||
--set-xmark 0x01/0xff)'. If the
|
|
||||||
<replaceable>ip6tables-target</replaceable> is not one
|
|
||||||
recognized by Shorewall, the following error message will be
|
|
||||||
issued:</para>
|
|
||||||
|
|
||||||
<programlisting> ERROR: Unknown target (<replaceable>ip6tables-target</replaceable>)</programlisting>
|
|
||||||
|
|
||||||
<para>This error message may be eliminated by adding
|
|
||||||
the<replaceable>
|
|
||||||
ip6tables-</replaceable><replaceable>target</replaceable> as a
|
|
||||||
builtin action in <ulink
|
|
||||||
url="/manpages6/shorewall6-actions.html">shorewall-actions</ulink>(5).</para>
|
|
||||||
|
|
||||||
<important>
|
|
||||||
<para>If you specify REJECT as the
|
|
||||||
<replaceable>ip6tables-target</replaceable>, the target of
|
|
||||||
the rule will be the i6ptables REJECT target and not
|
|
||||||
Shorewall's builtin 'reject' chain which is used when REJECT
|
|
||||||
(see below) is specified as the
|
|
||||||
<replaceable>target</replaceable> in the ACTION
|
|
||||||
column.</para>
|
|
||||||
</important>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis
|
<term><emphasis
|
||||||
role="bold">LOG:<replaceable>level</replaceable></emphasis></term>
|
role="bold">LOG:<replaceable>level</replaceable></emphasis></term>
|
||||||
@@ -711,8 +673,7 @@
|
|||||||
<para>Excludes the connection from any subsequent <emphasis
|
<para>Excludes the connection from any subsequent <emphasis
|
||||||
role="bold">DNAT</emphasis>[-] or <emphasis
|
role="bold">DNAT</emphasis>[-] or <emphasis
|
||||||
role="bold">REDIRECT</emphasis>[-] rules but doesn't generate
|
role="bold">REDIRECT</emphasis>[-] rules but doesn't generate
|
||||||
a rule to accept the traffic. Use with IPv6 requires Shorewall
|
a rule to accept the traffic.</para>
|
||||||
4.5.14 or later.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -747,7 +708,7 @@
|
|||||||
|
|
||||||
<para>Beginning with Shorewall 5.0.8, the type of reject may
|
<para>Beginning with Shorewall 5.0.8, the type of reject may
|
||||||
be specified in the <replaceable>option</replaceable>
|
be specified in the <replaceable>option</replaceable>
|
||||||
paramater. Valid IPv4 <replaceable>option</replaceable> values
|
paramater. Valid <replaceable>option</replaceable> values
|
||||||
are:</para>
|
are:</para>
|
||||||
|
|
||||||
<simplelist>
|
<simplelist>
|
||||||
@@ -770,28 +731,6 @@
|
|||||||
option may also be specified as
|
option may also be specified as
|
||||||
<option>tcp-reset</option>.</member>
|
<option>tcp-reset</option>.</member>
|
||||||
</simplelist>
|
</simplelist>
|
||||||
|
|
||||||
<para>Valid IPv6 <replaceable>option</replaceable> values
|
|
||||||
are:</para>
|
|
||||||
|
|
||||||
<simplelist>
|
|
||||||
<member><option>icmp6-no-route</option></member>
|
|
||||||
|
|
||||||
<member><option>no-route</option></member>
|
|
||||||
|
|
||||||
<member><option>i</option><option>cmp6-adm-prohibited</option></member>
|
|
||||||
|
|
||||||
<member><option>adm-prohibited</option></member>
|
|
||||||
|
|
||||||
<member><option>icmp6-addr-unreachable</option></member>
|
|
||||||
|
|
||||||
<member><option>addr-unreach</option></member>
|
|
||||||
|
|
||||||
<member><option>icmp6-port-unreachable</option></member>
|
|
||||||
|
|
||||||
<member><option>tcp-reset</option> (the PROTO column must
|
|
||||||
specify TCP)</member>
|
|
||||||
</simplelist>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -810,8 +749,7 @@
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Redirect the request to a server running on the
|
<para>Redirect the request to a server running on the
|
||||||
firewall. Use with IPv6 requires Shorewall 4.5.14 or
|
firewall.</para>
|
||||||
later.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -824,8 +762,7 @@
|
|||||||
<para>Like <emphasis role="bold">REDIRECT</emphasis> but only
|
<para>Like <emphasis role="bold">REDIRECT</emphasis> but only
|
||||||
generates the <emphasis role="bold">REDIRECT</emphasis>
|
generates the <emphasis role="bold">REDIRECT</emphasis>
|
||||||
iptables rule and not the companion <emphasis
|
iptables rule and not the companion <emphasis
|
||||||
role="bold">ACCEPT</emphasis> rule. Use with IPv6 requires
|
role="bold">ACCEPT</emphasis> rule.</para>
|
||||||
Shorewall 4.5.14 or later.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -905,10 +842,10 @@
|
|||||||
role="bold">ULOG</emphasis>[(<replaceable>ulog-parameters</replaceable>)]</term>
|
role="bold">ULOG</emphasis>[(<replaceable>ulog-parameters</replaceable>)]</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only. Added in Shorewall 4.5.10. Queues matching
|
<para>Added in Shorewall 4.5.10. Queues matching packets to a
|
||||||
packets to a back end logging daemon via a netlink socket then
|
back end logging daemon via a netlink socket then continues to
|
||||||
continues to the next rule. See <ulink
|
the next rule. See <ulink
|
||||||
url="shorewall-logging.html">shorewall-logging(5)</ulink>.</para>
|
url="/shorewall_logging.html">http://www.shorewall.net/shorewall_logging.html</ulink>.</para>
|
||||||
|
|
||||||
<para>Similar to<emphasis role="bold">
|
<para>Similar to<emphasis role="bold">
|
||||||
LOG:ULOG</emphasis>[(<replaceable>ulog-parameters</replaceable>)],
|
LOG:ULOG</emphasis>[(<replaceable>ulog-parameters</replaceable>)],
|
||||||
@@ -952,11 +889,11 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
<para>You may also specify <emphasis role="bold">ULOG</emphasis>
|
<para>You may also specify <emphasis role="bold">ULOG</emphasis> or
|
||||||
(IPv4 only) or <emphasis role="bold">NFLOG</emphasis> (must be in
|
<emphasis role="bold">NFLOG</emphasis> (must be in upper case) as a
|
||||||
upper case) as a log level.This will log to the ULOG or NFLOG target
|
log level.This will log to the ULOG or NFLOG target for routing to a
|
||||||
for routing to a separate log through use of ulogd (<ulink
|
separate log through use of ulogd (<ulink
|
||||||
url="shorewall-logging.html">shorewall-logging(5)</ulink>).</para>
|
url="http://www.netfilter.org/projects/ulogd/index.html">http://www.netfilter.org/projects/ulogd/index.html</ulink>).</para>
|
||||||
|
|
||||||
<para>Actions specifying logging may be followed by a log tag (a
|
<para>Actions specifying logging may be followed by a log tag (a
|
||||||
string of alphanumeric characters) which is appended to the string
|
string of alphanumeric characters) which is appended to the string
|
||||||
@@ -985,9 +922,9 @@
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>The name of a zone defined in <ulink
|
<para>The name of a zone defined in <ulink
|
||||||
url="/manpages/shorewall-zones.html">shorewall-zones</ulink>(5).
|
url="/manpages/shorewall-zones.html">shorewall-zones</ulink>(5). When
|
||||||
When only the zone name is specified, the packet source may be
|
only the zone name is specified, the packet source may be any
|
||||||
any host in that zone.</para>
|
host in that zone.</para>
|
||||||
|
|
||||||
<para>zone may also be one of the following:</para>
|
<para>zone may also be one of the following:</para>
|
||||||
|
|
||||||
@@ -1054,10 +991,9 @@
|
|||||||
<replaceable>zone</replaceable> in either <ulink
|
<replaceable>zone</replaceable> in either <ulink
|
||||||
url="/manpages/shorewall-interfaces.html">shorewall-interfaces</ulink>(5)
|
url="/manpages/shorewall-interfaces.html">shorewall-interfaces</ulink>(5)
|
||||||
or <ulink
|
or <ulink
|
||||||
url="/manpages/shorewall.hosts.html">shorewall-hosts</ulink>(5).
|
url="/manpages/shorewall.hosts.html">shorewall-hosts</ulink>(5). Only
|
||||||
Only packets from hosts in the <replaceable>zone</replaceable>
|
packets from hosts in the <replaceable>zone</replaceable> that
|
||||||
that arrive through the named interface will match the
|
arrive through the named interface will match the rule.</para>
|
||||||
rule.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -1272,49 +1208,6 @@
|
|||||||
of the net zone.</para>
|
of the net zone.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>dmz:[2002:ce7c:2b4:1::2]</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Host 2002:ce7c:92b4:1::2 in the DMZ</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>net:2001:4d48:ad51:24::/64</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Subnet 2001:4d48:ad51:24::/64 on the Internet</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>loc:[2002:cec792b4:1::2],[2002:cec792b4:1::44]</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Hosts 2002:cec792b4:1::2 and 2002:cec792b4:1::44 in the
|
|
||||||
local zone.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>loc:~00-A0-C9-15-39-78</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Host in the local zone with MAC address
|
|
||||||
00:A0:C9:15:39:78.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>net:[2001:4d48:ad51:24::]/64![2001:4d48:ad51:24:6::]/80</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Subnet 2001:4d48:ad51:24::/64 on the Internet except for
|
|
||||||
2001:4d48:ad51:24:6::/80.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -1336,9 +1229,9 @@
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>The name of a zone defined in <ulink
|
<para>The name of a zone defined in <ulink
|
||||||
url="/manpages/shorewall-zones.html">shorewall-zones</ulink>(5).
|
url="/manpages/shorewall-zones.html">shorewall-zones</ulink>(5). When
|
||||||
When only the zone name is specified, the packet destination
|
only the zone name is specified, the packet destination may be
|
||||||
may be any host in that zone.</para>
|
any host in that zone.</para>
|
||||||
|
|
||||||
<para>zone may also be one of the following:</para>
|
<para>zone may also be one of the following:</para>
|
||||||
|
|
||||||
@@ -1405,9 +1298,9 @@
|
|||||||
<replaceable>zone</replaceable> in either <ulink
|
<replaceable>zone</replaceable> in either <ulink
|
||||||
url="/manpages/shorewall-interfaces.html">shorewall-interfaces</ulink>(5)
|
url="/manpages/shorewall-interfaces.html">shorewall-interfaces</ulink>(5)
|
||||||
or <ulink
|
or <ulink
|
||||||
url="/manpages/shorewall-hosts.html">shorewall-hosts</ulink>(5).
|
url="/manpages/shorewall-hosts.html">shorewall-hosts</ulink>(5). Only
|
||||||
Only packets to hosts in the <replaceable>zone</replaceable>
|
packets to hosts in the <replaceable>zone</replaceable> that
|
||||||
that are sent through the named interface will match the
|
are sent through the named interface will match the
|
||||||
rule.</para>
|
rule.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -2189,100 +2082,12 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">HEADERS -
|
<term><emphasis role="bold">HEADERS</emphasis></term>
|
||||||
[!][any:|exactly:]</emphasis><replaceable>header-list
|
|
||||||
</replaceable>(Optional - Added in Shorewall 4.4.15)</term>
|
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>This column is only used in IPv6. In IPv4, supply "-" in this
|
<para>Added in Shorewall 4.4.15. Not used in IPv4 configurations. If
|
||||||
column if you with to place a value in one of the following
|
you with to supply a value for one of the later columns, enter '-'
|
||||||
columns.</para>
|
in this column.</para>
|
||||||
|
|
||||||
<para>The <replaceable>header-list</replaceable> consists of a
|
|
||||||
comma-separated list of headers from the following list.</para>
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">auth</emphasis>, <emphasis
|
|
||||||
role="bold">ah</emphasis>, or <emphasis
|
|
||||||
role="bold">51</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para><firstterm>Authentication Headers</firstterm> extension
|
|
||||||
header.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">esp</emphasis>, or <emphasis
|
|
||||||
role="bold">50</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para><firstterm>Encrypted Security Payload</firstterm>
|
|
||||||
extension header.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">hop</emphasis>, <emphasis
|
|
||||||
role="bold">hop-by-hop</emphasis> or <emphasis
|
|
||||||
role="bold">0</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Hop-by-hop options extension header.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">route</emphasis>, <emphasis
|
|
||||||
role="bold">ipv6-route</emphasis> or <emphasis
|
|
||||||
role="bold">43</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>IPv6 Route extension header.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">frag</emphasis>, <emphasis
|
|
||||||
role="bold">ipv6-frag</emphasis> or <emphasis
|
|
||||||
role="bold">44</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>IPv6 fragmentation extension header.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">none</emphasis>, <emphasis
|
|
||||||
role="bold">ipv6-nonxt</emphasis> or <emphasis
|
|
||||||
role="bold">59</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>No next header</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">proto</emphasis>, <emphasis
|
|
||||||
role="bold">protocol</emphasis> or <emphasis
|
|
||||||
role="bold">255</emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Any protocol header.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
|
|
||||||
<para>If <emphasis role="bold">any:</emphasis> is specified, the
|
|
||||||
rule will match if any of the listed headers are present. If
|
|
||||||
<emphasis role="bold">exactly:</emphasis> is specified, the will
|
|
||||||
match packets that exactly include all specified headers. If neither
|
|
||||||
is given, <emphasis role="bold">any:</emphasis> is assumed.</para>
|
|
||||||
|
|
||||||
<para>If <emphasis role="bold">!</emphasis> is entered, the rule
|
|
||||||
will match those packets which would not be matched when <emphasis
|
|
||||||
role="bold">!</emphasis> is omitted.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -2608,20 +2413,6 @@
|
|||||||
SECCTX builtin</programlisting>
|
SECCTX builtin</programlisting>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>Example 15:</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>You want to accept SSH connections to your firewall only from
|
|
||||||
internet IP addresses 2002:ce7c::92b4:1::2 and
|
|
||||||
2002:ce7c::92b4:1::22</para>
|
|
||||||
|
|
||||||
<programlisting> #ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST
|
|
||||||
ACCEPT net:<2002:ce7c::92b4:1::2,2002:ce7c::92b4:1::22> \
|
|
||||||
$FW tcp 22</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
@@ -2629,22 +2420,28 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/rules</para>
|
<para>/etc/shorewall/rules</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/rules</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>See ALSO</title>
|
<title>See ALSO</title>
|
||||||
|
|
||||||
<para><ulink
|
|
||||||
url="shorewall-logging.html">shorewall-logging(5)</ulink></para>
|
|
||||||
|
|
||||||
<para><ulink
|
<para><ulink
|
||||||
url="/ipsets.html">http://www.shorewall.net/ipsets.html</ulink></para>
|
url="/ipsets.html">http://www.shorewall.net/ipsets.html</ulink></para>
|
||||||
|
|
||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para><ulink
|
||||||
|
url="/shorewall_logging.html">http://www.shorewall.net/shorewall_logging.html</ulink></para>
|
||||||
|
|
||||||
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-blrules(5), shorewall-hosts(5),
|
||||||
|
shorewall_interfaces(5), shorewall-ipsets(5), shorewall-maclist(5),
|
||||||
|
shorewall-masq(5), shorewall-nat(5), shorewall-netmap(5),
|
||||||
|
shorewall-params(5), shorewall-policy(5), shorewall-providers(5),
|
||||||
|
shorewall-proxyarp(5), shorewall-rtrules(5), shorewall-routestopped(5),
|
||||||
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcclasses(5),
|
||||||
|
shorewall-tcdevices(5), shorewall-mangle(5), shorewall-tos(5),
|
||||||
|
shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/secmarks</command>
|
<command>/etc/shorewall/secmarks</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@
|
|||||||
role="bold">all}[,...]</emphasis></term>
|
role="bold">all}[,...]</emphasis></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>See <ulink
|
<para> See <ulink
|
||||||
url="shorewall-rules.html">shorewall-rules(5)</ulink> for
|
url="shorewall-rules.html">shorewall-rules(5)</ulink> for
|
||||||
details.</para>
|
details.</para>
|
||||||
|
|
||||||
@@ -404,8 +404,6 @@ RESTORE I:ER</programlisting>
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/secmarks</para>
|
<para>/etc/shorewall/secmarks</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/secmarks</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -417,6 +415,14 @@ RESTORE I:ER</programlisting>
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall.conf(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/snat</command>
|
<command>/etc/shorewall/snat</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -52,52 +52,12 @@
|
|||||||
<term><emphasis role="bold">ACTION</emphasis></term>
|
<term><emphasis role="bold">ACTION</emphasis></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Defines the type of rule to generate. Beginning with Shorewall
|
<para>Defines the type of rule to generate. Choices are:</para>
|
||||||
5.1.9, with the exception of NFLOG and ULOG, the action may be
|
|
||||||
followed by a colon (":") and a <replaceable>log level</replaceable>
|
|
||||||
(see <ulink
|
|
||||||
url="shorewall-logging.html">shorewall-logging(5)</ulink>).</para>
|
|
||||||
|
|
||||||
<para>Choices for ACTION are:</para>
|
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis
|
<term><emphasis
|
||||||
role="bold"><replaceable>action</replaceable></emphasis>[+][(<replaceable>parameter</replaceable>,...)][:<replaceable>level</replaceable>]</term>
|
role="bold">MASQUERADE[+]</emphasis>[([<replaceable>lowport</replaceable>-<replaceable>highport</replaceable>][<option>random</option>])]</term>
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>where <replaceable>action</replaceable> is an action
|
|
||||||
declared in <ulink
|
|
||||||
url="/manpages/shorewall-actions.html">shorewall-actions(5)</ulink>
|
|
||||||
with the <option>nat</option> option. See <ulink
|
|
||||||
url="/Actions.html">www.shorewall.net/Actions.html</ulink> for
|
|
||||||
further information.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis
|
|
||||||
role="bold">CONTINUE</emphasis>[+]:<replaceable>level</replaceable></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Causes matching packets to be exempted from any
|
|
||||||
following rules in the file.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis
|
|
||||||
role="bold">LOG:<replaceable>level</replaceable></emphasis></term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Added in Shorewall 5.1.9. Simply log the packet and
|
|
||||||
continue with the next rule.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis
|
|
||||||
role="bold">MASQUERADE[+]</emphasis>[([<replaceable>lowport</replaceable>-<replaceable>highport</replaceable>][<option>random</option>])][:<replaceable>level</replaceable>]</term>
|
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Causes matching outgoing packages to have their source
|
<para>Causes matching outgoing packages to have their source
|
||||||
@@ -113,52 +73,12 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis
|
|
||||||
role="bold">NFLOG</emphasis>[(<replaceable>nflog-parameters</replaceable>)]</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Added in Shorewall 5.1.9. Queues matching packets to a
|
|
||||||
back end logging daemon via a netlink socket then continues to
|
|
||||||
the next rule. See <ulink
|
|
||||||
url="shorewall-logging.html">shorewall-logging(5)</ulink>.</para>
|
|
||||||
|
|
||||||
<para>The <replaceable>nflog-parameters</replaceable> are a
|
|
||||||
comma-separated list of up to 3 numbers:</para>
|
|
||||||
|
|
||||||
<itemizedlist>
|
|
||||||
<listitem>
|
|
||||||
<para>The first number specifies the netlink group
|
|
||||||
(0-65535). If omitted (e.g., NFLOG(,0,10)) then a value of
|
|
||||||
0 is assumed.</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>The second number specifies the maximum number of
|
|
||||||
bytes to copy. If omitted, 0 (no limit) is assumed.</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>The third number specifies the number of log
|
|
||||||
messages that should be buffered in the kernel before they
|
|
||||||
are sent to user space. The default is 1.</para>
|
|
||||||
</listitem>
|
|
||||||
</itemizedlist>
|
|
||||||
|
|
||||||
<para>NFLOG is similar to<emphasis role="bold">
|
|
||||||
LOG:NFLOG</emphasis>[(<replaceable>nflog-parameters</replaceable>)],
|
|
||||||
except that the log level is not changed when this ACTION is
|
|
||||||
used in an action or macro body and the invocation of that
|
|
||||||
action or macro specifies a log level.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis
|
<term><emphasis
|
||||||
role="bold">SNAT[+]</emphasis>([<emphasis>address-or-address-range</emphasis>][:<emphasis>lowport</emphasis><emphasis
|
role="bold">SNAT[+]</emphasis>([<emphasis>address-or-address-range</emphasis>][:<emphasis>lowport</emphasis><emphasis
|
||||||
role="bold">-</emphasis><emphasis>highport</emphasis>][<emphasis
|
role="bold">-</emphasis><emphasis>highport</emphasis>][<emphasis
|
||||||
role="bold">:random</emphasis>][:<option>persistent</option>]|<emphasis
|
role="bold">:random</emphasis>][:<option>persistent</option>]|<emphasis
|
||||||
role="bold">detect</emphasis>)[:<replaceable>level</replaceable>]</term>
|
role="bold">detect</emphasis>|</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>If you specify an address here, matching packets will
|
<para>If you specify an address here, matching packets will
|
||||||
@@ -166,7 +86,7 @@
|
|||||||
ADD_SNAT_ALIASES is set to Yes or yes in <ulink
|
ADD_SNAT_ALIASES is set to Yes or yes in <ulink
|
||||||
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5)
|
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5)
|
||||||
then Shorewall will automatically add this address to the
|
then Shorewall will automatically add this address to the
|
||||||
INTERFACE named in the first column (IPv4 only).</para>
|
INTERFACE named in the first column.</para>
|
||||||
|
|
||||||
<para>You may also specify a range of up to 256 IP addresses
|
<para>You may also specify a range of up to 256 IP addresses
|
||||||
if you want the SNAT address to be assigned from that range in
|
if you want the SNAT address to be assigned from that range in
|
||||||
@@ -185,7 +105,9 @@
|
|||||||
role="bold">:random</emphasis>) with <emphasis
|
role="bold">:random</emphasis>) with <emphasis
|
||||||
role="bold">:persistent</emphasis>. This is only useful when
|
role="bold">:persistent</emphasis>. This is only useful when
|
||||||
an address range is specified and causes a client to be given
|
an address range is specified and causes a client to be given
|
||||||
the same source/destination IP pair.</para>
|
the same source/destination IP pair. This feature replaces the
|
||||||
|
SAME modifier which was removed from Shorewall in version
|
||||||
|
4.4.0.</para>
|
||||||
|
|
||||||
<para>You may also use the special value
|
<para>You may also use the special value
|
||||||
<option>detect</option> which causes Shorewall to determine
|
<option>detect</option> which causes Shorewall to determine
|
||||||
@@ -213,20 +135,25 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis
|
<term><emphasis role="bold">CONTINUE</emphasis>[+]</term>
|
||||||
role="bold">ULOG</emphasis>[(<replaceable>ulog-parameters</replaceable>)]</term>
|
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only. Added in Shorewall 5.1.9. Queues matching
|
<para>Causes matching packets to be exempted from any
|
||||||
packets to a back end logging daemon via a netlink socket then
|
following rules in the file.</para>
|
||||||
continues to the next rule. See <ulink
|
</listitem>
|
||||||
url="shorewall-logging.html">shorewall-logging(5)</ulink>.</para>
|
</varlistentry>
|
||||||
|
|
||||||
<para>Similar to<emphasis role="bold">
|
<varlistentry>
|
||||||
LOG:ULOG</emphasis>[(<replaceable>ulog-parameters</replaceable>)],
|
<term><emphasis
|
||||||
except that the log level is not changed when this ACTION is
|
role="bold"><replaceable>action</replaceable></emphasis>[+][(<replaceable>parameter</replaceable>,...)]</term>
|
||||||
used in an action or macro body and the invocation of that
|
|
||||||
action or macro specifies a log level.</para>
|
<listitem>
|
||||||
|
<para>where <replaceable>action</replaceable> is an action
|
||||||
|
declared in <ulink
|
||||||
|
url="/manpages/shorewall-actions.html">shorewall-actions(5)</ulink> with
|
||||||
|
the <option>nat</option> option. See <ulink
|
||||||
|
url="/Actions.html">www.shorewall.net/Actions.html</ulink> for
|
||||||
|
further information.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
@@ -330,8 +257,7 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>If you wish to restrict this entry to a particular protocol
|
<para>If you wish to restrict this entry to a particular protocol
|
||||||
then enter the protocol name (from protocols(5)) or number here. See
|
then enter the protocol name (from protocols(5)) or number here. See
|
||||||
<ulink
|
<ulink url="/manpages/shorewall-rules.html">shorewall-rules(5)</ulink> for
|
||||||
url="/manpages/shorewall-rules.html">shorewall-rules(5)</ulink> for
|
|
||||||
details.</para>
|
details.</para>
|
||||||
|
|
||||||
<para>Beginning with Shorewall 4.5.12, this column can accept a
|
<para>Beginning with Shorewall 4.5.12, this column can accept a
|
||||||
@@ -673,7 +599,7 @@
|
|||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 1:</term>
|
<term>Example 1:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You have a simple masquerading setup where eth0 connects to a
|
<para>You have a simple masquerading setup where eth0 connects to a
|
||||||
@@ -688,7 +614,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 2:</term>
|
<term>Example 2:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You add a router to your local network to connect subnet
|
<para>You add a router to your local network to connect subnet
|
||||||
@@ -702,7 +628,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 3:</term>
|
<term>Example 3:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You want all outgoing traffic from 192.168.1.0/24 through eth0
|
<para>You want all outgoing traffic from 192.168.1.0/24 through eth0
|
||||||
@@ -716,7 +642,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 4:</term>
|
<term>Example 4:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You want all outgoing SMTP traffic entering the firewall from
|
<para>You want all outgoing SMTP traffic entering the firewall from
|
||||||
@@ -740,7 +666,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 5:</term>
|
<term>Example 5:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Connections leaving on eth0 and destined to any host defined
|
<para>Connections leaving on eth0 and destined to any host defined
|
||||||
@@ -748,12 +674,12 @@
|
|||||||
address changed to 206.124.146.177.</para>
|
address changed to 206.124.146.177.</para>
|
||||||
|
|
||||||
<programlisting> #ACTION SOURCE DEST
|
<programlisting> #ACTION SOURCE DEST
|
||||||
SNAT(206.124.146.177) - eth0:+myset[dst]</programlisting>
|
SNAT(206.124.146.177) - eth0+myset[dst]</programlisting>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 6:</term>
|
<term>Example 6:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>SNAT outgoing connections on eth0 from 192.168.1.0/24 in
|
<para>SNAT outgoing connections on eth0 from 192.168.1.0/24 in
|
||||||
@@ -775,34 +701,19 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv6 Example 1:</term>
|
<term>Example 7:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You have a simple 'masquerading' setup where eth0 connects to
|
<para>Your eth1 has two public IP addresses: 70.90.191.121 and
|
||||||
a DSL or cable modem and eth1 connects to your local network with
|
70.90.191.123. You want to use the iptables statistics match to
|
||||||
subnet 2001:470:b:787::0/64</para>
|
masquerade outgoing connections evenly between these two
|
||||||
|
addresses.</para>
|
||||||
<para>Your entry in the file will be:</para>
|
|
||||||
|
|
||||||
<programlisting> #ACTION SOURCE DEST
|
|
||||||
MASQUERADE 2001:470:b:787::0/64 eth0</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>IPv6 Example 2:</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Your sit1 interface has two public IP addresses:
|
|
||||||
2001:470:a:227::1 and 2001:470:b:227::1. You want to use the
|
|
||||||
iptables statistics match to masquerade outgoing connections evenly
|
|
||||||
between these two addresses.</para>
|
|
||||||
|
|
||||||
<programlisting>/etc/shorewall/snat:
|
<programlisting>/etc/shorewall/snat:
|
||||||
|
|
||||||
#ACTION SOURCE DEST
|
#ACTION SOURCE DEST
|
||||||
SNAT(2001:470:a:227::1) ::/0 sit1 { probability=0.50 }
|
SNAT(70.90.191.121) - eth1 { probability=.50 }
|
||||||
SNAT(2001:470:a:227::2) ::/0 sit</programlisting>
|
SNAT(70.90.191.123) - eth1</programlisting>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
@@ -812,8 +723,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/snat</para>
|
<para>/etc/shorewall/snat</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/snat</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -822,6 +731,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-exclusion(5), shorewall-hosts(5),
|
||||||
|
shorewall_interfaces(5), shorewall-ipsets(5), shorewall-maclist(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcclasses(5),
|
||||||
|
shorewall-tcdevices(5), shorewall-mangle(5), shorewall-tos(5),
|
||||||
|
shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/stoppedrules</command>
|
<command>/etc/shorewall/stoppedrules</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -153,8 +153,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/stoppedrules</para>
|
<para>/etc/shorewall/stoppedrules</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/stoppedrules</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -166,6 +164,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/tcclasses</command>
|
<command>/etc/shorewall/tcclasses</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -763,8 +763,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/tcclasses</para>
|
<para>/etc/shorewall/tcclasses</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/tcclasses</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -780,6 +778,14 @@
|
|||||||
|
|
||||||
<para>tc-red(8)</para>
|
<para>tc-red(8)</para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/tcdevices</command>
|
<command>/etc/shorewall/tcdevices</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -160,9 +160,7 @@
|
|||||||
how often the rate is estimated and how many samples are retained
|
how often the rate is estimated and how many samples are retained
|
||||||
for estimating. Please see <ulink
|
for estimating. Please see <ulink
|
||||||
url="http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt">http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt</ulink>
|
url="http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt">http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt</ulink>
|
||||||
for details. If not specified, the default
|
for details.</para>
|
||||||
<replaceable>interval</replaceable> is 250ms and the default
|
|
||||||
<replaceable>decay_interval</replaceable> is 4sec.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -278,8 +276,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/tcdevices</para>
|
<para>/etc/shorewall/tcdevices</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/tcdevices</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -296,6 +292,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt">http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt</ulink></para>
|
url="http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt">http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcclasses(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/tcfilters</command>
|
<command>/etc/shorewall/tcfilters</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -89,12 +89,12 @@
|
|||||||
Beginning with Shorewall 4.6.0, an ipset name (prefixed with '+')
|
Beginning with Shorewall 4.6.0, an ipset name (prefixed with '+')
|
||||||
may be used if your kernel and ip6tables have the <firstterm>Basic
|
may be used if your kernel and ip6tables have the <firstterm>Basic
|
||||||
Ematch</firstterm> capability and you set BASIC_FILTERS=Yes in
|
Ematch</firstterm> capability and you set BASIC_FILTERS=Yes in
|
||||||
<ulink url="/manpages/shorewall.conf.html">shorewall.conf
|
<ulink url="/manpages/shorewall.conf.html">shorewall.conf (5)</ulink>. The
|
||||||
(5)</ulink>. The ipset name may optionally be followed by a number
|
ipset name may optionally be followed by a number or a comma
|
||||||
or a comma separated list of src and/or dst enclosed in square
|
separated list of src and/or dst enclosed in square brackets
|
||||||
brackets ([...]). See <ulink
|
([...]). See <ulink
|
||||||
url="/manpages/shorewall-ipsets.html">shorewall-ipsets(5)</ulink>
|
url="/manpages/shorewall-ipsets.html">shorewall-ipsets(5)</ulink> for
|
||||||
for details.</para>
|
details.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -108,12 +108,12 @@
|
|||||||
Beginning with Shorewall 4.6.0, an ipset name (prefixed with '+')
|
Beginning with Shorewall 4.6.0, an ipset name (prefixed with '+')
|
||||||
may be used if your kernel and ip6tables have the <firstterm>Basic
|
may be used if your kernel and ip6tables have the <firstterm>Basic
|
||||||
Ematch</firstterm> capability and you set BASIC_FILTERS=Yes in
|
Ematch</firstterm> capability and you set BASIC_FILTERS=Yes in
|
||||||
<ulink url="/manpages/shorewall.conf.html">shorewall.conf
|
<ulink url="/manpages/shorewall.conf.html">shorewall.conf (5)</ulink>. The
|
||||||
(5)</ulink>. The ipset name may optionally be followed by a number
|
ipset name may optionally be followed by a number or a comma
|
||||||
or a comma separated list of src and/or dst enclosed in square
|
separated list of src and/or dst enclosed in square brackets
|
||||||
brackets ([...]). See <ulink
|
([...]). See <ulink
|
||||||
url="/manpages/shorewall-ipsets.html">shorewall-ipsets(5)</ulink>
|
url="/manpages/shorewall-ipsets.html">shorewall-ipsets(5)</ulink> for
|
||||||
for details.</para>
|
details.</para>
|
||||||
|
|
||||||
<para>You may exclude certain hosts from the set already defined
|
<para>You may exclude certain hosts from the set already defined
|
||||||
through use of an <emphasis>exclusion</emphasis> (see <ulink
|
through use of an <emphasis>exclusion</emphasis> (see <ulink
|
||||||
@@ -288,7 +288,7 @@
|
|||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 1:</term>
|
<term>Example 1:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Place all 'ping' traffic on interface 1 in class 10. Note that
|
<para>Place all 'ping' traffic on interface 1 in class 10. Note that
|
||||||
@@ -310,7 +310,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 2:</term>
|
<term>Example 2:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Add two filters with priority 10 (Shorewall 4.5.8 or
|
<para>Add two filters with priority 10 (Shorewall 4.5.8 or
|
||||||
@@ -324,22 +324,6 @@
|
|||||||
1:10 0.0.0.0/0 0.0.0.0/0 icmp echo-reply 10</programlisting>
|
1:10 0.0.0.0/0 0.0.0.0/0 icmp echo-reply 10</programlisting>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>IPv6 Example 1:</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Add two filters with priority 10 (Shorewall 4.5.8 or
|
|
||||||
later).</para>
|
|
||||||
|
|
||||||
<programlisting> #CLASS SOURCE DEST PROTO DPORT PRIORITY
|
|
||||||
|
|
||||||
IPV6
|
|
||||||
|
|
||||||
1:10 ::/0 ::/0 icmp echo-request 10
|
|
||||||
1:10 ::/0 ::/0 icmp echo-reply 10</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
@@ -347,8 +331,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/tcfilters</para>
|
<para>/etc/shorewall/tcfilters</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/tcfilters</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -366,6 +348,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-ecn(5), shorewall-exclusion(5),
|
||||||
|
shorewall-hosts(5), shorewall_interfaces(5), shorewall-ipsets(5),
|
||||||
|
shorewall-maclist(5), shorewall-masq(5), shorewall-nat(5),
|
||||||
|
shorewall-netmap(5), shorewall-params(5), shorewall-policy(5),
|
||||||
|
shorewall-providers(5), shorewall-proxyarp(5), shorewall-rtrules(5),
|
||||||
|
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-tos(5), shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/tcinterfaces</command>
|
<command>/etc/shorewall/tcinterfaces</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -172,9 +172,7 @@
|
|||||||
how often the rate is estimated and how many samples are retained
|
how often the rate is estimated and how many samples are retained
|
||||||
for estimating. Please see <ulink
|
for estimating. Please see <ulink
|
||||||
url="http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt">http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt</ulink>
|
url="http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt">http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt</ulink>
|
||||||
for details. If not specified, the default
|
for details.</para>
|
||||||
<replaceable>interval</replaceable> is 250ms and the default
|
|
||||||
<replaceable>decay_interval</replaceable> is 4sec.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -203,9 +201,7 @@
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/tcinterfaces</para>
|
<para>/etc/shorewall/tcinterfaces.</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/tcinterfaces</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -217,6 +213,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt">http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt</ulink></para>
|
url="http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt">http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcpri(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/tcpri</command>
|
<command>/etc/shorewall/tcpri</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -148,8 +148,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/tcpri</para>
|
<para>/etc/shorewall/tcpri</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/tcpri</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -158,6 +156,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>prio(8), shorewall(8)</para>
|
<para>prio(8), shorewall(8), shorewall-accounting(5),
|
||||||
|
shorewall-actions(5), shorewall-blacklist(5), shorewall-hosts(5),
|
||||||
|
shorewall_interfaces(5), shorewall-ipsets(5), shorewall-maclist(5),
|
||||||
|
shorewall-masq(5), shorewall-nat(5), shorewall-netmap(5),
|
||||||
|
shorewall-params(5), shorewall-policy(5), shorewall-providers(5),
|
||||||
|
shorewall-proxyarp(5), shorewall-rtrules(5), shorewall-routestopped(5),
|
||||||
|
shorewall-rules(5), shorewall.conf(5), shorewall-secmarks(5),
|
||||||
|
shorewall-tcclasses(5), shorewall-tcdevices(5), shorewall-mangle(5),
|
||||||
|
shorewall-tos(5), shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/tunnels</command>
|
<command>/etc/shorewall/tunnels</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -173,7 +173,7 @@
|
|||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 1:</term>
|
<term>Example 1:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPSec tunnel.</para>
|
<para>IPSec tunnel.</para>
|
||||||
@@ -187,7 +187,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 2:</term>
|
<term>Example 2:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Road Warrior (LapTop that may connect from anywhere) where the
|
<para>Road Warrior (LapTop that may connect from anywhere) where the
|
||||||
@@ -199,7 +199,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 3:</term>
|
<term>Example 3:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Host 4.33.99.124 is a standalone system connected via an ipsec
|
<para>Host 4.33.99.124 is a standalone system connected via an ipsec
|
||||||
@@ -211,7 +211,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 4:</term>
|
<term>Example 4:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Road Warriors that may belong to zones vpn1, vpn2 or vpn3. The
|
<para>Road Warriors that may belong to zones vpn1, vpn2 or vpn3. The
|
||||||
@@ -225,7 +225,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 5:</term>
|
<term>Example 5:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You run the Linux PPTP client on your firewall and connect to
|
<para>You run the Linux PPTP client on your firewall and connect to
|
||||||
@@ -237,7 +237,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 6:</term>
|
<term>Example 6:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You run a PPTP server on your firewall.</para>
|
<para>You run a PPTP server on your firewall.</para>
|
||||||
@@ -260,7 +260,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 8:</term>
|
<term>Example 8:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>You have a tunnel that is not one of the supported types. Your
|
<para>You have a tunnel that is not one of the supported types. Your
|
||||||
@@ -273,7 +273,7 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>IPv4 Example 9:</term>
|
<term>Example 9:</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>TINC tunnel where the remote gateways are not specified. If
|
<para>TINC tunnel where the remote gateways are not specified. If
|
||||||
@@ -284,83 +284,6 @@
|
|||||||
tinc net 0.0.0.0/0</programlisting>
|
tinc net 0.0.0.0/0</programlisting>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>IPv6 Example 1:</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>IPSec tunnel.</para>
|
|
||||||
|
|
||||||
<para>The remote gateway is 2001:cec792b4:1::44. The tunnel does not
|
|
||||||
use the AH protocol</para>
|
|
||||||
|
|
||||||
<programlisting> #TYPE ZONE GATEWAY
|
|
||||||
ipsec:noah net 2002:cec792b4:1::44</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>IPv6 Example 2:</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Road Warrior (LapTop that may connect from anywhere) where the
|
|
||||||
"gw" zone is used to represent the remote LapTop</para>
|
|
||||||
|
|
||||||
<programlisting> #TYPE ZONE GATEWAY GATEWAY ZONES
|
|
||||||
ipsec net ::/0 gw</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>IPv6 Example 3:</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Host 2001:cec792b4:1::44 is a standalone system connected via
|
|
||||||
an ipsec tunnel to the firewall system. The host is in zone
|
|
||||||
gw.</para>
|
|
||||||
|
|
||||||
<programlisting> #TYPE ZONE GATEWAY GATEWAY ZONES
|
|
||||||
ipsec net 2001:cec792b4:1::44 gw</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>IPv6 Example 4:</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>OPENVPN tunnel. The remote gateway is 2001:cec792b4:1::44 and
|
|
||||||
openvpn uses port 7777.</para>
|
|
||||||
|
|
||||||
<programlisting> #TYPE ZONE GATEWAY GATEWAY ZONES
|
|
||||||
openvpn:7777 net 2001:cec792b4:1::44</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>IPv6 Example 8:</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>You have a tunnel that is not one of the supported types. Your
|
|
||||||
tunnel uses UDP port 4444. The other end of the tunnel is
|
|
||||||
2001:cec792b4:1::44.</para>
|
|
||||||
|
|
||||||
<programlisting> #TYPE ZONE GATEWAY GATEWAY ZONES
|
|
||||||
generic:udp:4444 net 2001:cec792b4:1::44</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>IPv6 Example 9:</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>TINC tunnel where the remote gateways are not specified. If
|
|
||||||
you wish to specify a list of gateways, you can do so in the GATEWAY
|
|
||||||
column.</para>
|
|
||||||
|
|
||||||
<programlisting> #TYPE ZONE GATEWAY GATEWAY ZONES
|
|
||||||
tinc net ::/0</programlisting>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
@@ -368,8 +291,6 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/tunnels</para>
|
<para>/etc/shorewall/tunnels</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/tunnels</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -378,6 +299,14 @@
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcclasses(5),
|
||||||
|
shorewall-tcdevices(5), shorewall-mangle(5), shorewall-tos(5),
|
||||||
|
shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall[6]/vardir</command>
|
<command>/etc/shorewall/vardir</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
@@ -28,8 +28,7 @@
|
|||||||
<para>This file does not exist by default. You may create the file if you
|
<para>This file does not exist by default. You may create the file if you
|
||||||
want to change the directory used by Shorewall to store state information,
|
want to change the directory used by Shorewall to store state information,
|
||||||
including compiled firewall scripts. By default, the directory used is
|
including compiled firewall scripts. By default, the directory used is
|
||||||
<filename>/var/lib/shorewall/</filename> for IPv4 and /var/lib/shorewall6/
|
<filename>/var/lib/shorewall/</filename>.</para>
|
||||||
for IPv6</para>
|
|
||||||
|
|
||||||
<para>The file contains a single variable assignment:</para>
|
<para>The file contains a single variable assignment:</para>
|
||||||
|
|
||||||
@@ -51,13 +50,19 @@
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/vardir</para>
|
<para>/etc/shorewall/vardir</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/vardir</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>See ALSO</title>
|
<title>See ALSO</title>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall.conf(5), shorewall-secmarks(5), shorewall-tcclasses(5),
|
||||||
|
shorewall-tcdevices(5), shorewall-mangle(5), shorewall-tos(5),
|
||||||
|
shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -107,7 +107,7 @@
|
|||||||
<simplelist>
|
<simplelist>
|
||||||
<member>2 + 6 + 2*M + 1 = 29</member>
|
<member>2 + 6 + 2*M + 1 = 29</member>
|
||||||
|
|
||||||
<member>2M = 29 - 2 - 6 - 1 = 20</member>
|
<member>2M = 29 - 2 + 6 + 1 = 20</member>
|
||||||
|
|
||||||
<member>M = 10</member>
|
<member>M = 10</member>
|
||||||
</simplelist>
|
</simplelist>
|
||||||
@@ -128,9 +128,9 @@
|
|||||||
<para>Example:</para>
|
<para>Example:</para>
|
||||||
|
|
||||||
<programlisting>#ZONE TYPE OPTIONS IN OPTIONS OUT OPTIONS
|
<programlisting>#ZONE TYPE OPTIONS IN OPTIONS OUT OPTIONS
|
||||||
a ip
|
a ipv4
|
||||||
b ip
|
b ipv4
|
||||||
c:a,b ip</programlisting>
|
c:a,b ipv4</programlisting>
|
||||||
|
|
||||||
<para>Currently, Shorewall uses this information to reorder the zone
|
<para>Currently, Shorewall uses this information to reorder the zone
|
||||||
list so that parent zones appear after their subzones in the list.
|
list so that parent zones appear after their subzones in the list.
|
||||||
@@ -140,8 +140,8 @@ c:a,b ip</programlisting>
|
|||||||
|
|
||||||
<para>Where an <emphasis role="bold">ipsec</emphasis> zone is
|
<para>Where an <emphasis role="bold">ipsec</emphasis> zone is
|
||||||
explicitly included as a child of an <emphasis
|
explicitly included as a child of an <emphasis
|
||||||
role="bold">ip</emphasis> zone, the ruleset allows CONTINUE policies
|
role="bold">ipv4</emphasis> zone, the ruleset allows CONTINUE
|
||||||
(explicit or implicit) to work as expected.</para>
|
policies (explicit or implicit) to work as expected.</para>
|
||||||
|
|
||||||
<para>In the future, Shorewall may make additional use of nesting
|
<para>In the future, Shorewall may make additional use of nesting
|
||||||
information.</para>
|
information.</para>
|
||||||
@@ -154,7 +154,7 @@ c:a,b ip</programlisting>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">ip</emphasis></term>
|
<term><emphasis role="bold">ipv4</emphasis></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>This is the standard Shorewall zone type and is the
|
<para>This is the standard Shorewall zone type and is the
|
||||||
@@ -162,22 +162,17 @@ c:a,b ip</programlisting>
|
|||||||
the column. Communication with some zone hosts may be
|
the column. Communication with some zone hosts may be
|
||||||
encrypted. Encrypted hosts are designated using the 'ipsec'
|
encrypted. Encrypted hosts are designated using the 'ipsec'
|
||||||
option in <ulink
|
option in <ulink
|
||||||
url="/manpages/shorewall-hosts.html">shorewall-hosts</ulink>(5).
|
url="/manpages/shorewall-hosts.html">shorewall-hosts</ulink>(5).</para>
|
||||||
For clarity, this zone type may be specified as
|
|
||||||
<option>ipv4</option> in IPv4 configurations and
|
|
||||||
<option>ipv6</option> in IPv6 configurations.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">ipsec</emphasis></term>
|
<term><emphasis role="bold">ipsec</emphasis> (or <emphasis
|
||||||
|
role="bold">ipsec4</emphasis>)</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Communication with all zone hosts is encrypted. Your
|
<para>Communication with all zone hosts is encrypted. Your
|
||||||
kernel and iptables must include policy match support. For
|
kernel and iptables must include policy match support.</para>
|
||||||
clarity, this zone type may be specified as
|
|
||||||
<option>ipsec4</option> in IPv4 configurations and
|
|
||||||
<option>ipsec6</option> in IPv6 configurations.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -195,13 +190,12 @@ c:a,b ip</programlisting>
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">bport</emphasis></term>
|
<term><emphasis role="bold">bport</emphasis> (or <emphasis
|
||||||
|
role="bold">bport4</emphasis>)</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>The zone is associated with one or more ports on a
|
<para>The zone is associated with one or more ports on a
|
||||||
single bridge. For clarity, this zone type may be specified as
|
single bridge.</para>
|
||||||
<option>bport4</option> in IPv4 configurations and
|
|
||||||
<option>bport6</option> in IPv6 configurations.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -430,8 +424,6 @@ c:a,b ip</programlisting>
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/zones</para>
|
<para>/etc/shorewall/zones</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/zones</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
@@ -443,6 +435,13 @@ c:a,b ip</programlisting>
|
|||||||
<para><ulink
|
<para><ulink
|
||||||
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-hosts(5), shorewall_interfaces(5), shorewall-ipsets(5),
|
||||||
|
shorewall-maclist(5), shorewall-masq(5), shorewall-nat(5),
|
||||||
|
shorewall-nesting(8), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-rules(5), shorewall.conf(5),
|
||||||
|
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
|
||||||
|
shorewall-mangle(5), shorewall-tos(5), shorewall-tunnels(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -20,24 +20,15 @@
|
|||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/etc/shorewall/shorewall.conf</command>
|
<command>/etc/shorewall/shorewall.conf</command>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
|
|
||||||
<cmdsynopsis>
|
|
||||||
<command>/etc/shorewall6/shorewall6.conf</command>
|
|
||||||
</cmdsynopsis>
|
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
|
|
||||||
<para>The IPv4 and IPv6 environments each have their own configuration.
|
<para>This file sets options that apply to Shorewall as a whole.</para>
|
||||||
The IPv4 configuration resides in /etc/shorewall/ while the IPv6
|
|
||||||
configuration resides in /etc/shorewall6/.</para>
|
|
||||||
|
|
||||||
<para>The .conf files set options that apply to Shorewall and Shorewall6
|
<para>The file consists of Shell comments (lines beginning with '#'),
|
||||||
as a whole.</para>
|
blank lines and assignment statements
|
||||||
|
|
||||||
<para>The .conf files consist of Shell comments (lines beginning with
|
|
||||||
'#'), blank lines and assignment statements
|
|
||||||
(<emphasis>variable</emphasis>=<emphasis>value</emphasis>). If the
|
(<emphasis>variable</emphasis>=<emphasis>value</emphasis>). If the
|
||||||
<emphasis>value</emphasis> contains shell meta characters or white-space,
|
<emphasis>value</emphasis> contains shell meta characters or white-space,
|
||||||
then it must be enclosed in quotes. Example:
|
then it must be enclosed in quotes. Example:
|
||||||
@@ -74,13 +65,16 @@
|
|||||||
level to choose, 6 (info) is a safe bet. You may specify levels by name or
|
level to choose, 6 (info) is a safe bet. You may specify levels by name or
|
||||||
by number.</para>
|
by number.</para>
|
||||||
|
|
||||||
<para>If you have built your kernel with ULOG (IPv4 only) and/or NFLOG
|
<para>If you have built your kernel with ULOG and/or NFLOG target support,
|
||||||
target support, you may also specify a log level of ULOG and/or NFLOG
|
you may also specify a log level of ULOG and/or NFLOG (must be all caps).
|
||||||
(must be all caps). Rather than log its messages to syslogd, Shorewall
|
Rather than log its messages to syslogd, Shorewall will direct netfilter
|
||||||
will direct netfilter to log the messages via the ULOG or NFLOG target
|
to log the messages via the ULOG or NFLOG target which will send them to a
|
||||||
which will send them to a process called 'ulogd'. ulogd is available with
|
process called 'ulogd'. ulogd is available with most Linux distributions
|
||||||
most Linux distributions (although it probably isn't installed by
|
(although it probably isn't installed by default). Ulogd is also available
|
||||||
default).</para>
|
from <ulink
|
||||||
|
url="http://www.netfilter.org/projects/ulogd/index.html">http://www.netfilter.org/projects/ulogd/index.html</ulink>
|
||||||
|
and can be configured to log all Shorewall messages to their own log
|
||||||
|
file.</para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>If you want to specify parameters to ULOG or NFLOG (e.g.,
|
<para>If you want to specify parameters to ULOG or NFLOG (e.g.,
|
||||||
@@ -88,7 +82,7 @@
|
|||||||
|
|
||||||
<para>Example:</para>
|
<para>Example:</para>
|
||||||
|
|
||||||
<programlisting>LOG_LEVEL="NFLOG(1,0,1)"</programlisting>
|
<programlisting>MACLIST_LOG_LEVEL="NFLOG(1,0,1)"</programlisting>
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
<para>Beginning with Shorewall 5.0.0, the log level may be followed by a
|
<para>Beginning with Shorewall 5.0.0, the log level may be followed by a
|
||||||
@@ -271,9 +265,8 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>This parameter determines whether Shorewall automatically adds
|
<para>This parameter determines whether Shorewall automatically adds
|
||||||
the external address(es) in <ulink
|
the external address(es) in <ulink
|
||||||
url="/manpages/shorewall-nat.html">shorewall-nat</ulink>(5), and is
|
url="/manpages/shorewall-nat.html">shorewall-nat</ulink>(5). If the
|
||||||
only available in IPv4 configurations. If the variable is set to
|
variable is set to <emphasis role="bold">Yes</emphasis> or <emphasis
|
||||||
<emphasis role="bold">Yes</emphasis> or <emphasis
|
|
||||||
role="bold">yes</emphasis> then Shorewall automatically adds these
|
role="bold">yes</emphasis> then Shorewall automatically adds these
|
||||||
aliases. If it is set to <emphasis role="bold">No</emphasis> or
|
aliases. If it is set to <emphasis role="bold">No</emphasis> or
|
||||||
<emphasis role="bold">no</emphasis>, you must add these aliases
|
<emphasis role="bold">no</emphasis>, you must add these aliases
|
||||||
@@ -300,14 +293,13 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>This parameter determines whether Shorewall automatically adds
|
<para>This parameter determines whether Shorewall automatically adds
|
||||||
the SNAT ADDRESS in <ulink
|
the SNAT ADDRESS in <ulink
|
||||||
url="/manpages/shorewall-masq.html">shorewall-masq</ulink>(5), and
|
url="/manpages/shorewall-masq.html">shorewall-masq</ulink>(5). If
|
||||||
is only available in IPv4 configurations. If the variable is set to
|
the variable is set to <emphasis role="bold">Yes</emphasis> or
|
||||||
<emphasis role="bold">Yes</emphasis> or <emphasis
|
<emphasis role="bold">yes</emphasis> then Shorewall automatically
|
||||||
role="bold">yes</emphasis> then Shorewall automatically adds these
|
adds these addresses. If it is set to <emphasis
|
||||||
addresses. If it is set to <emphasis role="bold">No</emphasis> or
|
role="bold">No</emphasis> or <emphasis role="bold">no</emphasis>,
|
||||||
<emphasis role="bold">no</emphasis>, you must add these addresses
|
you must add these addresses yourself using your distribution's
|
||||||
yourself using your distribution's network configuration
|
network configuration tools.</para>
|
||||||
tools.</para>
|
|
||||||
|
|
||||||
<para>If this variable is not set or is given an empty value
|
<para>If this variable is not set or is given an empty value
|
||||||
(ADD_SNAT_ALIASES="") then ADD_SNAT_ALIASES=No is assumed.</para>
|
(ADD_SNAT_ALIASES="") then ADD_SNAT_ALIASES=No is assumed.</para>
|
||||||
@@ -387,10 +379,10 @@
|
|||||||
role="bold">ARPTABLES=</emphasis>[<emphasis>pathname</emphasis>]</term>
|
role="bold">ARPTABLES=</emphasis>[<emphasis>pathname</emphasis>]</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Added in Shorewall 4.5.12 and available in IPv4 only. This
|
<para>Added in Shorewall 4.5.12. This parameter names the arptables
|
||||||
parameter names the arptables executable to be used by Shorewall. If
|
executable to be used by Shorewall. If not specified or if specified
|
||||||
not specified or if specified as a null value, then the arptables
|
as a null value, then the arptables executable located using the
|
||||||
executable located using the PATH option is used.</para>
|
PATH option is used.</para>
|
||||||
|
|
||||||
<para>Regardless of how the arptables utility is located (specified
|
<para>Regardless of how the arptables utility is located (specified
|
||||||
via arptables= or located via PATH), Shorewall uses the
|
via arptables= or located via PATH), Shorewall uses the
|
||||||
@@ -406,9 +398,8 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>Formerly named AUTO_COMMENT. If set, if there is not a current
|
<para>Formerly named AUTO_COMMENT. If set, if there is not a current
|
||||||
comment when a macro is invoked, the behavior is as if the first
|
comment when a macro is invoked, the behavior is as if the first
|
||||||
line of the macro file was "COMMENT <macro name>". If not
|
line of the macro file was "COMMENT <macro name>". The
|
||||||
specified, the AUTO_COMMENT option has a default value of
|
AUTO_COMMENT option has a default value of 'Yes'.</para>
|
||||||
'Yes'.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -474,7 +465,7 @@
|
|||||||
command, then the compilation step is skipped and the compiled
|
command, then the compilation step is skipped and the compiled
|
||||||
script that executed the last <command>start</command>, <emphasis
|
script that executed the last <command>start</command>, <emphasis
|
||||||
role="bold">reload</emphasis> or <command>restart</command> command
|
role="bold">reload</emphasis> or <command>restart</command> command
|
||||||
is used. If not specified, the default is AUTOMAKE=No.</para>
|
is used. The default is AUTOMAKE=No.</para>
|
||||||
|
|
||||||
<para>The setting of the AUTOMAKE option is ignored if the
|
<para>The setting of the AUTOMAKE option is ignored if the
|
||||||
<command>start</command>, <emphasis role="bold">reload</emphasis> or
|
<command>start</command>, <emphasis role="bold">reload</emphasis> or
|
||||||
@@ -492,8 +483,8 @@
|
|||||||
<para>Added in Shorewall 5.1.1. When USE_DEFAULT_RT=Yes, this option
|
<para>Added in Shorewall 5.1.1. When USE_DEFAULT_RT=Yes, this option
|
||||||
determines whether the <option>balance</option> provider option (see
|
determines whether the <option>balance</option> provider option (see
|
||||||
<ulink
|
<ulink
|
||||||
url="/manpages/shorewall-providers.html">shorewall-providers(5)</ulink>)
|
url="/manpages/shorewall-providers.html">shorewall-providers(5)</ulink>) is
|
||||||
is the default. When BALANCE_PROVIDERS=Yes, then the
|
the default. When BALANCE_PROVIDERS=Yes, then the
|
||||||
<option>balance</option> option is assumed unless the
|
<option>balance</option> option is assumed unless the
|
||||||
<option>fallback</option>, <option>loose</option>,
|
<option>fallback</option>, <option>loose</option>,
|
||||||
<option>load</option> or <option>tproxy</option> option is
|
<option>load</option> or <option>tproxy</option> option is
|
||||||
@@ -509,8 +500,8 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>Added in Shorewall-4.6.0. When set to <emphasis
|
<para>Added in Shorewall-4.6.0. When set to <emphasis
|
||||||
role="bold">Yes</emphasis>, causes entries in <ulink
|
role="bold">Yes</emphasis>, causes entries in <ulink
|
||||||
url="/manpages/shorewall-tcfilters.html">shorewall-tcfilters(5)</ulink>
|
url="/manpages/shorewall-tcfilters.html">shorewall-tcfilters(5)</ulink> to
|
||||||
to generate a basic filter rather than a u32 filter. This setting
|
generate a basic filter rather than a u32 filter. This setting
|
||||||
requires the <firstterm>Basic Ematch</firstterm> capability in your
|
requires the <firstterm>Basic Ematch</firstterm> capability in your
|
||||||
kernel and iptables.</para>
|
kernel and iptables.</para>
|
||||||
|
|
||||||
@@ -633,11 +624,6 @@
|
|||||||
marking defined in <ulink
|
marking defined in <ulink
|
||||||
url="/manpages/shorewall-tcrules.html">shorewall-tcrules</ulink>(5).
|
url="/manpages/shorewall-tcrules.html">shorewall-tcrules</ulink>(5).
|
||||||
If not specified, CLEAR_TC=Yes is assumed.</para>
|
If not specified, CLEAR_TC=Yes is assumed.</para>
|
||||||
|
|
||||||
<warning>
|
|
||||||
<para>When you specify TC_ENABLED=shared (see below), then you
|
|
||||||
should also specify CLEAR_TC=No.</para>
|
|
||||||
</warning>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -673,20 +659,20 @@
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis
|
<term><emphasis
|
||||||
role="bold">CONFIG_PATH</emphasis>=[[:]<emphasis>directory</emphasis>[:<emphasis>directory</emphasis>]...]</term>
|
role="bold">CONFIG_PATH</emphasis>=[<emphasis>directory</emphasis>[:<emphasis>directory</emphasis>]...]</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Specifies where configuration files other than
|
<para>Specifies where configuration files other than shorewall.conf
|
||||||
shorewall[6].conf may be found. CONFIG_PATH is specifies as a list
|
may be found. CONFIG_PATH is specifies as a list of directory names
|
||||||
of directory names separated by colons (":"). When looking for a
|
separated by colons (":"). When looking for a configuration
|
||||||
configuration file:</para>
|
file:</para>
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>If the command is "try" or a "<configuration
|
<para>If the command is "try" or a "<configuration
|
||||||
directory>" was specified in the command (e.g.,
|
directory>" was specified in the command (e.g.,
|
||||||
<command>shorewall [-6] check ./gateway</command>) then the
|
<command>shorewall check ./gateway</command>) then the directory
|
||||||
directory given in the command is searched first.</para>
|
given in the command is searched first.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -701,16 +687,6 @@
|
|||||||
/etc/shorewall:/usr/share/shorewall but your particular distribution
|
/etc/shorewall:/usr/share/shorewall but your particular distribution
|
||||||
may set it differently. See the output of shorewall show config for
|
may set it differently. See the output of shorewall show config for
|
||||||
the default on your system.</para>
|
the default on your system.</para>
|
||||||
|
|
||||||
<para>Beginning with Shorewall 5.1.10, the CONFIG_PATH setting may
|
|
||||||
begin with a colon (":"), to signal that the first
|
|
||||||
<replaceable>directory</replaceable> listed will be skipped if the
|
|
||||||
user performing a compilation is not root or if the configuration is
|
|
||||||
being compiled for export (-e option specified or if running one of
|
|
||||||
the remote-* commands) . This prevents the compiler from looking in
|
|
||||||
<filename>/etc/shorewall[6]</filename>/ when compilation is being
|
|
||||||
done by a non-root user or if the generated script is to be sent to
|
|
||||||
a remote firewall system.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -721,8 +697,8 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>Added in Shorewall 4.5.12. When set to 'Yes' (the default),
|
<para>Added in Shorewall 4.5.12. When set to 'Yes' (the default),
|
||||||
DNS names are validated in the compiler and then passed on to the
|
DNS names are validated in the compiler and then passed on to the
|
||||||
generated script where they are resolved by ip[6]tables-restore.
|
generated script where they are resolved by iptables-restore. This
|
||||||
This is an advantage if you use AUTOMAKE=Yes and the IP address
|
is an advantage if you use AUTOMAKE=Yes and the IP address
|
||||||
associated with the DNS name is subject to change. When
|
associated with the DNS name is subject to change. When
|
||||||
DEFER_DNS_RESOLUTION=No, DNS names are converted into IP addresses
|
DEFER_DNS_RESOLUTION=No, DNS names are converted into IP addresses
|
||||||
by the compiler. This has the advantage that when AUTOMAKE=Yes, the
|
by the compiler. This has the advantage that when AUTOMAKE=Yes, the
|
||||||
@@ -730,14 +706,6 @@
|
|||||||
and <command>restart</command> commands will succeed even if no DNS
|
and <command>restart</command> commands will succeed even if no DNS
|
||||||
server is reachable (assuming that the configuration hasn't changed
|
server is reachable (assuming that the configuration hasn't changed
|
||||||
since the compiled script was last generated).</para>
|
since the compiled script was last generated).</para>
|
||||||
|
|
||||||
<important>
|
|
||||||
<para>When DEFER_DNS_RESOLUTION=No and AUTOMAKE=Yes and a DNS
|
|
||||||
change makes it necessary to recompile an existing firewall
|
|
||||||
script, the <option>-c</option> option must be used with the
|
|
||||||
<command>reload</command> or <command>restart</command> command to
|
|
||||||
force recompilation.</para>
|
|
||||||
</important>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -747,7 +715,7 @@
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>If set to Yes (the default value), entries in the
|
<para>If set to Yes (the default value), entries in the
|
||||||
/etc/shorewall[6]/rtrules files cause an 'ip rule del' command to be
|
/etc/shorewall/rtrules files cause an 'ip rule del' command to be
|
||||||
generated in addition to an 'ip rule add' command. Setting this
|
generated in addition to an 'ip rule add' command. Setting this
|
||||||
option to No, causes the 'ip rule del' command to be omitted.</para>
|
option to No, causes the 'ip rule del' command to be omitted.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@@ -758,8 +726,6 @@
|
|||||||
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
|
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only.</para>
|
|
||||||
|
|
||||||
<para>If set to <emphasis role="bold">Yes</emphasis> or <emphasis
|
<para>If set to <emphasis role="bold">Yes</emphasis> or <emphasis
|
||||||
role="bold">yes</emphasis>, Shorewall will detect the first IP
|
role="bold">yes</emphasis>, Shorewall will detect the first IP
|
||||||
address of the interface to the source zone and will include this
|
address of the interface to the source zone and will include this
|
||||||
@@ -776,8 +742,6 @@
|
|||||||
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
|
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only.</para>
|
|
||||||
|
|
||||||
<para>If set to <emphasis role="bold">Yes</emphasis> or <emphasis
|
<para>If set to <emphasis role="bold">Yes</emphasis> or <emphasis
|
||||||
role="bold">yes</emphasis>, IPv6 traffic to, from and through the
|
role="bold">yes</emphasis>, IPv6 traffic to, from and through the
|
||||||
firewall system is disabled. If set to <emphasis
|
firewall system is disabled. If set to <emphasis
|
||||||
@@ -797,8 +761,7 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Change DISABLE_IPV6=Yes to DISABLE_IPV6=No in
|
<para>Change DISABLE_IPV6=Yes to DISABLE_IPV6=No</para>
|
||||||
<filename>/etc/shorewall/shorewall.conf</filename>.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -844,21 +807,20 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>Added in Shorewall 4.4.7. When set to <emphasis
|
<para>Added in Shorewall 4.4.7. When set to <emphasis
|
||||||
role="bold">No</emphasis> or <emphasis role="bold">no</emphasis>,
|
role="bold">No</emphasis> or <emphasis role="bold">no</emphasis>,
|
||||||
chain-based dynamic blacklisting using <command>shorewall [-6] [-l]
|
chain-based dynamic blacklisting using <command>shorewall
|
||||||
drop</command>, <command>shorewall [-6] [-l] reject</command>,
|
drop</command>, <command>shorewall reject</command>,
|
||||||
<command>shorewall logdrop</command> and <command>shorewall [-6]
|
<command>shorewall logdrop</command> and <command>shorewall
|
||||||
[-l] logreject</command> is disabled. Default is <emphasis
|
logreject</command> is disabled. Default is <emphasis
|
||||||
role="bold">Yes</emphasis>. Beginning with Shorewall 5.0.8,
|
role="bold">Yes</emphasis>. Beginning with Shorewall 5.0.8,
|
||||||
ipset-based dynamic blacklisting using the <command>shorewall
|
ipset-based dynamic blacklisting using the <command>shorewall
|
||||||
blacklist</command> command is also supported. The name of the set
|
blacklist</command> command is also supported. The name of the set
|
||||||
(<replaceable>setname</replaceable>) and the level
|
(<replaceable>setname</replaceable>) and the level
|
||||||
(<replaceable>log_level</replaceable>), if any, at which blacklisted
|
(<replaceable>log_level</replaceable>), if any, at which blacklisted
|
||||||
traffic is to be logged may also be specified. The default IPv4 set
|
traffic is to be logged may also be specified. The default set name
|
||||||
name is SW_DBL4 and the default IPv6 set name is SW_DBL6. The
|
is SW_DBL4 and the default log level is <option>none</option> (no
|
||||||
default log level is <option>none</option> (no logging). If
|
logging). If <option>ipset-only</option> is given, then chain-based
|
||||||
<option>ipset-only</option> is given, then chain-based dynamic
|
dynamic blacklisting is disabled just as if DYNAMIC_BLACKLISTING=No
|
||||||
blacklisting is disabled just as if DYNAMIC_BLACKLISTING=No had been
|
had been specified.</para>
|
||||||
specified.</para>
|
|
||||||
|
|
||||||
<para>Possible <replaceable>option</replaceable>s are:</para>
|
<para>Possible <replaceable>option</replaceable>s are:</para>
|
||||||
|
|
||||||
@@ -904,9 +866,9 @@
|
|||||||
<important>
|
<important>
|
||||||
<para>Once the dynamic blacklisting ipset has been created,
|
<para>Once the dynamic blacklisting ipset has been created,
|
||||||
changing this option setting requires a complete restart of
|
changing this option setting requires a complete restart of
|
||||||
the firewall; <command>shorewall [-6] restart</command> if
|
the firewall; <command>shorewall restart</command> if
|
||||||
RESTART=restart, otherwise <command>shorewall [-6] [-l] stop
|
RESTART=restart, otherwise <command>shorewall stop
|
||||||
&& shorewall [-6] [-l] start</command></para>
|
&& shorewall start</command></para>
|
||||||
</important>
|
</important>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -948,15 +910,13 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Added in Shorewall 4.4.17. When set to Yes when compiling for
|
<para>Added in Shorewall 4.4.17. When set to Yes when compiling for
|
||||||
use by Shorewall Lite (<command>shorewall [-6]
|
use by Shorewall Lite (<command>shorewall load</command>,
|
||||||
remote-start</command>, <command>shorewall [-6] remote-reload,
|
<command>shorewall reload </command>or <command>shorewall
|
||||||
shorewall [-6] remote-restart </command>or <command>shorewall [-6]
|
|
||||||
export</command> commands), the compiler will copy the modules or
|
export</command> commands), the compiler will copy the modules or
|
||||||
helpers file from the administrative system into the script. When
|
helpers file from the administrative system into the script. When
|
||||||
set to No or not specified, the compiler will not copy the modules
|
set to No or not specified, the compiler will not copy the modules
|
||||||
or helpers file from <filename>/usr/share/shorewall[6]</filename>
|
or helpers file from <filename>/usr/share/shorewall</filename> but
|
||||||
but will copy those found in another location on the
|
will copy those found in another location on the CONFIG_PATH.</para>
|
||||||
CONFIG_PATH.</para>
|
|
||||||
|
|
||||||
<para>When compiling for direct use by Shorewall, causes the
|
<para>When compiling for direct use by Shorewall, causes the
|
||||||
contents of the local module or helpers file to be copied into the
|
contents of the local module or helpers file to be copied into the
|
||||||
@@ -1154,12 +1114,10 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
|||||||
specificaitons</ulink> on the right.. When INLINE_MATCHES=Yes is
|
specificaitons</ulink> on the right.. When INLINE_MATCHES=Yes is
|
||||||
specified, the specifications on the right are interpreted as if
|
specified, the specifications on the right are interpreted as if
|
||||||
INLINE had been specified in the ACTION column. This also applies to
|
INLINE had been specified in the ACTION column. This also applies to
|
||||||
<ulink url="/manpages/shorewall-masq.html">shorewall-masq(5)</ulink>
|
<ulink url="/manpages/shorewall-masq.html">shorewall-masq(5)</ulink> and
|
||||||
and <ulink
|
<ulink url="/manpages/shorewall-mangle.html">shorewall-mangle(5</ulink>) which
|
||||||
url="/manpages/shorewall-mangle.html">shorewall-mangle(5</ulink>)
|
also support INLINE. If not specified or if specified as the empty
|
||||||
which also support INLINE. If not specified or if specified as the
|
value, the value 'No' is assumed for backward compatibility.</para>
|
||||||
empty value, the value 'No' is assumed for backward
|
|
||||||
compatibility.</para>
|
|
||||||
|
|
||||||
<para>Beginning with Shorewall 5.0.0, it is no longer necessary to
|
<para>Beginning with Shorewall 5.0.0, it is no longer necessary to
|
||||||
set INLINE_MATCHES=Yes in order to be able to specify your own
|
set INLINE_MATCHES=Yes in order to be able to specify your own
|
||||||
@@ -1218,13 +1176,9 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
|||||||
role="bold">Keep</emphasis>]</term>
|
role="bold">Keep</emphasis>]</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>This IPv4 parameter determines whether Shorewall enables or
|
<para>This parameter determines whether Shorewall enables or
|
||||||
disables IPv4 Packet Forwarding
|
disables IPV4 Packet Forwarding (/proc/sys/net/ipv4/ip_forward).
|
||||||
(<filename>/proc/sys/net/ipv4/ip_forward</filename>). In an IPv6
|
Possible values are:</para>
|
||||||
configuration, this parameter determines the setting of
|
|
||||||
<filename>/proc/sys/net/ipv6/config/all/ip_forwarding</filename>.</para>
|
|
||||||
|
|
||||||
<para>Possible values are:</para>
|
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
@@ -1256,8 +1210,12 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
|
|
||||||
<para>If this variable is not set or is given an empty value
|
<para/>
|
||||||
(IP_FORWARD="") then IP_FORWARD=On is assumed.</para>
|
|
||||||
|
<blockquote>
|
||||||
|
<para>If this variable is not set or is given an empty value
|
||||||
|
(IP_FORWARD="") then IP_FORWARD=On is assumed.</para>
|
||||||
|
</blockquote>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -1300,8 +1258,6 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
|||||||
role="bold">IPTABLES=</emphasis>[<emphasis>pathname</emphasis>]</term>
|
role="bold">IPTABLES=</emphasis>[<emphasis>pathname</emphasis>]</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only.</para>
|
|
||||||
|
|
||||||
<para>This parameter names the iptables executable to be used by
|
<para>This parameter names the iptables executable to be used by
|
||||||
Shorewall. If not specified or if specified as a null value, then
|
Shorewall. If not specified or if specified as a null value, then
|
||||||
the iptables executable located using the PATH option is
|
the iptables executable located using the PATH option is
|
||||||
@@ -1314,71 +1270,22 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis
|
|
||||||
role="bold">IP6TABLES=</emphasis>[<emphasis>pathname</emphasis>]</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>IPv6 only.</para>
|
|
||||||
|
|
||||||
<para>This parameter names the ip6tables executable to be used by
|
|
||||||
Shorewall6. If not specified or if specified as a null value, then
|
|
||||||
the ip6tables executable located using the PATH option is
|
|
||||||
used.</para>
|
|
||||||
|
|
||||||
<para>Regardless of how the ip6tables utility is located (specified
|
|
||||||
via IP6TABLES= or located via PATH), Shorewall6 uses the
|
|
||||||
ip6tables-restore and ip6tables-save utilities from that same
|
|
||||||
directory.</para>
|
|
||||||
</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>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4:</para>
|
<para>When set to <option>Yes</option>, this option prevents
|
||||||
|
generated scripts from altering the /etc/iproute2/rt_tables database
|
||||||
<blockquote>
|
when there are entries in
|
||||||
<para>When set to <option>Yes</option>, this option prevents
|
<filename>/etc/shorewall/providers</filename>. If you set this
|
||||||
generated scripts from altering the /etc/iproute2/rt_tables
|
option to <option>Yes</option> while Shorewall (Shorewall-lite) is
|
||||||
database when there are entries in
|
running, you should remove the file
|
||||||
<filename>/etc/shorewall/providers</filename>. If you set this
|
<filename>/var/lib/shorewall/rt_tables</filename>
|
||||||
option to <option>Yes</option> while Shorewall (Shorewall-lite) is
|
(<filename>/var/lib/shorewall-lite/rt_tables</filename>) before your
|
||||||
running, you should remove the file
|
next <command>stop</command>, <command>refresh</command>,
|
||||||
<filename>/var/lib/shorewall/rt_tables</filename>
|
<command>restore</command>, <emphasis role="bold">reload</emphasis>
|
||||||
(<filename>/var/lib/shorewall-lite/rt_tables</filename>) before
|
or <command>restart</command> command.</para>
|
||||||
your next <command>stop</command>, <command>refresh</command>,
|
|
||||||
<command>restore</command>, <emphasis
|
|
||||||
role="bold">reload</emphasis> or <command>restart</command>
|
|
||||||
command.</para>
|
|
||||||
</blockquote>
|
|
||||||
|
|
||||||
<para>IPv6:</para>
|
|
||||||
|
|
||||||
<blockquote>
|
|
||||||
<para>When set to <option>Yes</option>, this option prevents
|
|
||||||
scripts generated by Shorewall6 from altering the
|
|
||||||
/etc/iproute2/rt_tables database when there are entries in
|
|
||||||
<filename>/etc/shorewall6/providers</filename>. If you set this
|
|
||||||
option to <option>Yes</option> while Shorewall6 (Shorewall6-lite)
|
|
||||||
is running, you should remove the file
|
|
||||||
<filename>/var/lib/shorewall6/rt_tables</filename>
|
|
||||||
(<filename>/var/lib/shorewall6-lite/rt_tables</filename>) before
|
|
||||||
your next <command>stop</command>, <command>refresh</command>,
|
|
||||||
<command>restore</command>, <emphasis
|
|
||||||
role="bold">reload</emphasis> or <command>restart</command>
|
|
||||||
command.</para>
|
|
||||||
</blockquote>
|
|
||||||
|
|
||||||
<important>
|
|
||||||
<para>When both IPv4 and IPv6 Shorewall configurations are
|
|
||||||
present, KEEP_RT_TABLES=No should be specified in only one of the
|
|
||||||
two configurations unless the two provider configurations are
|
|
||||||
identical with respect to interface and provider names and
|
|
||||||
numbers.</para>
|
|
||||||
</important>
|
|
||||||
|
|
||||||
<para>The default is KEEP_RT_TABLES=No.</para>
|
<para>The default is KEEP_RT_TABLES=No.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@@ -1391,9 +1298,9 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>Added in Shorewall 4.4.7. When set to Yes, restricts the set
|
<para>Added in Shorewall 4.4.7. When set to Yes, restricts the set
|
||||||
of modules loaded by shorewall to those listed in
|
of modules loaded by shorewall to those listed in
|
||||||
<filename>/var/lib/shorewall[6]/helpers</filename> and those that
|
/var/lib/shorewall/helpers and those that are actually used. When
|
||||||
are actually used. When not set, or set to the empty value,
|
not set, or set to the empty value, LOAD_HELPERS_ONLY=No is
|
||||||
LOAD_HELPERS_ONLY=No is assumed.</para>
|
assumed.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -1402,11 +1309,11 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
|||||||
role="bold">LOCKFILE</emphasis>=[<emphasis>pathname</emphasis>]</term>
|
role="bold">LOCKFILE</emphasis>=[<emphasis>pathname</emphasis>]</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Specifies the name of the Shorewall[6] lock file, used to
|
<para>Specifies the name of the Shorewall lock file, used to prevent
|
||||||
prevent simultaneous state-changing commands. If not specified,
|
simultaneous state-changing commands. If not specified,
|
||||||
${VARDIR}/shorewall[6]/lock is assumed (${VARDIR} is normally
|
${VARDIR}/shorewall/lock is assumed (${VARDIR} is normally /var/lib
|
||||||
/var/lib but can be changed when Shorewall-core is installed -- see
|
but can be changed when Shorewall-core is installed -- see the
|
||||||
the output of <command>shorewall show vardir</command>).</para>
|
output of <command>shorewall show vardir</command>).</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -1434,8 +1341,6 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
|||||||
<term>ULOG</term>
|
<term>ULOG</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only.</para>
|
|
||||||
|
|
||||||
<para>Use ULOG logging to ulogd.</para>
|
<para>Use ULOG logging to ulogd.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@@ -1460,8 +1365,8 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
|||||||
sample configurations use this as the default log level and changing
|
sample configurations use this as the default log level and changing
|
||||||
it will change all packet logging done by the configuration. In any
|
it will change all packet logging done by the configuration. In any
|
||||||
configuration file (except <ulink
|
configuration file (except <ulink
|
||||||
url="/manpages/shorewall-params.html">shorewall-params(5)</ulink>),
|
url="/manpages/shorewall-params.html">shorewall-params(5)</ulink>), $LOG_LEVEL
|
||||||
$LOG_LEVEL will expand to this value.</para>
|
will expand to this value.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -1471,8 +1376,6 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
|||||||
role="bold">No</emphasis>|Keep]</term>
|
role="bold">No</emphasis>|Keep]</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only.</para>
|
|
||||||
|
|
||||||
<para>If set to <emphasis role="bold">Yes</emphasis> or <emphasis
|
<para>If set to <emphasis role="bold">Yes</emphasis> or <emphasis
|
||||||
role="bold">yes</emphasis>, sets
|
role="bold">yes</emphasis>, sets
|
||||||
<filename>/proc/sys/net/ipv4/conf/*/log_martians</filename> to 1
|
<filename>/proc/sys/net/ipv4/conf/*/log_martians</filename> to 1
|
||||||
@@ -1584,9 +1487,10 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
|||||||
log</emphasis>, and <emphasis role="bold">hits</emphasis> commands.
|
log</emphasis>, and <emphasis role="bold">hits</emphasis> commands.
|
||||||
If not assigned or if assigned an empty value, /var/log/messages is
|
If not assigned or if assigned an empty value, /var/log/messages is
|
||||||
assumed. For further information, see <ulink
|
assumed. For further information, see <ulink
|
||||||
url="shorewall-logging.html">shorewall-logging(8)</ulink>. Beginning
|
url="/manpages/shorewall_logging.html">http://www.shorewall.net/shorewall_logging.html</ulink>.
|
||||||
with Shorewall 5.0.10.1, you may specify <option>systemd</option> to
|
Beginning with Shorewall 5.0.10.1, you may specify
|
||||||
use <command>journelctl -r</command> to read the log.</para>
|
<option>systemd</option> to use <command>journelctl -r</command> to
|
||||||
|
read the log.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -1619,9 +1523,7 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
|||||||
|
|
||||||
<caution>
|
<caution>
|
||||||
<para>Beginning with Shorewall 5.1.0, the default and sample
|
<para>Beginning with Shorewall 5.1.0, the default and sample
|
||||||
shorewall[6].conf files set LOGFORMAT="%s %s ".</para>
|
shorewall.conf files set LOGFORMAT="%s %s ". Shorewall log
|
||||||
|
|
||||||
<para>Regardless of the LOGFORMAT setting, Shorewall IPv4 log
|
|
||||||
messages that use this LOGFORMAT can be uniquely identified using
|
messages that use this LOGFORMAT can be uniquely identified using
|
||||||
the following regular expression:</para>
|
the following regular expression:</para>
|
||||||
|
|
||||||
@@ -1629,15 +1531,8 @@ net all DROP info</programlisting>then the chain name is 'net-all'
|
|||||||
<member>'IN=.* OUT=.* SRC=.*\..* DST='</member>
|
<member>'IN=.* OUT=.* SRC=.*\..* DST='</member>
|
||||||
</simplelist>
|
</simplelist>
|
||||||
|
|
||||||
<para>and Shorewall IPv6 log messages can be uniquely identified
|
<para>To match all Netfilter log messages (Both IPv4 and IPv6),
|
||||||
using the following regular expression:</para>
|
use:</para>
|
||||||
|
|
||||||
<simplelist>
|
|
||||||
<member>'IN=.* OUT=.* SRC=.*:.* DST='</member>
|
|
||||||
</simplelist>
|
|
||||||
|
|
||||||
<para>To match all Netfilter log messages (Both IPv4 and IPv6 and
|
|
||||||
regardless of the LOGFORMAT setting), use:</para>
|
|
||||||
|
|
||||||
<simplelist>
|
<simplelist>
|
||||||
<member>'IN=.* OUT=.* SRC=.* DST='</member>
|
<member>'IN=.* OUT=.* SRC=.* DST='</member>
|
||||||
@@ -1730,7 +1625,7 @@ LOG:info:,bar net fw</programlisting>
|
|||||||
|
|
||||||
<para>A_DROP and A_REJECT are audited versions of DROP and REJECT
|
<para>A_DROP and A_REJECT are audited versions of DROP and REJECT
|
||||||
respectively and were added in Shorewall 4.4.20. They require
|
respectively and were added in Shorewall 4.4.20. They require
|
||||||
AUDIT_TARGET in the kernel and ip[6]tables.</para>
|
AUDIT_TARGET in the kernel and iptables.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -1773,7 +1668,7 @@ LOG:info:,bar net fw</programlisting>
|
|||||||
entries in <ulink
|
entries in <ulink
|
||||||
url="/manpages/shorewall-maclist.html">shorewall-maclist</ulink>(5)
|
url="/manpages/shorewall-maclist.html">shorewall-maclist</ulink>(5)
|
||||||
can be improved by setting the MACLIST_TTL variable in <ulink
|
can be improved by setting the MACLIST_TTL variable in <ulink
|
||||||
url="/manpages/shorewall.conf.html">shorewall[6].conf</ulink>(5).</para>
|
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5).</para>
|
||||||
|
|
||||||
<para>If your iptables and kernel support the "Recent Match" (see
|
<para>If your iptables and kernel support the "Recent Match" (see
|
||||||
the output of "shorewall check" near the top), you can cache the
|
the output of "shorewall check" near the top), you can cache the
|
||||||
@@ -1815,8 +1710,6 @@ LOG:info:,bar net fw</programlisting>
|
|||||||
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
|
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only.</para>
|
|
||||||
|
|
||||||
<para>This option is included for compatibility with old Shorewall
|
<para>This option is included for compatibility with old Shorewall
|
||||||
configuration. New installs should always have
|
configuration. New installs should always have
|
||||||
MAPOLDACTIONS=No.</para>
|
MAPOLDACTIONS=No.</para>
|
||||||
@@ -1847,11 +1740,11 @@ LOG:info:,bar net fw</programlisting>
|
|||||||
PREROUTING chain. This permits you to mark inbound traffic based on
|
PREROUTING chain. This permits you to mark inbound traffic based on
|
||||||
its destination address when DNAT is in use. To determine if your
|
its destination address when DNAT is in use. To determine if your
|
||||||
kernel has a FORWARD chain in the mangle table, use the <emphasis
|
kernel has a FORWARD chain in the mangle table, use the <emphasis
|
||||||
role="bold">shorewall [-6] show mangle</emphasis> command; if a
|
role="bold">shorewall show mangle</emphasis> command; if a FORWARD
|
||||||
FORWARD chain is displayed then your kernel will support this
|
chain is displayed then your kernel will support this option. If
|
||||||
option. If this option is not specified or if it is given the empty
|
this option is not specified or if it is given the empty value
|
||||||
value (e.g., MARK_IN_FORWARD_CHAIN="") then MARK_IN_FORWARD_CHAIN=No
|
(e.g., MARK_IN_FORWARD_CHAIN="") then MARK_IN_FORWARD_CHAIN=No is
|
||||||
is assumed.</para>
|
assumed.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -1909,6 +1802,18 @@ LOG:info:,bar net fw</programlisting>
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><emphasis role="bold">MODULE_SUFFIX=</emphasis>[<emphasis
|
||||||
|
role="bold">"</emphasis><emphasis>extension</emphasis> ...<emphasis
|
||||||
|
role="bold">"</emphasis>]</term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>The value of this option determines the possible file
|
||||||
|
extensions of kernel modules. The default value is "ko ko.gz ko.xz o
|
||||||
|
o.gz o.xz gz xz".</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis
|
<term><emphasis
|
||||||
role="bold">MODULESDIR=</emphasis>[[+]<emphasis>pathname</emphasis>[<emphasis
|
role="bold">MODULESDIR=</emphasis>[[+]<emphasis>pathname</emphasis>[<emphasis
|
||||||
@@ -1921,8 +1826,7 @@ LOG:info:,bar net fw</programlisting>
|
|||||||
"/lib/modules/$uname/kernel/net/ipv${g_family}/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/kernel/net/sched:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset"
|
"/lib/modules/$uname/kernel/net/ipv${g_family}/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/kernel/net/sched:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset"
|
||||||
where <emphasis role="bold">uname</emphasis> holds the output of
|
where <emphasis role="bold">uname</emphasis> holds the output of
|
||||||
'<command>uname -r</command>' and <emphasis
|
'<command>uname -r</command>' and <emphasis
|
||||||
role="bold">g_family</emphasis> holds '4' in IPv4 configurations and
|
role="bold">g_family</emphasis> holds '4'.</para>
|
||||||
'6' in IPv6 configurations.</para>
|
|
||||||
|
|
||||||
<para>The option plus sign ('+') was added in Shorewall 5.0.3 and
|
<para>The option plus sign ('+') was added in Shorewall 5.0.3 and
|
||||||
causes the listed pathnames to be appended to the default list
|
causes the listed pathnames to be appended to the default list
|
||||||
@@ -1935,8 +1839,6 @@ LOG:info:,bar net fw</programlisting>
|
|||||||
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
|
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only.</para>
|
|
||||||
|
|
||||||
<para>This option will normally be set to 'No' (the default). It
|
<para>This option will normally be set to 'No' (the default). It
|
||||||
should be set to 'Yes' under the following circumstances:</para>
|
should be set to 'Yes' under the following circumstances:</para>
|
||||||
|
|
||||||
@@ -1963,18 +1865,17 @@ LOG:info:,bar net fw</programlisting>
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>The value of this variable determines the number of seconds
|
<para>The value of this variable determines the number of seconds
|
||||||
that programs will wait for exclusive access to the Shorewall[6]
|
that programs will wait for exclusive access to the Shorewall lock
|
||||||
lock file. After the number of seconds corresponding to the value of
|
file. After the number of seconds corresponding to the value of this
|
||||||
this variable, programs will assume that the last program to hold
|
variable, programs will assume that the last program to hold the
|
||||||
the lock died without releasing the lock.</para>
|
lock died without releasing the lock.</para>
|
||||||
|
|
||||||
<para>If not set or set to the empty value, a value of 60 (60
|
<para>If not set or set to the empty value, a value of 60 (60
|
||||||
seconds) is assumed.</para>
|
seconds) is assumed.</para>
|
||||||
|
|
||||||
<para>An appropriate value for this parameter would be twice the
|
<para>An appropriate value for this parameter would be twice the
|
||||||
length of time that it takes your firewall system to process a
|
length of time that it takes your firewall system to process a
|
||||||
<emphasis role="bold">shorewall [-6] restart</emphasis>
|
<emphasis role="bold">shorewall restart</emphasis> command.</para>
|
||||||
command.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -1998,8 +1899,6 @@ LOG:info:,bar net fw</programlisting>
|
|||||||
role="bold">prohibit</emphasis>]</term>
|
role="bold">prohibit</emphasis>]</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only.</para>
|
|
||||||
|
|
||||||
<para>When set to Yes, causes Shorewall to null-route the IPv4
|
<para>When set to Yes, causes Shorewall to null-route the IPv4
|
||||||
address ranges reserved by RFC1918. The default value is
|
address ranges reserved by RFC1918. The default value is
|
||||||
'No'.</para>
|
'No'.</para>
|
||||||
@@ -2036,11 +1935,12 @@ LOG:info:,bar net fw</programlisting>
|
|||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Optimization category 1 - Traditionally, Shorewall has
|
<para>Optimization category 1 - Traditionally, Shorewall has
|
||||||
created rules for the complete matrix of host groups defined by
|
created rules for the complete matrix of
|
||||||
the zones, interfaces and hosts files. Any traffic that didn't
|
host groups defined by the zones, interfaces and hosts
|
||||||
correspond to an element of that matrix was rejected in one of
|
files. Any traffic that didn't correspond to an element
|
||||||
the built-in chains. When the matrix is sparse, this results in
|
of that matrix was rejected in one of the built-in chains. When
|
||||||
lots of largely useless rules.</para>
|
the matrix is sparse, this results in lots of largely useless
|
||||||
|
rules.</para>
|
||||||
|
|
||||||
<para>These extra rules can be eliminated by setting the 1 bit
|
<para>These extra rules can be eliminated by setting the 1 bit
|
||||||
in OPTIMIZE.</para>
|
in OPTIMIZE.</para>
|
||||||
@@ -2218,9 +2118,8 @@ LOG:info:,bar net fw</programlisting>
|
|||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
<para>In versions prior to 5.1.0, the default value is zero which
|
<para>The default value is zero which disables all
|
||||||
disables all optimizations. Beginning with Shorewall 5.1.0, the
|
optimizations.</para>
|
||||||
default value is All which enables all optimizations.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -2417,7 +2316,7 @@ RCP_COMMAND: scp ${files} ${root}@${system}:${destination}</programlisting>
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>if the protocol is UDP (17) then the packet is rejected
|
<para>if the protocol is UDP (17) then the packet is rejected
|
||||||
with an 'port-unreachable' ICMP.</para>
|
with an 'port-unreachable' ICMP (ICMP6).</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
@@ -2425,11 +2324,6 @@ RCP_COMMAND: scp ${files} ${root}@${system}:${destination}</programlisting>
|
|||||||
with a 'host-unreachable' ICMP.</para>
|
with a 'host-unreachable' ICMP.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>if the protocol is ICMP6 (1) then the packet is rejected
|
|
||||||
with a 'icmp6-addr-unreachable' ICMP6.</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>otherwise, the packet is rejected with a 'host-prohibited'
|
<para>otherwise, the packet is rejected with a 'host-prohibited'
|
||||||
ICMP.</para>
|
ICMP.</para>
|
||||||
@@ -2439,12 +2333,11 @@ RCP_COMMAND: scp ${files} ${root}@${system}:${destination}</programlisting>
|
|||||||
<para>You can modify this behavior by implementing your own
|
<para>You can modify this behavior by implementing your own
|
||||||
<replaceable>action</replaceable> that handles REJECT and specifying
|
<replaceable>action</replaceable> that handles REJECT and specifying
|
||||||
it's name in this option. The <emphasis role="bold">nolog</emphasis>
|
it's name in this option. The <emphasis role="bold">nolog</emphasis>
|
||||||
and <emphasis role="bold">noinline</emphasis> options will
|
and <emphasis role="bold">inline</emphasis> options will
|
||||||
automatically be assumed for the specified
|
automatically be assumed for the specified
|
||||||
<replaceable>action</replaceable>.</para>
|
<replaceable>action</replaceable>.</para>
|
||||||
|
|
||||||
<para>The following action implements the default reject
|
<para>The following action implements the standard behavior:</para>
|
||||||
action:</para>
|
|
||||||
|
|
||||||
<programlisting>?format 2
|
<programlisting>?format 2
|
||||||
#TARGET SOURCE DEST PROTO
|
#TARGET SOURCE DEST PROTO
|
||||||
@@ -2544,10 +2437,10 @@ INLINE - - - ;; -j REJECT
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>Specifies the simple name of a file in /var/lib/shorewall to
|
<para>Specifies the simple name of a file in /var/lib/shorewall to
|
||||||
be used as the default restore script in the <emphasis
|
be used as the default restore script in the <emphasis
|
||||||
role="bold">shorewall [-6] save</emphasis>, <emphasis
|
role="bold">shorewall save</emphasis>, <emphasis
|
||||||
role="bold">shorewall [-6] restore</emphasis>, <emphasis
|
role="bold">shorewall restore</emphasis>, <emphasis
|
||||||
role="bold">shorewall [-6] forget </emphasis>and <emphasis
|
role="bold">shorewall forget </emphasis>and <emphasis
|
||||||
role="bold">shorewall [6] -f start</emphasis> commands.</para>
|
role="bold">shorewall -f start</emphasis> commands.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
@@ -2556,8 +2449,6 @@ INLINE - - - ;; -j REJECT
|
|||||||
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>}</term>
|
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>}</term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>IPv4 only.</para>
|
|
||||||
|
|
||||||
<para>During <emphasis role="bold">shorewall star</emphasis>t, IP
|
<para>During <emphasis role="bold">shorewall star</emphasis>t, IP
|
||||||
addresses to be added as a consequence of ADD_IP_ALIASES=Yes and
|
addresses to be added as a consequence of ADD_IP_ALIASES=Yes and
|
||||||
ADD_SNAT_ALIASES=Yes are quietly deleted when <ulink
|
ADD_SNAT_ALIASES=Yes are quietly deleted when <ulink
|
||||||
@@ -2570,7 +2461,7 @@ INLINE - - - ;; -j REJECT
|
|||||||
not be deleted. Regardless of the setting of RETAIN_ALIASES,
|
not be deleted. Regardless of the setting of RETAIN_ALIASES,
|
||||||
addresses added during <emphasis role="bold">shorewall
|
addresses added during <emphasis role="bold">shorewall
|
||||||
start</emphasis> are still deleted at a subsequent <emphasis
|
start</emphasis> are still deleted at a subsequent <emphasis
|
||||||
role="bold">shorewall [stop</emphasis>, <emphasis
|
role="bold">shorewall stop</emphasis>, <emphasis
|
||||||
role="bold">shorewall reload</emphasis> or <emphasis
|
role="bold">shorewall reload</emphasis> or <emphasis
|
||||||
role="bold">shorewall restart</emphasis>.</para>
|
role="bold">shorewall restart</emphasis>.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@@ -3090,40 +2981,6 @@ INLINE - - - ;; -j REJECT
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><emphasis role="bold">USE_NFLOG_SIZE=</emphasis>[<emphasis
|
|
||||||
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Added in Shorewall 5.1.5. The second parameter to the NFLOG
|
|
||||||
target specifies how many bytes of the packet to copy to the log; if
|
|
||||||
omitted or if supplied as zero, the entire packet is copied. This
|
|
||||||
feature has traditionally been implemented using the --nflog-range
|
|
||||||
option to the NFLOG iptables target. Unfortuntely, the --nflog-range
|
|
||||||
option never worked (the entire packet was always copied). To deal
|
|
||||||
with this issue, the Netfilter team:</para>
|
|
||||||
|
|
||||||
<itemizedlist>
|
|
||||||
<listitem>
|
|
||||||
<para>Added a warning message when --nflog-range is used</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>Added --nflog-size which works like --nflog-range was
|
|
||||||
intended to work.</para>
|
|
||||||
</listitem>
|
|
||||||
</itemizedlist>
|
|
||||||
|
|
||||||
<para>When USE_NFLOG_SIZE=Yes, Shorewall will attempt to use the new
|
|
||||||
--nflog-size feature. If that feature is not available in the
|
|
||||||
running kernel and ip[6]tables, an error is raised.</para>
|
|
||||||
|
|
||||||
<para>When USE_NFLOG_SIZE is not supplied, USE_NFLOG_SIZE=No is
|
|
||||||
assumed. When USE_NFLOG_SIZE is added by shorewall update, it is
|
|
||||||
added with setting No.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><emphasis role="bold">USE_PHYSICAL_NAMES=</emphasis>[<emphasis
|
<term><emphasis role="bold">USE_PHYSICAL_NAMES=</emphasis>[<emphasis
|
||||||
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
|
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
|
||||||
@@ -3293,13 +3150,19 @@ INLINE - - - ;; -j REJECT
|
|||||||
<title>FILES</title>
|
<title>FILES</title>
|
||||||
|
|
||||||
<para>/etc/shorewall/shorewall.conf</para>
|
<para>/etc/shorewall/shorewall.conf</para>
|
||||||
|
|
||||||
<para>/etc/shorewall6/shorewall6.conf</para>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>See ALSO</title>
|
<title>See ALSO</title>
|
||||||
|
|
||||||
<para>shorewall(8)</para>
|
<para>shorewall(8), shorewall-accounting(5), shorewall-actions(5),
|
||||||
|
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
|
||||||
|
shorewall-ipsets(5), shorewall-maclist(5), shorewall-masq(5),
|
||||||
|
shorewall-nat(5), shorewall-netmap(5), shorewall-params(5),
|
||||||
|
shorewall-policy(5), shorewall-providers(5), shorewall-proxyarp(5),
|
||||||
|
shorewall-rtrules(5), shorewall-routestopped(5), shorewall-rules(5),
|
||||||
|
shorewall-tcclasses(5), shorewall-tcdevices(5), shorewall-tcinterfaces(5),
|
||||||
|
shorewall-tcpri(5), shorewall-tcrules(5), shorewall-tos(5),
|
||||||
|
shorewall-tunnels(5), shorewall-zones(5)</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#
|
#
|
||||||
# On the target system (the system where the firewall program is to run):
|
# On the target system (the system where the firewall program is to run):
|
||||||
#
|
#
|
||||||
# [ IPTABLES=<iptables binary> ] [ MODULESDIR=<kernel modules directory> ] shorecap > capabilities
|
# [ IPTABLES=<iptables binary> ] [ MODULESDIR=<kernel modules directory> ] [ MODULE_SUFFIX="<module suffix list>" ] shorecap > capabilities
|
||||||
#
|
#
|
||||||
# Now move the capabilities file to the compilation system. The file must
|
# Now move the capabilities file to the compilation system. The file must
|
||||||
# be placed in a directory on the CONFIG_PATH to be used when compiling firewalls
|
# be placed in a directory on the CONFIG_PATH to be used when compiling firewalls
|
||||||
@@ -38,6 +38,7 @@
|
|||||||
#
|
#
|
||||||
# IPTABLES - iptables
|
# IPTABLES - iptables
|
||||||
# MODULESDIR - /lib/modules/$(uname -r)/kernel/net/ipv4/netfilter
|
# MODULESDIR - /lib/modules/$(uname -r)/kernel/net/ipv4/netfilter
|
||||||
|
# MODULE_SUFFIX - "o gz xz ko o.gz o.xz ko.gz ko.xz"
|
||||||
#
|
#
|
||||||
# Shorewall need not be installed on the target system to run shorecap. If the '-e' flag is
|
# Shorewall need not be installed on the target system to run shorecap. If the '-e' flag is
|
||||||
# used during firewall compilation, then the generated firewall program will likewise not
|
# used during firewall compilation, then the generated firewall program will likewise not
|
||||||
|
@@ -8,7 +8,6 @@
|
|||||||
Description=Shorewall IPv6 firewall (lite)
|
Description=Shorewall IPv6 firewall (lite)
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
After=shorewall-lite.service
|
|
||||||
Conflicts=ip6tables.service firewalld.service
|
Conflicts=ip6tables.service firewalld.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
@@ -7,7 +7,6 @@
|
|||||||
Description=Shorewall IPv6 firewall (lite)
|
Description=Shorewall IPv6 firewall (lite)
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
After=shorewall-lite.service
|
|
||||||
Conflicts=ip6tables.service firewalld.service
|
Conflicts=ip6tables.service firewalld.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user