forked from extern/shorewall_code
Compare commits
76 Commits
5.1.3-Beta
...
5.1.4-base
Author | SHA1 | Date | |
---|---|---|---|
|
bb70a3637b | ||
|
6c20cc7c4f | ||
|
d4e05f6163 | ||
|
6201f37913 | ||
|
7ee44d6b4b | ||
|
363b8f9802 | ||
|
d365a9ff18 | ||
|
00d4724fd8 | ||
|
749c8047d8 | ||
|
a00f2e6365 | ||
|
a46f19899b | ||
|
d2392c3a9b | ||
|
0763b27b0b | ||
|
8b90827611 | ||
|
8507c97b5a | ||
|
a6306f2c08 | ||
|
a79dc194a4 | ||
|
ccf9d73c72 | ||
|
bdcf93f92c | ||
|
6b84727886 | ||
|
5f445d9c2b | ||
|
31bd10ffdd | ||
|
c3303067fc | ||
|
55cf06d0a8 | ||
|
c36a7cd35b | ||
|
561efa595c | ||
|
158f6305b1 | ||
|
6407520a35 | ||
|
54336eaa80 | ||
|
5b85627fb8 | ||
|
a00d7217e3 | ||
|
54ef4e4ced | ||
|
a447d726fa | ||
|
c6050f9fbb | ||
|
fe29adbd66 | ||
|
4dc6be6b3b | ||
|
6ebc8f4266 | ||
|
c5c4211081 | ||
|
4010f9bce4 | ||
|
02bb717d7d | ||
|
046998ed84 | ||
|
24a014655b | ||
|
0b8945da8e | ||
|
da363880a9 | ||
|
b049d1805d | ||
|
037fe490f3 | ||
|
a8d7675322 | ||
|
b13014c9ab | ||
|
76aef6cb04 | ||
|
4c72b3ee58 | ||
|
d9071c5308 | ||
|
5729be6431 | ||
|
1a381f717c | ||
|
c534c458dd | ||
|
61435936fe | ||
|
2d4c1411bd | ||
|
655f260cb6 | ||
|
85d571d013 | ||
|
fdb78898fc | ||
|
d4c016d9c5 | ||
|
3d8d5aa469 | ||
|
49811d24fa | ||
|
fe4aaee1b4 | ||
|
0ec7bc846e | ||
|
dbcd4d9d16 | ||
|
5a996cbda7 | ||
|
6019adaae5 | ||
|
4f869c3506 | ||
|
e3c2874b21 | ||
|
e8a0142480 | ||
|
a4768776f7 | ||
|
8e000b158e | ||
|
f1d1ab6411 | ||
|
cd103bb715 | ||
|
5f1370f1b4 | ||
|
dc53fa2665 |
@@ -4264,12 +4264,17 @@ usage() # $1 = exit status
|
||||
echo " reenable <interface>"
|
||||
ecko " refresh [ -d ] [ -n ] [ -T ] [ -D <directory> ] [ <chain>... ]"
|
||||
echo " reject <address> ..."
|
||||
ecko " reload [ -s ] [ -c ] [ -r <root user> ] [ -T ] [ -i ] [ <directory> ] <system>"
|
||||
|
||||
if [ -n "$g_lite" ]; then
|
||||
echo " reload [ -n ] [ -p ] [ -f ] [ -C ] [ <directory> ]"
|
||||
else
|
||||
echo " reload [ -n ] [ -p ] [-d] [ -f ] [ -c ] [ -T ] [ -i ] [ -C ] [ <directory> ]"
|
||||
fi
|
||||
|
||||
if [ -z "$g_lite" ]; then
|
||||
echo " remote-reload [ -s ] [ -c ] [ -r <root-name> ] [ -T ] [ -i ] [ <directory> ] <system>"
|
||||
echo " remote-restart [ -s ] [ -c ] [ -r <root-name> ] [ -T ] [ -i ] [ <directory> ] <system>"
|
||||
echo " remote-start [ -s ] [ -c ] [ -r <root-name> ] [ -T ] [ -i ] [ <directory> ] <system>"
|
||||
echo " remote-reload [ -n ] [ -s ] [ -c ] [ -r <root-name> ] [ -T ] [ -i ] [ <directory> ] <system>"
|
||||
echo " remote-restart [ -n ] [ -s ] [ -c ] [ -r <root-name> ] [ -T ] [ -i ] [ <directory> ] <system>"
|
||||
echo " remote-start [ -n ] [ -s ] [ -c ] [ -r <root-name> ] [ -T ] [ -i ] [ <directory> ] <system>"
|
||||
fi
|
||||
|
||||
echo " reset [ <chain> ... ]"
|
||||
|
@@ -432,6 +432,33 @@
|
||||
<arg choice="plain"><replaceable>address</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall[6][-lite]</command>
|
||||
|
||||
<arg
|
||||
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
|
||||
|
||||
<arg>options</arg>
|
||||
|
||||
<arg choice="plain"><option>reload</option></arg>
|
||||
|
||||
<arg><option>-n</option></arg>
|
||||
|
||||
<arg><option>-p</option><arg><option>-d</option></arg></arg>
|
||||
|
||||
<arg><option>-f</option></arg>
|
||||
|
||||
<arg><option>-c</option></arg>
|
||||
|
||||
<arg><option>-T</option></arg>
|
||||
|
||||
<arg><option>-i</option></arg>
|
||||
|
||||
<arg><option>-C</option></arg>
|
||||
|
||||
<arg><replaceable>directory</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall[6]</command>
|
||||
|
||||
@@ -1916,10 +1943,11 @@
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">remote-start</emphasis>
|
||||
[-<option>s</option>] [-<option>c</option>] [-<option>r</option>
|
||||
<replaceable>root-user-name</replaceable>] [-<option>T</option>]
|
||||
[-<option>i</option>] [ [ -D ] <replaceable>directory</replaceable> ]
|
||||
[ <replaceable>system</replaceable> ]</term>
|
||||
[-<option>n</option>] [-<option>s</option>] [-<option>c</option>]
|
||||
[-<option>r</option> <replaceable>root-user-name</replaceable>]
|
||||
[-<option>T</option>] [-<option>i</option>] [ [ -D ]
|
||||
<replaceable>directory</replaceable> ] [
|
||||
<replaceable>system</replaceable> ]</term>
|
||||
|
||||
<listitem>
|
||||
<para>This command was renamed from <command>load</command> in
|
||||
@@ -1955,6 +1983,9 @@
|
||||
<replaceable>directory</replaceable>, then the <option>-D</option>
|
||||
option must be given.</para>
|
||||
|
||||
<para>The <option>-n</option> option causes Shorewall to avoid
|
||||
updating the routing table(s).</para>
|
||||
|
||||
<para>If <emphasis role="bold">-s</emphasis> is specified and the
|
||||
<emphasis role="bold">start</emphasis> command succeeds, then the
|
||||
remote Shorewall-lite configuration is saved by executing <emphasis
|
||||
|
@@ -16,7 +16,7 @@ RemainAfterExit=yes
|
||||
EnvironmentFile=-/etc/default/shorewall-lite
|
||||
StandardOutput=syslog
|
||||
ExecStart=/sbin/shorewall-lite $OPTIONS start $STARTOPTIONS
|
||||
ExecStop=/sbin/shorewall-lite $OPTIONS stop
|
||||
ExecStop=/sbin/shorewall-lite $OPTIONS clear
|
||||
ExecReload=/sbin/shorewall-lite $OPTIONS reload $RELOADOPTIONS
|
||||
|
||||
[Install]
|
||||
|
9
Shorewall/Actions/action.A_AllowICMPs.deprecated
Normal file
9
Shorewall/Actions/action.A_AllowICMPs.deprecated
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Shorewall6 -- /usr/share/shorewall/action.A_AllowICMPs
|
||||
#
|
||||
# This action A_ACCEPTs needed ICMP types
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DPORT
|
||||
|
||||
AllowICMPs(A_ACCEPT)
|
@@ -13,6 +13,7 @@
|
||||
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
|
||||
#
|
||||
?require AUDIT_TARGET
|
||||
?warning "You are using the deprecated A_Drop default action. Please see http://www.shorewall.net/Actions.html
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DPORT SPORT
|
||||
#
|
||||
@@ -31,9 +32,10 @@ Auth(A_DROP)
|
||||
#
|
||||
A_AllowICMPs - - icmp
|
||||
#
|
||||
# Don't log broadcasts
|
||||
# Don't log broadcasts and multicasts
|
||||
#
|
||||
dropBcast(audit)
|
||||
dropMcast(audit)
|
||||
#
|
||||
# Drop packets that are in the INVALID state -- these are usually ICMP packets
|
||||
# and just confuse people when they appear in the log.
|
@@ -11,6 +11,8 @@
|
||||
# internet operation are always ACCEPTed.
|
||||
#
|
||||
# IF YOU ARE HAVING CONNECTION PROBLEMS, CHANGING THIS FILE WON'T HELP!!!!!!!!!
|
||||
?require AUDIT_TARGET
|
||||
?warning "You are using the deprecated A_REJECT default action. Please see http://www.shorewall.net/Actions.html
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO
|
||||
#
|
||||
@@ -25,10 +27,11 @@ COUNT
|
||||
#
|
||||
A_AllowICMPs - - icmp
|
||||
#
|
||||
# Drop Broadcasts so they don't clutter up the log
|
||||
# (broadcasts must *not* be rejected).
|
||||
# Drop Broadcasts and multicasts so they don't clutter up the log
|
||||
# (these must *not* be rejected).
|
||||
#
|
||||
dropBcast(audit)
|
||||
dropMcast(audit)
|
||||
#
|
||||
# Drop packets that are in the INVALID state -- these are usually ICMP packets
|
||||
# and just confuse people when they appear in the log (these ICMPs cannot be
|
||||
|
45
Shorewall/Actions/action.AllowICMPs
Normal file
45
Shorewall/Actions/action.AllowICMPs
Normal file
@@ -0,0 +1,45 @@
|
||||
#
|
||||
# Shorewall -- /usr/share/shorewall/action.AllowICMPs
|
||||
#
|
||||
# This action ACCEPTs needed ICMP types.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER
|
||||
|
||||
DEFAULTS ACCEPT
|
||||
|
||||
?if __IPV4
|
||||
@1 - - icmp fragmentation-needed {comment="Needed ICMP types"}
|
||||
@1 - - icmp time-exceeded {comment="Needed ICMP types"}
|
||||
?else
|
||||
?COMMENT Needed ICMP types (RFC4890)
|
||||
|
||||
@1 - - ipv6-icmp destination-unreachable
|
||||
@1 - - ipv6-icmp packet-too-big
|
||||
@1 - - ipv6-icmp time-exceeded
|
||||
@1 - - ipv6-icmp parameter-problem
|
||||
|
||||
# The following should have a ttl of 255 and must be allowed to transit a bridge
|
||||
@1 - - ipv6-icmp router-solicitation
|
||||
@1 - - ipv6-icmp router-advertisement
|
||||
@1 - - ipv6-icmp neighbour-solicitation
|
||||
@1 - - ipv6-icmp neighbour-advertisement
|
||||
@1 - - ipv6-icmp 137 # Redirect
|
||||
@1 - - ipv6-icmp 141 # Inverse neighbour discovery solicitation
|
||||
@1 - - ipv6-icmp 142 # Inverse neighbour discovery advertisement
|
||||
|
||||
# The following should have a link local source address and must be allowed to transit a bridge
|
||||
@1 fe80::/10 - ipv6-icmp 130 # Listener query
|
||||
@1 fe80::/10 - ipv6-icmp 131 # Listener report
|
||||
@1 fe80::/10 - ipv6-icmp 132 # Listener done
|
||||
@1 fe80::/10 - ipv6-icmp 143 # Listener report v2
|
||||
|
||||
# The following should be received with a ttl of 255 and must be allowed to transit a bridge
|
||||
@1 - - ipv6-icmp 148 # Certificate path solicitation
|
||||
@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 abridge
|
||||
@1 fe80::/10 - ipv6-icmp 151 # Multicast router advertisement
|
||||
@1 fe80::/10 - ipv6-icmp 152 # Multicast router solicitation
|
||||
@1 fe80::/10 - ipv6-icmp 153 # Multicast router termination
|
||||
?endif
|
@@ -20,7 +20,7 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Broadcast[([<action>|-[,{audit|-}])]
|
||||
# Broadcast[([<action>|[,{audit|-}])]
|
||||
#
|
||||
# Default action is DROP
|
||||
#
|
||||
@@ -34,18 +34,28 @@ DEFAULTS DROP,-
|
||||
?else
|
||||
?begin perl;
|
||||
|
||||
use strict;
|
||||
use Shorewall::IPAddrs;
|
||||
use Shorewall::Config;
|
||||
use Shorewall::Chains;
|
||||
|
||||
my ( $action ) = get_action_params( 1 );
|
||||
my ( $action, $audit ) = get_action_params( 2 );
|
||||
my $chainref = get_action_chain;
|
||||
my ( $level, $tag ) = get_action_logging;
|
||||
|
||||
fatal_error "Invalid parameter to action Broadcast" if supplied $audit && $audit ne 'audit';
|
||||
|
||||
my $target = require_audit ( $action , $audit );
|
||||
|
||||
if ( $family == F_IPV4 ) {
|
||||
add_commands $chainref, 'for address in $ALL_BCASTS; do';
|
||||
} elsif ($family == F_IPV6 ) {
|
||||
add_commands $chainref, 'for address in $ALL_ACASTS; do';
|
||||
}
|
||||
|
||||
incr_cmd_level $chainref;
|
||||
log_rule_limit $level, $chainref, 'Broadcast' , $action, '', $tag, 'add', ' -d $address ' if $level ne '';
|
||||
add_jump $chainref, $action, 0, "-d \$address ";
|
||||
add_jump $chainref, $target, 0, "-d \$address ";
|
||||
decr_cmd_level $chainref;
|
||||
add_commands $chainref, 'done';
|
||||
|
||||
|
@@ -13,9 +13,9 @@
|
||||
DEFAULTS 2,0
|
||||
|
||||
?if @1 !~ /^\d+/ || ! @1 || @1 > 1024
|
||||
?error Invalid value for Bricks (@1)
|
||||
?error Invalid value (@1) for the GlusterFS Bricks argument
|
||||
?elsif @2 !~ /^[01]$/
|
||||
?error Invalid value for IB (@2)
|
||||
?error Invalid value (@2) for the GlusterFS IB argument
|
||||
?endif
|
||||
|
||||
#ACTION SOURCE DEST PROTO DPORT
|
||||
|
@@ -33,16 +33,22 @@ DEFAULTS DROP,-
|
||||
?else
|
||||
?begin perl;
|
||||
|
||||
use strict;
|
||||
use Shorewall::IPAddrs;
|
||||
use Shorewall::Config;
|
||||
use Shorewall::Chains;
|
||||
|
||||
my ( $action ) = get_action_params( 1 );
|
||||
my ( $action, $audit ) = get_action_params( 2 );
|
||||
my $chainref = get_action_chain;
|
||||
my ( $level, $tag ) = get_action_logging;
|
||||
|
||||
log_rule_limit $level, $chainref, 'Multicast' , $action, '', $tag, 'add', ' -d 224.0.0.0/4 ' if $level ne '';
|
||||
add_jump $chainref, $action, 0, '-d 224.0.0.0/4 ';
|
||||
fatal_error "Invalid parameter to action Multicast" if supplied $audit && $audit ne 'audit';
|
||||
|
||||
my $target = require_audit ( $action , $audit );
|
||||
my $dest = ( $family == F_IPV4 ) ? join( ' ', '-d', IPv4_MULTICAST . ' ' ) : join( ' ', '-d', IPv6_MULTICAST . ' ' );
|
||||
|
||||
log_rule_limit( $level, $chainref, 'Multicast' , $action, '', $tag, 'add', $dest ) if $level ne '';
|
||||
add_jump $chainref, $target, 0, $dest;
|
||||
|
||||
1;
|
||||
|
||||
|
@@ -29,10 +29,10 @@ DEFAULTS -
|
||||
?if passed(@1)
|
||||
?if @1 eq 'audit'
|
||||
?require AUDIT_TARGET
|
||||
A_DROP ;; -p 6 ! --syn
|
||||
A_DROP {proto=6:!syn}
|
||||
?else
|
||||
?error "Invalid argument (@1) to dropNotSyn"
|
||||
?endif
|
||||
?else
|
||||
DROP ;; -p 6 ! --syn
|
||||
DROP {proto=6:!syn}
|
||||
?endif
|
||||
|
@@ -29,11 +29,11 @@ DEFAULTS -
|
||||
?if passed(@1)
|
||||
?if @1 eq 'audit'
|
||||
?require AUDIT_TARGET
|
||||
A_REJECT ;; -p 6 ! --syn
|
||||
A_REJECT {proto=6:!syn}
|
||||
?else
|
||||
?error "Invalid argument (@1) to rejNotSyn"
|
||||
?endif
|
||||
?else
|
||||
REJECT(--reject-with tcp-reset) ;; -p 6 ! --syn
|
||||
REJECT(tcp-reset) {proto=6:!syn}
|
||||
?endif
|
||||
|
||||
|
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# Shorewall -- /usr/share/shorewall/macro.AllowICMPs
|
||||
#
|
||||
# This macro ACCEPTs needed ICMP types.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DPORT SPORT ORIGDEST RATE USER
|
||||
|
||||
?COMMENT Needed ICMP types
|
||||
|
||||
DEFAULT ACCEPT
|
||||
PARAM - - icmp fragmentation-needed
|
||||
PARAM - - icmp time-exceeded
|
@@ -405,14 +405,14 @@ our $VERSION = 'MODULEVERSION';
|
||||
# Provider Chains for provider <p>
|
||||
# Load Balance - ~<p>
|
||||
#
|
||||
# Zone-pair chains for rules chain <z12z2>
|
||||
# Zone-pair chains for rules chain <z1-z2>
|
||||
#
|
||||
# Syn Flood - @<z12z2>
|
||||
# Blacklist - <z12z2>~
|
||||
# Established - ^<z12z2>
|
||||
# Related - +<z12z2>
|
||||
# Invalid - _<z12z2>
|
||||
# Untracked - &<z12z2>
|
||||
# Syn Flood - @<z1-z2>
|
||||
# Blacklist - <z1-z2>~
|
||||
# Established - ^<z1-z2>
|
||||
# Related - +<z1-z2>
|
||||
# Invalid - _<z1-z2>
|
||||
# Untracked - &<z1-z2>
|
||||
#
|
||||
our %chain_table;
|
||||
our $raw_table;
|
||||
@@ -434,7 +434,7 @@ use constant { STANDARD => 0x1, #defined by Netfilter
|
||||
REDIRECT => 0x20, #'REDIRECT'
|
||||
ACTION => 0x40, #An action (may be built-in)
|
||||
MACRO => 0x80, #A Macro
|
||||
LOGRULE => 0x100, #'LOG','NFLOG'
|
||||
LOGRULE => 0x100, #'LOG','ULOG','NFLOG'
|
||||
NFQ => 0x200, #'NFQUEUE'
|
||||
CHAIN => 0x400, #Manual Chain
|
||||
SET => 0x800, #SET
|
||||
@@ -1081,11 +1081,11 @@ sub format_option( $$ ) {
|
||||
|
||||
assert( ! reftype $value );
|
||||
|
||||
my $rule = '';
|
||||
my $rule;
|
||||
|
||||
$value =~ s/\s*$//;
|
||||
|
||||
$rule .= join( ' ' , ' -m', $option, $value );
|
||||
$rule = join( ' ' , ' -m', $option, $value );
|
||||
|
||||
$rule;
|
||||
}
|
||||
@@ -4556,7 +4556,8 @@ sub do_proto( $$$;$ )
|
||||
|
||||
if ( $proto ne '' ) {
|
||||
|
||||
my $synonly = ( $proto =~ s/:syn$//i );
|
||||
my $synonly = ( $proto =~ s/:(!)?syn$//i );
|
||||
my $notsyn = $1;
|
||||
my $invert = ( $proto =~ s/^!// ? '! ' : '' );
|
||||
my $protonum = resolve_proto $proto;
|
||||
|
||||
@@ -4574,7 +4575,7 @@ sub do_proto( $$$;$ )
|
||||
$output = "${invert}-p ${proto} ";
|
||||
} else {
|
||||
fatal_error '":syn" is only allowed with tcp' unless $proto == TCP && ! $invert;
|
||||
$output = "-p $proto --syn ";
|
||||
$output = $notsyn ? "-p $proto ! --syn " : "-p $proto --syn ";
|
||||
}
|
||||
|
||||
fatal_error "SOURCE/DEST PORT(S) not allowed with PROTO !$pname" if $invert && ($ports ne '' || $sports ne '');
|
||||
|
@@ -86,6 +86,9 @@ our @EXPORT = qw(
|
||||
kernel_version
|
||||
|
||||
compiletime
|
||||
|
||||
F_IPV4
|
||||
F_IPV6
|
||||
);
|
||||
|
||||
our @EXPORT_OK = qw( $shorewall_dir initialize shorewall);
|
||||
@@ -197,9 +200,6 @@ our %EXPORT_TAGS = ( internal => [ qw( create_temp_script
|
||||
PARMSMODIFIED
|
||||
USEDCALLER
|
||||
|
||||
F_IPV4
|
||||
F_IPV6
|
||||
|
||||
TCP
|
||||
UDP
|
||||
UDPLITE
|
||||
@@ -748,7 +748,7 @@ sub initialize( $;$$) {
|
||||
TC_SCRIPT => '',
|
||||
EXPORT => 0,
|
||||
KLUDGEFREE => '',
|
||||
VERSION => "5.1.1-RC1",
|
||||
VERSION => "5.1.4-Beta1",
|
||||
CAPVERSION => 50100 ,
|
||||
BLACKLIST_LOG_TAG => '',
|
||||
RELATED_LOG_TAG => '',
|
||||
@@ -907,6 +907,7 @@ sub initialize( $;$$) {
|
||||
ZERO_MARKS => undef ,
|
||||
FIREWALL => undef ,
|
||||
BALANCE_PROVIDERS => undef ,
|
||||
PERL_HASH_SEED => undef ,
|
||||
#
|
||||
# Packet Disposition
|
||||
#
|
||||
@@ -1092,7 +1093,7 @@ sub initialize( $;$$) {
|
||||
|
||||
%compiler_params = ();
|
||||
|
||||
%actparams = ( 0 => 0, loglevel => '', logtag => '', chain => '', disposition => '', caller => '' );
|
||||
%actparams = ( 0 => 0, loglevel => '', logtag => '', chain => '', disposition => '', caller => '', callfile => '', callline => '' );
|
||||
$parmsmodified = 0;
|
||||
$usedcaller = 0;
|
||||
%ipsets = ();
|
||||
@@ -1218,7 +1219,7 @@ sub compiletime() {
|
||||
sub currentlineinfo() {
|
||||
my $linenumber = $currentlinenumber || 1;
|
||||
|
||||
if ( $currentfile ) {
|
||||
if ( $currentfilename ) {
|
||||
my $lineinfo = " $currentfilename ";
|
||||
|
||||
if ( $linenumber eq 'EOF' ) {
|
||||
@@ -2232,7 +2233,7 @@ sub split_list4( $ ) {
|
||||
sub split_columns( $ ) {
|
||||
my ($list) = @_;
|
||||
|
||||
return split ' ', $list unless $list =~ /\(/;
|
||||
return split ' ', $list unless $list =~ /[()]/;
|
||||
|
||||
my @list1 = split ' ', $list;
|
||||
my @list2;
|
||||
@@ -2273,9 +2274,7 @@ sub split_columns( $ ) {
|
||||
}
|
||||
}
|
||||
|
||||
unless ( $opencount == 0 ) {
|
||||
fatal_error "Mismatched parentheses ($list)";
|
||||
}
|
||||
fatal_error "Mismatched parentheses ($list)" unless $opencount == 0;
|
||||
|
||||
@list2;
|
||||
}
|
||||
@@ -2288,7 +2287,7 @@ sub clear_comment();
|
||||
# ensure that it has an appropriate number of columns.
|
||||
# supply '-' in omitted trailing columns.
|
||||
# Handles all of the supported forms of column/pair specification
|
||||
# Handles segragating raw iptables input in INLINE rules
|
||||
# Handles segragating raw iptables input in rules
|
||||
#
|
||||
sub split_line2( $$;$$$ ) {
|
||||
my ( $description, $columnsref, $nopad, $maxcolumns, $inline ) = @_;
|
||||
@@ -2437,12 +2436,12 @@ sub split_line2( $$;$$$ ) {
|
||||
}
|
||||
} else {
|
||||
fatal_error "Unknown column ($1)" unless exists $columnsref->{$column};
|
||||
$column = $columnsref->{$column};
|
||||
fatal_error "Non-ASCII gunk in file" if $columns =~ /[^\s[:print:]]/;
|
||||
$value = $1 if $value =~ /^"([^"]+)"$/;
|
||||
$value =~ s/\\"/"/g;
|
||||
fatal_error "Non-ASCII gunk in the value of the $column column" if $columns =~ /[^\s[:print:]]/;
|
||||
$line[$column] = $value;
|
||||
fatal_error "Non-ASCII gunk in the value of the $column column" if $value =~ /[^\s[:print:]]/;
|
||||
my $colnum = $columnsref->{$column};
|
||||
warning_message qq(Replacing "$line[$colnum]" with "$value" in the ) . uc( $column ) . ' column' if $line[$colnum] ne '-';
|
||||
$line[$colnum] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2782,7 +2781,7 @@ sub evaluate_expression( $$$$ ) {
|
||||
my ( $first, $var, $rest ) = ( $1, $3, $4);
|
||||
$var = numeric_value( $var ) if $var =~ /^\d/;
|
||||
$val = $var ? $actparams{$var} : $chain;
|
||||
$usedcaller = USEDCALLER if $var eq 'caller';
|
||||
$usedcaller = USEDCALLER if $var =~ /^(?:caller|callfile|callline)$/;
|
||||
$expression = join_parts( $first, $val, $rest , $just_expand );
|
||||
directive_error( "Variable Expansion Loop" , $filename, $linenumber ) if ++$count > 100;
|
||||
}
|
||||
@@ -2818,7 +2817,6 @@ sub evaluate_expression( $$$$ ) {
|
||||
#
|
||||
# Not a simple one-term expression -- compile it
|
||||
#
|
||||
|
||||
declare_passed unless $evals++;
|
||||
|
||||
$val = eval qq(package Shorewall::User;
|
||||
@@ -2835,6 +2833,7 @@ sub evaluate_expression( $$$$ ) {
|
||||
$val;
|
||||
}
|
||||
|
||||
sub pop_open();
|
||||
#
|
||||
# Set callback
|
||||
#
|
||||
@@ -2842,6 +2841,40 @@ sub directive_callback( $ ) {
|
||||
$directive_callback = shift;
|
||||
}
|
||||
|
||||
sub directive_message( \&$$$$ ) {
|
||||
my ( $functptr, $verbose, $expression, $filename, $linenumber ) = @_;
|
||||
|
||||
unless ( $omitting ) {
|
||||
if ( $actparams{0} ) {
|
||||
#
|
||||
# When issuing a message from an action, report the action invocation
|
||||
# site rather than the action file and line number.
|
||||
#
|
||||
# Avoid double-reporting by temporarily removing the invocation site
|
||||
# from the open stack.
|
||||
#
|
||||
my $saveopens = pop @openstack;
|
||||
|
||||
$functptr->( $verbose ,
|
||||
evaluate_expression( $expression ,
|
||||
$filename ,
|
||||
$linenumber ,
|
||||
1 ),
|
||||
$actparams{callfile} ,
|
||||
$actparams{callline} );
|
||||
push @openstack, $saveopens;
|
||||
} else {
|
||||
$functptr->( $verbose ,
|
||||
evaluate_expression( $expression ,
|
||||
$filename ,
|
||||
$linenumber ,
|
||||
1 ),
|
||||
$filename ,
|
||||
$linenumber );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Each entry in @ifstack consists of a 4-tupple
|
||||
#
|
||||
@@ -2855,7 +2888,8 @@ sub process_compiler_directive( $$$$ ) {
|
||||
|
||||
print "CD===> $line\n" if $debug;
|
||||
|
||||
directive_error( "Invalid compiler directive ($line)" , $filename, $linenumber ) unless $line =~ /^\s*\?(IF\s+|ELSE|ELSIF\s+|ENDIF|SET\s+|RESET\s+|FORMAT\s+|COMMENT\s*|ERROR\s+|WARNING\s+|INFO\s+|WARNING!\s+|INFO!\s+|REQUIRE\s+)(.*)$/i;
|
||||
directive_error( "Invalid compiler directive ($line)" , $filename, $linenumber )
|
||||
unless $line =~ /^\s*\?(IF\s+|ELSE|ELSIF\s+|ENDIF|SET\s+|RESET\s+|FORMAT\s+|COMMENT\s*|ERROR\s+|WARNING\s+|INFO\s+|WARNING!\s+|INFO!\s+|REQUIRE\s+)(.*)$/i;
|
||||
|
||||
my ($keyword, $expression) = ( uc $1, $2 );
|
||||
|
||||
@@ -2957,15 +2991,16 @@ sub process_compiler_directive( $$$$ ) {
|
||||
$var = $2 || 'chain';
|
||||
directive_error( "Shorewall variables may only be RESET in the body of an action", $filename, $linenumber ) unless $actparams{0};
|
||||
if ( exists $actparams{$var} ) {
|
||||
if ( $var =~ /^loglevel|logtag|chain|disposition|caller$/ ) {
|
||||
if ( $var =~ /^(?:loglevel|logtag|chain|disposition|caller|callfile|callline)$/ ) {
|
||||
$actparams{$var} = '';
|
||||
} else {
|
||||
delete $actparams{$var}
|
||||
}
|
||||
|
||||
$parmsmodified = PARMSMODIFIED if @ifstack > $ifstack;
|
||||
} else {
|
||||
directive_warning( 'Yes', "Shorewall variable $2 does not exist", $filename, $linenumber );
|
||||
}
|
||||
|
||||
} else {
|
||||
if ( exists $variables{$2} ) {
|
||||
delete $variables{$2};
|
||||
@@ -2996,68 +3031,85 @@ sub process_compiler_directive( $$$$ ) {
|
||||
|
||||
ERROR => sub() {
|
||||
unless ( $omitting ) {
|
||||
if ( $actparams{0} ) {
|
||||
close $currentfile;
|
||||
#
|
||||
# Avoid 'missing ?ENDIF' error in pop_open'
|
||||
#
|
||||
@ifstack = ();
|
||||
#
|
||||
# Avoid double-reporting the action invocation site
|
||||
#
|
||||
pop_open;
|
||||
|
||||
directive_error( evaluate_expression( $expression ,
|
||||
$filename ,
|
||||
$linenumber ,
|
||||
1 ) ,
|
||||
$actparams{callfile} ,
|
||||
$actparams{callline} ) unless $omitting;
|
||||
$actparams{callline} );
|
||||
} else {
|
||||
directive_error( evaluate_expression( $expression ,
|
||||
$filename ,
|
||||
$linenumber ,
|
||||
1 ) ,
|
||||
$filename ,
|
||||
$linenumber ) unless $omitting;
|
||||
}
|
||||
}
|
||||
} ,
|
||||
|
||||
WARNING => sub() {
|
||||
unless ( $omitting ) {
|
||||
directive_warning( $config{VERBOSE_MESSAGES} ,
|
||||
evaluate_expression( $expression ,
|
||||
directive_message( &directive_warning ,
|
||||
$config{VERBOSE_MESSAGES},
|
||||
$expression ,
|
||||
$filename ,
|
||||
$linenumber ,
|
||||
1 ),
|
||||
$actparams{callfile} ,
|
||||
$actparams{callline} ) unless $omitting;
|
||||
}
|
||||
$linenumber );
|
||||
} ,
|
||||
|
||||
INFO => sub() {
|
||||
unless ( $omitting ) {
|
||||
directive_info( $config{VERBOSE_MESSAGES} ,
|
||||
evaluate_expression( $expression ,
|
||||
directive_message( &directive_info,
|
||||
$config{VERBOSE_MESSAGES} ,
|
||||
$expression ,
|
||||
$filename ,
|
||||
$linenumber ,
|
||||
1 ),
|
||||
$actparams{callfile} ,
|
||||
$actparams{callline} ) unless $omitting;
|
||||
}
|
||||
$linenumber );
|
||||
} ,
|
||||
|
||||
'WARNING!' => sub() {
|
||||
unless ( $omitting ) {
|
||||
directive_warning( ! $config{VERBOSE_MESSAGES} ,
|
||||
evaluate_expression( $expression ,
|
||||
directive_message( &directive_warning ,
|
||||
! $config{VERBOSE_MESSAGES} ,
|
||||
$expression ,
|
||||
$filename ,
|
||||
$linenumber ,
|
||||
1 ),
|
||||
$actparams{callfile} ,
|
||||
$actparams{callline} ) unless $omitting;
|
||||
}
|
||||
$linenumber );
|
||||
} ,
|
||||
|
||||
'INFO!' => sub() {
|
||||
unless ( $omitting ) {
|
||||
directive_info( ! $config{VERBOSE_MESSAGES} ,
|
||||
evaluate_expression( $expression ,
|
||||
directive_message( &directive_info ,
|
||||
! $config{VERBOSE_MESSAGES} ,
|
||||
$expression ,
|
||||
$filename ,
|
||||
$linenumber ,
|
||||
1 ),
|
||||
$actparams{callfile} ,
|
||||
$actparams{callline} ) unless $omitting;
|
||||
}
|
||||
$linenumber );
|
||||
} ,
|
||||
|
||||
REQUIRE => sub() {
|
||||
unless ( $omitting ) {
|
||||
fatal_error "?REQUIRE may only be used within action files" unless $actparams{0};
|
||||
fatal_error "Unknown capability ($expression)" unless $capdesc{$expression};
|
||||
require_capability( $expression, "The $actparams{action} action", 's' );
|
||||
fatal_error "Unknown capability ($expression)" unless ( my $capdesc = $capdesc{$expression} );
|
||||
unless ( have_capability( $expression ) ) {
|
||||
close $currentfile;
|
||||
#
|
||||
# Avoid 'missing ?ENDIF' error in pop_open'
|
||||
#
|
||||
@ifstack = ();
|
||||
#
|
||||
# Avoid double-reporting the action call site
|
||||
#
|
||||
pop_open;
|
||||
|
||||
directive_error( "The $actparams{action} action requires the $capdesc capability",
|
||||
$actparams{callfile} ,
|
||||
$actparams{callline} );
|
||||
}
|
||||
}
|
||||
} ,
|
||||
|
||||
@@ -3559,9 +3611,9 @@ sub push_action_params( $$$$$$ ) {
|
||||
$actparams{loglevel} = $loglevel;
|
||||
$actparams{logtag} = $logtag;
|
||||
$actparams{caller} = $caller;
|
||||
$actparams{disposition} = '' if $chainref->{action};
|
||||
$actparams{callfile} = $currentfilename;
|
||||
$actparams{callline} = $currentlinenumber;
|
||||
$actparams{disposition} = '' if $chainref->{action};
|
||||
#
|
||||
# The Shorewall variable '@chain' has non-word characters other than hyphen removed
|
||||
#
|
||||
@@ -3691,6 +3743,7 @@ sub expand_variables( \$ ) {
|
||||
$usedcaller = USEDCALLER if $var eq 'caller';
|
||||
} else {
|
||||
fatal_error "Undefined shell variable (\$$var)" unless $config{IGNOREUNKNOWNVARIABLES} || exists $config{$var};
|
||||
$val = $config{$var};
|
||||
}
|
||||
|
||||
$val = '' unless defined $val;
|
||||
@@ -5370,8 +5423,12 @@ sub update_config_file( $ ) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$val = conditional_quote $val;
|
||||
if ( supplied $val ) {
|
||||
#
|
||||
# Log LEVEL and DEFAULT settings often contain parens
|
||||
#
|
||||
$val = ($var =~ /(?:LEVEL|DEFAULT)$/) ? qq("$val") : conditional_quote $val;
|
||||
}
|
||||
|
||||
$_ = "$var=$val\n";
|
||||
}
|
||||
@@ -5434,6 +5491,7 @@ EOF
|
||||
sub process_shorewall_conf( $$ ) {
|
||||
my ( $update, $annotate ) = @_;
|
||||
my $file = find_file "$product.conf";
|
||||
my @vars;
|
||||
|
||||
if ( -f $file ) {
|
||||
$globals{CONFIGDIR} = $configfile = $file;
|
||||
@@ -5447,7 +5505,7 @@ sub process_shorewall_conf( $$ ) {
|
||||
# Don't expand shell variables or allow embedded scripting
|
||||
#
|
||||
while ( read_a_line( STRIP_COMMENTS | SUPPRESS_WHITESPACE | CHECK_GUNK ) ) {
|
||||
if ( $currentline =~ /^\s*([a-zA-Z]\w*)=(.*?)\s*$/ ) {
|
||||
if ( $currentline =~ /^\s*([a-zA-Z]\w*)=(.*)$/ ) {
|
||||
my ($var, $val) = ($1, $2);
|
||||
|
||||
if ( exists $config{$var} ) {
|
||||
@@ -5466,6 +5524,12 @@ sub process_shorewall_conf( $$ ) {
|
||||
next;
|
||||
}
|
||||
|
||||
if ( $update ) {
|
||||
push @vars, $var;
|
||||
} else {
|
||||
expand_variables( $val ) unless $val =~ /^'.*'$/;
|
||||
}
|
||||
|
||||
$config{$var} = ( $val =~ /\"([^\"]*)\"$/ ? $1 : $val );
|
||||
|
||||
warning_message "Option $var=$val is deprecated"
|
||||
@@ -5486,14 +5550,19 @@ sub process_shorewall_conf( $$ ) {
|
||||
#
|
||||
# Now update the config file if asked
|
||||
#
|
||||
update_config_file( $annotate ) if $update;
|
||||
if ( $update ) {
|
||||
update_config_file( $annotate );
|
||||
#
|
||||
# Config file update requires that the option values not have
|
||||
# Shell variables expanded. We do that now.
|
||||
#
|
||||
for ( values %config ) {
|
||||
if ( supplied $_ ) {
|
||||
expand_variables( $_ ) unless /^'(.+)'$/;
|
||||
# To handle options like LOG_LEVEL, we process the options
|
||||
# in the order in which they appear in the .conf file.
|
||||
#
|
||||
for ( @vars ) {
|
||||
if ( supplied( my $val = $config{$_} ) ) {
|
||||
expand_variables( $config{$_} ) unless $val =~ /^'.*'$/;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -389,6 +389,8 @@ sub resolve_proto( $ ) {
|
||||
my $proto = $_[0];
|
||||
my $number;
|
||||
|
||||
$proto =~ s/:.*//;
|
||||
|
||||
if ( $proto =~ /^\d+$/ || $proto =~ /^0x/ ) {
|
||||
$number = numeric_value ( $proto );
|
||||
defined $number && $number <= 255 ? $number : undef;
|
||||
|
@@ -1213,7 +1213,6 @@ sub add_common_rules ( $ ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( $family == F_IPV4 ) {
|
||||
my $announced = 0;
|
||||
|
||||
$list = find_interfaces_by_option 'upnp';
|
||||
@@ -1264,7 +1263,6 @@ sub add_common_rules ( $ ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setup_syn_flood_chains;
|
||||
|
||||
|
@@ -369,6 +369,7 @@ sub initialize( $ ) {
|
||||
'icmp-host-prohibited' => 1,
|
||||
'icmp-admin-prohibited' => 1,
|
||||
'icmp-tcp-reset' => 2,
|
||||
'tcp-reset' => 2,
|
||||
);
|
||||
|
||||
} else {
|
||||
@@ -746,22 +747,21 @@ sub process_a_policy1($$$$$$$) {
|
||||
if ( $serverwild ) {
|
||||
for my $zone ( @zonelist ) {
|
||||
for my $zone1 ( @zonelist ) {
|
||||
set_policy_chain rules_chain( ${zone}, ${zone1} ), $client, $server, $chainref, $policy, $intrazone;
|
||||
set_policy_chain rules_chain( ${zone}, ${zone1} ), $zone, $zone1, $chainref, $policy, $intrazone;
|
||||
print_policy $zone, $zone1, $originalpolicy, $chain;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for my $zone ( all_zones ) {
|
||||
set_policy_chain rules_chain( ${zone}, ${server} ), $client, $server, $chainref, $policy, $intrazone;
|
||||
set_policy_chain rules_chain( ${zone}, ${server} ), $zone, $server, $chainref, $policy, $intrazone;
|
||||
print_policy $zone, $server, $originalpolicy, $chain;
|
||||
}
|
||||
}
|
||||
} elsif ( $serverwild ) {
|
||||
for my $zone ( @zonelist ) {
|
||||
set_policy_chain rules_chain( ${client}, ${zone} ), $client, $server, $chainref, $policy, $intrazone;
|
||||
set_policy_chain rules_chain( ${client}, ${zone} ), $client, $zone, $chainref, $policy, $intrazone;
|
||||
print_policy $client, $zone, $originalpolicy, $chain;
|
||||
}
|
||||
|
||||
} else {
|
||||
print_policy $client, $server, $originalpolicy, $chain;
|
||||
}
|
||||
@@ -943,13 +943,14 @@ sub add_policy_rules( $$$$$ ) {
|
||||
#
|
||||
# Default action is an inline
|
||||
#
|
||||
( undef, my $level ) = split /:/, $paction, 2;
|
||||
( $action, my $param ) = get_target_param( $action );
|
||||
|
||||
process_inline( $action, #Inline
|
||||
$chainref, #Chain
|
||||
'', #Matches
|
||||
'', #Matches1
|
||||
$loglevel, #Log Level and Tag
|
||||
$level || '', #Log Level and Tag
|
||||
$paction, #Target
|
||||
$param || '', #Param
|
||||
'-', #Source
|
||||
@@ -1735,12 +1736,12 @@ sub process_action(\$\$$) {
|
||||
|
||||
progress_message2 "$doing $actionfile for chain $chainref->{name}...";
|
||||
|
||||
push_open $actionfile, 2, 1, undef, 2;
|
||||
|
||||
my $oldparms = push_action_params( $action, $chainref, $param, $level, $tag, $caller );
|
||||
my $options = $actionref->{options};
|
||||
my $nolog = $options & ( NOLOG_OPT | LOGJUMP_OPT );
|
||||
|
||||
push_open $actionfile, 2, 1, undef, 2;
|
||||
|
||||
setup_audit_action( $action ) if $options & AUDIT_OPT;
|
||||
|
||||
$active{$action}++;
|
||||
@@ -2717,6 +2718,8 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
|
||||
# tcp-reset
|
||||
#
|
||||
fatal_error "tcp-reset may only be used with PROTO tcp" unless ( resolve_proto( $proto ) || 0 ) == TCP;
|
||||
$exceptionrule = '-p 6 ';
|
||||
$param = 'tcp-reset';
|
||||
}
|
||||
|
||||
$action = "REJECT --reject-with $param";
|
||||
|
@@ -2312,9 +2312,10 @@ EOF
|
||||
EOF
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return ( $mangle, $fn1 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
|
@@ -108,24 +108,6 @@ our @EXPORT = ( qw( NOTHING
|
||||
|
||||
our @EXPORT_OK = qw( initialize );
|
||||
our $VERSION = 'MODULEVERSION';
|
||||
|
||||
#
|
||||
# IPSEC Option types
|
||||
#
|
||||
use constant { NOTHING => 'NOTHING',
|
||||
NUMERIC => '0x[\da-fA-F]+|\d+',
|
||||
NETWORK => '\d+.\d+.\d+.\d+(\/\d+)?',
|
||||
IPSECPROTO => 'ah|esp|ipcomp',
|
||||
IPSECMODE => 'tunnel|transport'
|
||||
};
|
||||
|
||||
#
|
||||
# Option columns
|
||||
#
|
||||
use constant { IN_OUT => 1,
|
||||
IN => 2,
|
||||
OUT => 3 };
|
||||
|
||||
#
|
||||
# Zone Table.
|
||||
#
|
||||
@@ -221,6 +203,26 @@ our $zonemarkincr;
|
||||
our $zonemarklimit;
|
||||
our $loopback_interface;
|
||||
|
||||
#
|
||||
# IPSEC Option types
|
||||
#
|
||||
use constant { NOTHING => 'NOTHING',
|
||||
NUMERIC => '0x[\da-fA-F]+|\d+',
|
||||
IPSECPROTO => 'ah|esp|ipcomp',
|
||||
IPSECMODE => 'tunnel|transport'
|
||||
};
|
||||
|
||||
sub NETWORK() {
|
||||
$family == F_IPV4 ? '\d+.\d+.\d+.\d+(\/\d+)?' : '(?:[0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}(?:\/d+)?';
|
||||
}
|
||||
|
||||
#
|
||||
# Option columns
|
||||
#
|
||||
use constant { IN_OUT => 1,
|
||||
IN => 2,
|
||||
OUT => 3 };
|
||||
|
||||
use constant { FIREWALL => 1,
|
||||
IP => 2,
|
||||
BPORT => 4,
|
||||
@@ -276,19 +278,7 @@ our %maxoptionvalue = ( routefilter => 2, mss => 100000 , wait => 120 , ignore =
|
||||
|
||||
our %validhostoptions;
|
||||
|
||||
our %validzoneoptions = ( mss => NUMERIC,
|
||||
nomark => NOTHING,
|
||||
blacklist => NOTHING,
|
||||
dynamic_shared => NOTHING,
|
||||
strict => NOTHING,
|
||||
next => NOTHING,
|
||||
reqid => NUMERIC,
|
||||
spi => NUMERIC,
|
||||
proto => IPSECPROTO,
|
||||
mode => IPSECMODE,
|
||||
"tunnel-src" => NETWORK,
|
||||
"tunnel-dst" => NETWORK,
|
||||
);
|
||||
our %validzoneoptions;
|
||||
|
||||
use constant { UNRESTRICTED => 1, NOFW => 2 , COMPLEX => 8, IN_OUT_ONLY => 16 };
|
||||
#
|
||||
@@ -330,6 +320,20 @@ sub initialize( $$ ) {
|
||||
$minroot = 0;
|
||||
$loopback_interface = '';
|
||||
|
||||
%validzoneoptions = ( mss => NUMERIC,
|
||||
nomark => NOTHING,
|
||||
blacklist => NOTHING,
|
||||
dynamic_shared => NOTHING,
|
||||
strict => NOTHING,
|
||||
next => NOTHING,
|
||||
reqid => NUMERIC,
|
||||
spi => NUMERIC,
|
||||
proto => IPSECPROTO,
|
||||
mode => IPSECMODE,
|
||||
"tunnel-src" => NETWORK,
|
||||
"tunnel-dst" => NETWORK,
|
||||
);
|
||||
|
||||
if ( $family == F_IPV4 ) {
|
||||
%validinterfaceoptions = (arp_filter => BINARY_IF_OPTION,
|
||||
arp_ignore => ENUM_IF_OPTION,
|
||||
@@ -407,6 +411,8 @@ sub initialize( $$ ) {
|
||||
forward => BINARY_IF_OPTION,
|
||||
physical => STRING_IF_OPTION + IF_OPTION_HOST,
|
||||
unmanaged => SIMPLE_IF_OPTION,
|
||||
upnp => SIMPLE_IF_OPTION,
|
||||
upnpclient => SIMPLE_IF_OPTION,
|
||||
wait => NUMERIC_IF_OPTION + IF_OPTION_WILDOK,
|
||||
);
|
||||
%validhostoptions = (
|
||||
@@ -1313,7 +1319,7 @@ sub process_interface( $$ ) {
|
||||
assert(0);
|
||||
}
|
||||
} elsif ( $type == STRING_IF_OPTION ) {
|
||||
fatal_error "The '$option' option requires a value" unless defined $value;
|
||||
fatal_error "The '$option' option requires a value" unless supplied $value;
|
||||
|
||||
if ( $option eq 'physical' ) {
|
||||
fatal_error "Invalid interface name ($interface)" if $interface =~ /[()\[\]\*\?%]/;
|
||||
|
@@ -43,6 +43,8 @@
|
||||
# --inline # Update alternative column specifications
|
||||
# --update # Update configuration to current release
|
||||
#
|
||||
# If the <filename> is omitted, then a 'check' operation is performed.
|
||||
#
|
||||
use strict;
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin";
|
||||
|
@@ -32,7 +32,7 @@
|
||||
# down Stop an optional interface
|
||||
# enable Enable an optional interface
|
||||
# help Show command syntax
|
||||
# reenable Disable then nable an optional
|
||||
# reenable Disable then enable an optional
|
||||
# interface
|
||||
# refresh Refresh the firewall
|
||||
# reload Reload the firewall
|
||||
|
@@ -33,7 +33,7 @@ FIREWALL=
|
||||
# L O G G I N G
|
||||
###############################################################################
|
||||
|
||||
LOG_LEVEL=info
|
||||
LOG_LEVEL="info"
|
||||
|
||||
BLACKLIST_LOG_LEVEL=
|
||||
|
||||
@@ -55,19 +55,19 @@ LOGTAGONLY=No
|
||||
|
||||
LOGLIMIT="s:1/sec:10"
|
||||
|
||||
MACLIST_LOG_LEVEL=$LOG_LEVEL
|
||||
MACLIST_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
RELATED_LOG_LEVEL=
|
||||
|
||||
RPFILTER_LOG_LEVEL=$LOG_LEVEL
|
||||
RPFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SFILTER_LOG_LEVEL=$LOG_LEVEL
|
||||
SFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SMURF_LOG_LEVEL=$LOG_LEVEL
|
||||
SMURF_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
STARTUP_LOG=/var/log/shorewall-init.log
|
||||
|
||||
TCP_FLAGS_LOG_LEVEL=$LOG_LEVEL
|
||||
TCP_FLAGS_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
UNTRACKED_LOG_LEVEL=
|
||||
|
||||
@@ -109,11 +109,11 @@ TC=
|
||||
# D E F A U L T A C T I O N S / M A C R O S
|
||||
###############################################################################
|
||||
|
||||
ACCEPT_DEFAULT=none
|
||||
ACCEPT_DEFAULT="none"
|
||||
BLACKLIST_DEFAULT="Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,dropInvalid:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
DROP_DEFAULT="Broadcast(DROP),Multicast(DROP)"
|
||||
NFQUEUE_DEFAULT=none
|
||||
QUEUE_DEFAULT=none
|
||||
NFQUEUE_DEFAULT="none"
|
||||
QUEUE_DEFAULT="none"
|
||||
REJECT_DEFAULT="Broadcast(DROP),Multicast(DROP)"
|
||||
|
||||
###############################################################################
|
||||
@@ -217,6 +217,8 @@ OPTIMIZE=All
|
||||
|
||||
OPTIMIZE_ACCOUNTING=No
|
||||
|
||||
PERL_HASH_SEED=0
|
||||
|
||||
REJECT_ACTION=
|
||||
|
||||
REQUIRE_INTERFACE=Yes
|
||||
|
@@ -120,11 +120,11 @@ TC=
|
||||
# D E F A U L T A C T I O N S / M A C R O S
|
||||
###############################################################################
|
||||
|
||||
ACCEPT_DEFAULT=none
|
||||
ACCEPT_DEFAULT="none"
|
||||
BLACKLIST_DEFAULT="Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,dropInvalid:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
DROP_DEFAULT="Broadcast(DROP),Multicast(DROP)"
|
||||
NFQUEUE_DEFAULT=none
|
||||
QUEUE_DEFAULT=none
|
||||
NFQUEUE_DEFAULT="none"
|
||||
QUEUE_DEFAULT="none"
|
||||
REJECT_DEFAULT="Broadcast(DROP),Multicast(DROP)"
|
||||
|
||||
###############################################################################
|
||||
@@ -228,6 +228,8 @@ OPTIMIZE=All
|
||||
|
||||
OPTIMIZE_ACCOUNTING=No
|
||||
|
||||
PERL_HASH_SEED=0
|
||||
|
||||
REJECT_ACTION=
|
||||
|
||||
REQUIRE_INTERFACE=No
|
||||
|
@@ -41,7 +41,7 @@ FIREWALL=
|
||||
# L O G G I N G
|
||||
###############################################################################
|
||||
|
||||
LOG_LEVEL=info
|
||||
LOG_LEVEL="info"
|
||||
|
||||
BLACKLIST_LOG_LEVEL=
|
||||
|
||||
@@ -63,19 +63,19 @@ LOGTAGONLY=No
|
||||
|
||||
LOGLIMIT="s:1/sec:10"
|
||||
|
||||
MACLIST_LOG_LEVEL=$LOG_LEVEL
|
||||
MACLIST_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
RELATED_LOG_LEVEL=
|
||||
|
||||
RPFILTER_LOG_LEVEL=$LOG_LEVEL
|
||||
RPFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SFILTER_LOG_LEVEL=$LOG_LEVEL
|
||||
SFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SMURF_LOG_LEVEL=$LOG_LEVEL
|
||||
SMURF_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
STARTUP_LOG=/var/log/shorewall-init.log
|
||||
|
||||
TCP_FLAGS_LOG_LEVEL=$LOG_LEVEL
|
||||
TCP_FLAGS_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
UNTRACKED_LOG_LEVEL=
|
||||
|
||||
@@ -117,11 +117,11 @@ TC=
|
||||
# D E F A U L T A C T I O N S / M A C R O S
|
||||
###############################################################################
|
||||
|
||||
ACCEPT_DEFAULT=none
|
||||
ACCEPT_DEFAULT="none"
|
||||
BLACKLIST_DEFAULT="Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,dropInvalid:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
DROP_DEFAULT="Broadcast(DROP),Multicast(DROP)"
|
||||
NFQUEUE_DEFAULT=none
|
||||
QUEUE_DEFAULT=none
|
||||
NFQUEUE_DEFAULT="none"
|
||||
QUEUE_DEFAULT="none"
|
||||
REJECT_DEFAULT="Broadcast(DROP),Multicast(DROP)"
|
||||
|
||||
###############################################################################
|
||||
@@ -225,6 +225,8 @@ OPTIMIZE=All
|
||||
|
||||
OPTIMIZE_ACCOUNTING=No
|
||||
|
||||
PERL_HASH_SEED=0
|
||||
|
||||
REJECT_ACTION=
|
||||
|
||||
REQUIRE_INTERFACE=No
|
||||
|
@@ -44,7 +44,7 @@ FIREWALL=
|
||||
# L O G G I N G
|
||||
###############################################################################
|
||||
|
||||
LOG_LEVEL=info
|
||||
LOG_LEVEL="info"
|
||||
|
||||
BLACKLIST_LOG_LEVEL=
|
||||
|
||||
@@ -66,19 +66,19 @@ LOGTAGONLY=No
|
||||
|
||||
LOGLIMIT="s:1/sec:10"
|
||||
|
||||
MACLIST_LOG_LEVEL=$LOG_LEVEL
|
||||
MACLIST_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
RELATED_LOG_LEVEL=
|
||||
|
||||
RPFILTER_LOG_LEVEL=$LOG_LEVEL
|
||||
RPFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SFILTER_LOG_LEVEL=$LOG_LEVEL
|
||||
SFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SMURF_LOG_LEVEL=$LOG_LEVEL
|
||||
SMURF_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
STARTUP_LOG=/var/log/shorewall-init.log
|
||||
|
||||
TCP_FLAGS_LOG_LEVEL=$LOG_LEVEL
|
||||
TCP_FLAGS_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
UNTRACKED_LOG_LEVEL=
|
||||
|
||||
@@ -120,11 +120,11 @@ TC=
|
||||
# D E F A U L T A C T I O N S / M A C R O S
|
||||
###############################################################################
|
||||
|
||||
ACCEPT_DEFAULT=none
|
||||
ACCEPT_DEFAULT="none"
|
||||
BLACKLIST_DEFAULT="Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,dropInvalid:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
DROP_DEFAULT="Broadcast(DROP),Multicast(DROP)"
|
||||
NFQUEUE_DEFAULT=none
|
||||
QUEUE_DEFAULT=none
|
||||
NFQUEUE_DEFAULT="none"
|
||||
QUEUE_DEFAULT="none"
|
||||
REJECT_DEFAULT="Broadcast(DROP),Multicast(DROP)"
|
||||
|
||||
###############################################################################
|
||||
@@ -228,6 +228,8 @@ OPTIMIZE=All
|
||||
|
||||
OPTIMIZE_ACCOUNTING=No
|
||||
|
||||
PERL_HASH_SEED=0
|
||||
|
||||
REJECT_ACTION=
|
||||
|
||||
REQUIRE_INTERFACE=No
|
||||
|
@@ -20,4 +20,4 @@
|
||||
MASQUERADE 10.0.0.0/8,\
|
||||
169.254.0.0/16,\
|
||||
172.16.0.0/12,\
|
||||
92.168.0.0/16 eth0
|
||||
192.168.0.0/16 eth0
|
||||
|
@@ -8,10 +8,12 @@
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION
|
||||
A_AllowICMPs inline # Audited version of AllowICMPs
|
||||
A_Drop # Audited Default Action for DROP policy
|
||||
A_REJECT noinline,logjump # Audits then rejects a connection request
|
||||
A_REJECT! inline # Audits then rejects a connection request
|
||||
A_Reject # Audited Default action for REJECT policy
|
||||
AllowICMPs inline # Allow Required ICMP packets
|
||||
allowBcast inline # Silently Allow Broadcast
|
||||
allowinUPnP inline # Allow UPnP inbound (to firewall) traffic
|
||||
allowInvalid inline # Accepts packets in the INVALID conntrack state
|
||||
|
@@ -33,7 +33,7 @@ FIREWALL=
|
||||
# L O G G I N G
|
||||
###############################################################################
|
||||
|
||||
LOG_LEVEL=info
|
||||
LOG_LEVEL="info"
|
||||
|
||||
BLACKLIST_LOG_LEVEL=
|
||||
|
||||
@@ -55,19 +55,19 @@ LOGTAGONLY=No
|
||||
|
||||
LOGLIMIT="s:1/sec:10"
|
||||
|
||||
MACLIST_LOG_LEVEL=$LOG_LEVEL
|
||||
MACLIST_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
RELATED_LOG_LEVEL=
|
||||
|
||||
RPFILTER_LOG_LEVEL=$LOG_LEVEL
|
||||
RPFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SFILTER_LOG_LEVEL=$LOG_LEVEL
|
||||
SFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SMURF_LOG_LEVEL=$LOG_LEVEL
|
||||
SMURF_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
STARTUP_LOG=/var/log/shorewall-init.log
|
||||
|
||||
TCP_FLAGS_LOG_LEVEL=$LOG_LEVEL
|
||||
TCP_FLAGS_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
UNTRACKED_LOG_LEVEL=
|
||||
|
||||
@@ -109,11 +109,11 @@ TC=
|
||||
# D E F A U L T A C T I O N S / M A C R O S
|
||||
###############################################################################
|
||||
|
||||
ACCEPT_DEFAULT=none
|
||||
ACCEPT_DEFAULT="none"
|
||||
BLACKLIST_DEFAULT="Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,dropInvalid:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
DROP_DEFAULT="Broadcast(DROP),Multicast(DROP)"
|
||||
NFQUEUE_DEFAULT=none
|
||||
QUEUE_DEFAULT=none
|
||||
NFQUEUE_DEFAULT="none"
|
||||
QUEUE_DEFAULT="none"
|
||||
REJECT_DEFAULT="Broadcast(DROP),Multicast(DROP)"
|
||||
|
||||
###############################################################################
|
||||
@@ -217,6 +217,8 @@ OPTIMIZE=All
|
||||
|
||||
OPTIMIZE_ACCOUNTING=No
|
||||
|
||||
PERL_HASH_SEED=0
|
||||
|
||||
REJECT_ACTION=
|
||||
|
||||
REQUIRE_INTERFACE=No
|
||||
|
@@ -442,6 +442,14 @@ if [ -z "$first_install" ]; then
|
||||
delete_file ${DESTDIR}${SHAREDIR}/shorewall/action.A_REJECT
|
||||
delete_file ${DESTDIR}${SHAREDIR}/shorewall/action.Drop
|
||||
delete_file ${DESTDIR}${SHAREDIR}/shorewall/action.Reject
|
||||
delete_file ${DESTDIR}${SHAREDIR}/shorewall/action.A_Drop
|
||||
delete_file ${DESTDIR}${SHAREDIR}/shorewall/action.A_Reject
|
||||
delete_file ${DESTDIR}${SHAREDIR}/shorewall/action.A_AllowICMPs
|
||||
else
|
||||
delete_file ${DESTDIR}${SHAREDIR}/shorewall6/action.A_AllowICMPs
|
||||
delete_file ${DESTDIR}${SHAREDIR}/shorewall6/action.AllowICMPs
|
||||
delete_file ${DESTDIR}${SHAREDIR}/shorewall6/action.Broadcast
|
||||
delete_file ${DESTDIR}${SHAREDIR}/shorewall6/action.Multicast
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -341,6 +341,18 @@ get_config() {
|
||||
setup_dbl
|
||||
fi
|
||||
|
||||
if [ -z "$PERL_HASH_SEED" ]; then
|
||||
PERL_HASH_SEED=0
|
||||
else
|
||||
case $PERL_HASH_SEED in
|
||||
[0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]|random)
|
||||
;;
|
||||
*)
|
||||
fatal_error "Invalid setting ($PERL_HASH_SEED) for PERL_HASH_SEED"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
lib=$(find_file lib.cli-user)
|
||||
|
||||
[ -f $lib ] && . $lib
|
||||
@@ -484,8 +496,17 @@ compiler() {
|
||||
#
|
||||
[ "$g_debugging" != trace -a -z "$g_preview" ] || [ -n "$g_debug" ] && g_pager=
|
||||
|
||||
PERL_HASH_SEED=0
|
||||
case $PERL_HASH_SEED in
|
||||
random)
|
||||
unset PERL_HASH_SEED
|
||||
unset PERL_PERTURB_KEYS
|
||||
;;
|
||||
*)
|
||||
export PERL_HASH_SEED
|
||||
PERL_PERTURB_KEYS=0
|
||||
export PERL_PERTURB_KEYS
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ ${PERLLIBDIR} = ${LIBEXECDIR}/shorewall ]; then
|
||||
eval $PERL $debugflags $pc $options $@ $g_pager
|
||||
@@ -513,28 +534,6 @@ start_command() {
|
||||
local rc
|
||||
rc=0
|
||||
|
||||
do_it() {
|
||||
if [ -n "$AUTOMAKE" ]; then
|
||||
[ -n "$nolock" ] || mutex_on
|
||||
run_it ${VARDIR}/firewall $g_debugging start
|
||||
rc=$?
|
||||
[ -n "$nolock" ] || mutex_off
|
||||
else
|
||||
g_file="${VARDIR}/.start"
|
||||
if compiler $g_debugging $nolock compile "$g_file"; then
|
||||
[ -n "$nolock" ] || mutex_on
|
||||
run_it ${VARDIR}/.start $g_debugging start
|
||||
rc=$?
|
||||
[ -n "$nolock" ] || mutex_off
|
||||
else
|
||||
rc=$?
|
||||
mylogger kern.err "ERROR:$g_product start failed"
|
||||
fi
|
||||
fi
|
||||
|
||||
exit $rc
|
||||
}
|
||||
|
||||
if product_is_started; then
|
||||
error_message "Shorewall is already running"
|
||||
exit 0
|
||||
@@ -626,7 +625,25 @@ start_command() {
|
||||
fi
|
||||
fi
|
||||
|
||||
do_it
|
||||
if [ -n "$AUTOMAKE" ]; then
|
||||
[ -n "$nolock" ] || mutex_on
|
||||
run_it ${VARDIR}/firewall $g_debugging start
|
||||
rc=$?
|
||||
[ -n "$nolock" ] || mutex_off
|
||||
else
|
||||
g_file="${VARDIR}/.start"
|
||||
if compiler $g_debugging $nolock compile "$g_file"; then
|
||||
[ -n "$nolock" ] || mutex_on
|
||||
run_it ${VARDIR}/.start $g_debugging start
|
||||
rc=$?
|
||||
[ -n "$nolock" ] || mutex_off
|
||||
else
|
||||
rc=$?
|
||||
mylogger kern.err "ERROR:$g_product start failed"
|
||||
fi
|
||||
fi
|
||||
|
||||
exit $rc
|
||||
}
|
||||
|
||||
#
|
||||
|
@@ -1028,15 +1028,16 @@ Normal-Service => 0x00</programlisting>
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">PROTO</emphasis> - {<emphasis
|
||||
role="bold">-</emphasis>|<emphasis
|
||||
role="bold">{tcp:syn</emphasis>|<emphasis
|
||||
role="bold">{tcp:[!]syn</emphasis>|<emphasis
|
||||
role="bold">ipp2p</emphasis>|<emphasis
|
||||
role="bold">ipp2p:udp</emphasis>|<emphasis
|
||||
role="bold">ipp2p:all</emphasis>|<emphasis>protocol-number</emphasis>|<emphasis>protocol-name</emphasis>|<emphasis
|
||||
role="bold">all}[,...]}</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Protocol - <emphasis role="bold">ipp2p</emphasis> requires
|
||||
ipp2p match support in your kernel and iptables.</para>
|
||||
<para>See <ulink
|
||||
url="shorewall-rules.html">shorewall-rules(5)</ulink> for
|
||||
details.</para>
|
||||
|
||||
<para>Beginning with Shorewall 4.5.12, this column can accept a
|
||||
comma-separated list of protocols.</para>
|
||||
|
@@ -594,7 +594,7 @@
|
||||
<para>Added in Shorewall 4.5.9.3. 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">http://www.shorewall.net/shorewall_logging.html</ulink>.</para>
|
||||
url="/shorewall_logging.html">http://www.shorewall.net/shorewall_logging.html</ulink>.</para>
|
||||
|
||||
<para>The <replaceable>nflog-parameters</replaceable> are a
|
||||
comma-separated list of up to 3 numbers:</para>
|
||||
@@ -729,7 +729,9 @@
|
||||
<member><option>icmp-admin-prohibited</option></member>
|
||||
|
||||
<member><option>icmp-tcp-reset</option> (the PROTO column
|
||||
must specify TCP)</member>
|
||||
must specify TCP). Beginning with Shorewall 5.1.3, this
|
||||
option may also be specified as
|
||||
<option>tcp-reset</option>.</member>
|
||||
</simplelist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -845,7 +847,7 @@
|
||||
<para>Added in Shorewall 4.5.10. 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">http://www.shorewall.net/shorewall_logging.html</ulink>.</para>
|
||||
url="/shorewall_logging.html">http://www.shorewall.net/shorewall_logging.html</ulink>.</para>
|
||||
|
||||
<para>Similar to<emphasis role="bold">
|
||||
LOG:ULOG</emphasis>[(<replaceable>ulog-parameters</replaceable>)],
|
||||
@@ -1592,7 +1594,7 @@
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">PROTO</emphasis>- {<emphasis
|
||||
role="bold">-</emphasis>|<emphasis
|
||||
role="bold">tcp:syn</emphasis>|<emphasis
|
||||
role="bold">tcp:[!]syn</emphasis>|<emphasis
|
||||
role="bold">ipp2p</emphasis>|<emphasis
|
||||
role="bold">ipp2p:udp</emphasis>|<emphasis
|
||||
role="bold">ipp2p:all</emphasis>|<emphasis>protocol-number</emphasis>|<emphasis>protocol-name</emphasis>|<emphasis
|
||||
@@ -1603,7 +1605,10 @@
|
||||
requires ipp2p match support in your kernel and iptables. <emphasis
|
||||
role="bold">tcp:syn</emphasis> implies <emphasis
|
||||
role="bold">tcp</emphasis> plus the SYN flag must be set and the
|
||||
RST,ACK and FIN flags must be reset.</para>
|
||||
RST, ACK and FIN flags must be reset. Beginning with Shorewall
|
||||
5.1.3, you may also specify <emphasis
|
||||
role="bold">tcp:!syn</emphasis>, which matches if SYN is not set or
|
||||
if RST, ACK or FIN is set.</para>
|
||||
|
||||
<para>Beginning with Shorewall 4.4.19, this column can contain a
|
||||
comma-separated list of protocol-numbers and/or protocol
|
||||
|
@@ -229,8 +229,9 @@
|
||||
role="bold">all}[,...]</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Protocol - <emphasis role="bold">ipp2p</emphasis> requires
|
||||
ipp2p match support in your kernel and iptables.</para>
|
||||
<para> See <ulink
|
||||
url="shorewall-rules.html">shorewall-rules(5)</ulink> for
|
||||
details.</para>
|
||||
|
||||
<para>Beginning with Shorewall 4.5.12, this column can accept a
|
||||
comma-separated list of protocols.</para>
|
||||
|
@@ -256,8 +256,9 @@
|
||||
|
||||
<listitem>
|
||||
<para>If you wish to restrict this entry to a particular protocol
|
||||
then enter the protocol name (from protocols(5)) or number
|
||||
here.</para>
|
||||
then enter the protocol name (from protocols(5)) or number here. See
|
||||
<ulink url="shorewall-rules.html">shorewall-rules(5)</ulink> for
|
||||
details.</para>
|
||||
|
||||
<para>Beginning with Shorewall 4.5.12, this column can accept a
|
||||
comma-separated list of protocols.</para>
|
||||
|
@@ -2153,6 +2153,21 @@ LOG:info:,bar net fw</programlisting>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">PERL_HASH_SEED=</emphasis><emphasis
|
||||
role="bold"><replaceable>seed</replaceable><emphasis
|
||||
role="bold">|random</emphasis></emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 5.1.4. Sets the Perl hash
|
||||
<replaceable>seed</replaceable> (an integer in the range 0-99999)
|
||||
when running the Shorewall rules compiler. If not specified, the
|
||||
value 0 is assumed. If <option>random</option> is specified, a
|
||||
random seed will be chosed by Perl. See perlsec(1) for additional
|
||||
information.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis
|
||||
role="bold">PROVIDER_BITS</emphasis>=[<replaceable>number</replaceable>]</term>
|
||||
|
@@ -16,7 +16,7 @@ RemainAfterExit=yes
|
||||
EnvironmentFile=-/etc/default/shorewall
|
||||
StandardOutput=syslog
|
||||
ExecStart=/sbin/shorewall $OPTIONS start $STARTOPTIONS
|
||||
ExecStop=/sbin/shorewall $OPTIONS stop
|
||||
ExecStop=/sbin/shorewall $OPTIONS clear
|
||||
ExecReload=/sbin/shorewall $OPTIONS reload $RELOADOPTIONS
|
||||
|
||||
[Install]
|
||||
|
@@ -15,7 +15,7 @@ RemainAfterExit=yes
|
||||
EnvironmentFile=-/etc/default/shorewall6-lite
|
||||
StandardOutput=syslog
|
||||
ExecStart=/sbin/shorewall6-lite $OPTIONS start
|
||||
ExecStop=/sbin/shorewall6-lite $OPTIONS stop
|
||||
ExecStop=/sbin/shorewall6-lite $OPTIONS clear
|
||||
ExecReload=/sbin/shorewall6-lite $OPTIONS reload
|
||||
|
||||
[Install]
|
||||
|
@@ -1,38 +0,0 @@
|
||||
#
|
||||
# Shorewall6 -- /usr/share/shorewall6/action.A_AllowICMPs
|
||||
#
|
||||
# This action A_ACCEPTs needed ICMP types
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DPORT
|
||||
|
||||
?comment Needed ICMP types (RFC4890)
|
||||
|
||||
A_ACCEPT - - ipv6-icmp destination-unreachable
|
||||
A_ACCEPT - - ipv6-icmp packet-too-big
|
||||
A_ACCEPT - - ipv6-icmp time-exceeded
|
||||
A_ACCEPT - - ipv6-icmp parameter-problem
|
||||
|
||||
# The following should have a ttl of 255 and must be allowed to transit a bridge
|
||||
A_ACCEPT - - ipv6-icmp router-solicitation
|
||||
A_ACCEPT - - ipv6-icmp router-advertisement
|
||||
A_ACCEPT - - ipv6-icmp neighbour-solicitation
|
||||
A_ACCEPT - - ipv6-icmp neighbour-advertisement
|
||||
A_ACCEPT - - ipv6-icmp 137 # Redirect
|
||||
A_ACCEPT - - ipv6-icmp 141 # Inverse neighbour discovery solicitation
|
||||
A_ACCEPT - - ipv6-icmp 142 # Inverse neighbour discovery advertisement
|
||||
|
||||
# The following should have a link local source address and must be allowed to transit a bridge
|
||||
A_ACCEPT fe80::/10 - ipv6-icmp 130 # Listener query
|
||||
A_ACCEPT fe80::/10 - ipv6-icmp 131 # Listener report
|
||||
A_ACCEPT fe80::/10 - ipv6-icmp 132 # Listener done
|
||||
A_ACCEPT fe80::/10 - ipv6-icmp 143 # Listener report v2
|
||||
|
||||
# The following should be received with a ttl of 255 and must be allowed to transit a bridge
|
||||
A_ACCEPT - - ipv6-icmp 148 # Certificate path solicitation
|
||||
A_ACCEPT - - 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 abridge
|
||||
A_ACCEPT fe80::/10 - ipv6-icmp 151 # Multicast router advertisement
|
||||
A_ACCEPT fe80::/10 - ipv6-icmp 152 # Multicast router solicitation
|
||||
A_ACCEPT fe80::/10 - ipv6-icmp 153 # Multicast router termination
|
@@ -1,40 +0,0 @@
|
||||
#
|
||||
# Shorewall6 -- /usr/share/shorewall6/action.AllowICMPs
|
||||
#
|
||||
# This action ACCEPTs needed ICMP types
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DPORT
|
||||
|
||||
DEFAULTS ACCEPT
|
||||
|
||||
?COMMENT Needed ICMP types (RFC4890)
|
||||
|
||||
$1 - - ipv6-icmp destination-unreachable
|
||||
$1 - - ipv6-icmp packet-too-big
|
||||
$1 - - ipv6-icmp time-exceeded
|
||||
$1 - - ipv6-icmp parameter-problem
|
||||
|
||||
# The following should have a ttl of 255 and must be allowed to transit a bridge
|
||||
$1 - - ipv6-icmp router-solicitation
|
||||
$1 - - ipv6-icmp router-advertisement
|
||||
$1 - - ipv6-icmp neighbour-solicitation
|
||||
$1 - - ipv6-icmp neighbour-advertisement
|
||||
$1 - - ipv6-icmp 137 # Redirect
|
||||
$1 - - ipv6-icmp 141 # Inverse neighbour discovery solicitation
|
||||
$1 - - ipv6-icmp 142 # Inverse neighbour discovery advertisement
|
||||
|
||||
# The following should have a link local source address and must be allowed to transit a bridge
|
||||
$1 fe80::/10 - ipv6-icmp 130 # Listener query
|
||||
$1 fe80::/10 - ipv6-icmp 131 # Listener report
|
||||
$1 fe80::/10 - ipv6-icmp 132 # Listener done
|
||||
$1 fe80::/10 - ipv6-icmp 143 # Listener report v2
|
||||
|
||||
# The following should be received with a ttl of 255 and must be allowed to transit a bridge
|
||||
$1 - - ipv6-icmp 148 # Certificate path solicitation
|
||||
$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 abridge
|
||||
$1 fe80::/10 - ipv6-icmp 151 # Multicast router advertisement
|
||||
$1 fe80::/10 - ipv6-icmp 152 # Multicast router solicitation
|
||||
$1 fe80::/10 - ipv6-icmp 153 # Multicast router termination
|
@@ -1,65 +0,0 @@
|
||||
#
|
||||
# Shorewall6 -- /usr/share/shorewall6/action.Broadcast
|
||||
#
|
||||
# Multicast/Anycast IPv6 Action
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2011-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.
|
||||
#
|
||||
# Broadcast[([<action>|-[,{audit|-}])]
|
||||
#
|
||||
# Default action is DROP
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS DROP,-
|
||||
|
||||
?begin perl;
|
||||
|
||||
use Shorewall::IPAddrs;
|
||||
use Shorewall::Config;
|
||||
use Shorewall::Chains;
|
||||
|
||||
my $chainref = get_action_chain;
|
||||
my ( $action, $audit ) = get_action_params( 2 );
|
||||
my ( $level, $tag ) = get_action_logging;
|
||||
my $target = require_audit ( $action , $audit );
|
||||
|
||||
fatal_error "Invalid parameter to action Broadcast" if supplied $audit && $audit ne 'audit';
|
||||
|
||||
if ( have_capability( 'ADDRTYPE' ) ) {
|
||||
if ( $level ne '' ) {
|
||||
log_rule_limit $level, $chainref, 'Broadcast' , $action, '', $tag, 'add', ' -m addrtype --dst-type BROADCAST ';
|
||||
log_rule_limit $level, $chainref, 'Broadcast' , $action, '', $tag, 'add', ' -m addrtype --dst-type ANYCAST ';
|
||||
}
|
||||
|
||||
add_jump $chainref, $target, 0, '-m addrtype --dst-type BROADCAST ';
|
||||
add_jump $chainref, $target, 0, '-m addrtype --dst-type ANYCAST ';
|
||||
} else {
|
||||
add_commands $chainref, 'for address in $ALL_ACASTS; do';
|
||||
incr_cmd_level $chainref;
|
||||
log_rule_limit $level, $chainref, 'Broadcast' , $action, '', $tag, 'add', ' -d $address ' if $level ne '';
|
||||
add_jump $chainref, $target, 0, "-d \$address ";
|
||||
decr_cmd_level $chainref;
|
||||
add_commands $chainref, 'done';
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
?end perl;
|
@@ -1,59 +0,0 @@
|
||||
#
|
||||
# Shorewall6 -- /usr/share/shorewall6/action.Multicast
|
||||
#
|
||||
# Multicast/Anycast IPv6 Action
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2011-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.
|
||||
#
|
||||
# Multicast[([<action>|-[,{audit|-}])]
|
||||
#
|
||||
# Default action is DROP
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
DEFAULTS DROP,-
|
||||
|
||||
?begin perl;
|
||||
|
||||
use Shorewall::IPAddrs;
|
||||
use Shorewall::Config;
|
||||
use Shorewall::Chains;
|
||||
|
||||
my $chainref = get_action_chain;
|
||||
my ( $action, $audit ) = get_action_params( 2 );
|
||||
my ( $level, $tag ) = get_action_logging;
|
||||
my $target = require_audit ( $action , $audit );
|
||||
|
||||
fatal_error "Invalid parameter to action Broadcast" if supplied $audit && $audit ne 'audit';
|
||||
|
||||
if ( have_capability( 'ADDRTYPE' ) ) {
|
||||
if ( $level ne '' ) {
|
||||
log_rule_limit $level, $chainref, 'Multicast' , $action, '', $tag, 'add', ' -m addrtype --dst-type MULTICAST ';
|
||||
}
|
||||
|
||||
add_jump $chainref, $target, 0, '-m addrtype --dst-type MULTICAST ';
|
||||
} else {
|
||||
log_rule_limit( $level, $chainref, 'Broadcast' , $action, '', $tag, 'add', join( ' ', '-d', IPv6_MULTICAST . ' ' ) ) if $level ne '';
|
||||
add_jump $chainref, $target, 0, join( ' ', '-d', IPv6_MULTICAST . ' ' );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
?end perl;
|
@@ -34,7 +34,7 @@ FIREWALL=
|
||||
# L O G G I N G
|
||||
###############################################################################
|
||||
|
||||
LOG_LEVEL=info
|
||||
LOG_LEVEL="info"
|
||||
|
||||
BLACKLIST_LOG_LEVEL=
|
||||
|
||||
@@ -54,19 +54,19 @@ LOGLIMIT="s:1/sec:10"
|
||||
|
||||
LOGTAGONLY=No
|
||||
|
||||
MACLIST_LOG_LEVEL=info
|
||||
MACLIST_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
RELATED_LOG_LEVEL=
|
||||
|
||||
RPFILTER_LOG_LEVEL=info
|
||||
RPFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SFILTER_LOG_LEVEL=info
|
||||
SFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SMURF_LOG_LEVEL=info
|
||||
SMURF_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
STARTUP_LOG=/var/log/shorewall6-init.log
|
||||
|
||||
TCP_FLAGS_LOG_LEVEL=info
|
||||
TCP_FLAGS_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
UNTRACKED_LOG_LEVEL=
|
||||
|
||||
@@ -74,7 +74,7 @@ UNTRACKED_LOG_LEVEL=
|
||||
# L O C A T I O N O F F I L E S A N D D I R E C T O R I E S
|
||||
###############################################################################
|
||||
|
||||
CONFIG_PATH=${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall
|
||||
CONFIG_PATH=${CONFDIR}/shorewall6:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall
|
||||
|
||||
GEOIPDIR=/usr/share/xt_geoip/LE
|
||||
|
||||
@@ -106,11 +106,11 @@ TC=
|
||||
# D E F A U L T A C T I O N S / M A C R O S
|
||||
###############################################################################
|
||||
|
||||
ACCEPT_DEFAULT=none
|
||||
BLACKLIST_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
ACCEPT_DEFAULT="none"
|
||||
BLACKLIST_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,dropInvalid:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
DROP_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP)"
|
||||
NFQUEUE_DEFAULT=none
|
||||
QUEUE_DEFAULT=none
|
||||
NFQUEUE_DEFAULT="none"
|
||||
QUEUE_DEFAULT="none"
|
||||
REJECT_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP)"
|
||||
|
||||
###############################################################################
|
||||
@@ -188,6 +188,8 @@ MANGLE_ENABLED=Yes
|
||||
|
||||
MARK_IN_FORWARD_CHAIN=No
|
||||
|
||||
MINIUPNPD=No
|
||||
|
||||
MODULE_SUFFIX="ko ko.xz"
|
||||
|
||||
MUTEX_TIMEOUT=60
|
||||
@@ -196,6 +198,8 @@ OPTIMIZE=All
|
||||
|
||||
OPTIMIZE_ACCOUNTING=No
|
||||
|
||||
PERL_HASH_SEED=0
|
||||
|
||||
REJECT_ACTION=
|
||||
|
||||
REQUIRE_INTERFACE=Yes
|
||||
@@ -206,7 +210,7 @@ RESTORE_ROUTEMARKS=Yes
|
||||
|
||||
SAVE_IPSETS=No
|
||||
|
||||
TC_ENABLED=No
|
||||
TC_ENABLED=Shared
|
||||
|
||||
TC_EXPERT=No
|
||||
|
||||
|
@@ -35,7 +35,7 @@ FIREWALL=
|
||||
# L O G G I N G
|
||||
###############################################################################
|
||||
|
||||
LOG_LEVEL=info
|
||||
LOG_LEVEL="info"
|
||||
|
||||
BLACKLIST_LOG_LEVEL=
|
||||
|
||||
@@ -55,19 +55,19 @@ LOGLIMIT="s:1/sec:10"
|
||||
|
||||
LOGTAGONLY=No
|
||||
|
||||
MACLIST_LOG_LEVEL=info
|
||||
MACLIST_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
RELATED_LOG_LEVEL=
|
||||
|
||||
RPFILTER_LOG_LEVEL=info
|
||||
RPFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SFILTER_LOG_LEVEL=info
|
||||
SFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SMURF_LOG_LEVEL=info
|
||||
SMURF_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
STARTUP_LOG=/var/log/shorewall6-init.log
|
||||
|
||||
TCP_FLAGS_LOG_LEVEL=info
|
||||
TCP_FLAGS_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
UNTRACKED_LOG_LEVEL=
|
||||
|
||||
@@ -107,11 +107,11 @@ TC=
|
||||
# D E F A U L T A C T I O N S / M A C R O S
|
||||
###############################################################################
|
||||
|
||||
ACCEPT_DEFAULT=none
|
||||
BLACKLIST_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
ACCEPT_DEFAULT="none"
|
||||
BLACKLIST_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,dropInvalid:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
DROP_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP)"
|
||||
NFQUEUE_DEFAULT=none
|
||||
QUEUE_DEFAULT=none
|
||||
NFQUEUE_DEFAULT="none"
|
||||
QUEUE_DEFAULT="none"
|
||||
REJECT_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP)"
|
||||
|
||||
###############################################################################
|
||||
@@ -189,6 +189,8 @@ MANGLE_ENABLED=Yes
|
||||
|
||||
MARK_IN_FORWARD_CHAIN=No
|
||||
|
||||
MINIUPNPD=No
|
||||
|
||||
MODULE_SUFFIX="ko ko.xz"
|
||||
|
||||
MUTEX_TIMEOUT=60
|
||||
@@ -197,6 +199,8 @@ OPTIMIZE=All
|
||||
|
||||
OPTIMIZE_ACCOUNTING=No
|
||||
|
||||
PERL_HASH_SEED=0
|
||||
|
||||
REJECT_ACTION=
|
||||
|
||||
REQUIRE_INTERFACE=No
|
||||
@@ -207,7 +211,7 @@ RESTORE_ROUTEMARKS=Yes
|
||||
|
||||
SAVE_IPSETS=No
|
||||
|
||||
TC_ENABLED=No
|
||||
TC_ENABLED=Shared
|
||||
|
||||
TC_EXPERT=No
|
||||
|
||||
|
@@ -34,7 +34,7 @@ FIREWALL=
|
||||
# L O G G I N G
|
||||
###############################################################################
|
||||
|
||||
LOG_LEVEL=info
|
||||
LOG_LEVEL="info"
|
||||
|
||||
BLACKLIST_LOG_LEVEL=
|
||||
|
||||
@@ -54,19 +54,19 @@ LOGLIMIT="s:1/sec:10"
|
||||
|
||||
LOGTAGONLY=No
|
||||
|
||||
MACLIST_LOG_LEVEL=info
|
||||
MACLIST_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
RELATED_LOG_LEVEL=
|
||||
|
||||
RPFILTER_LOG_LEVEL=info
|
||||
RPFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SFILTER_LOG_LEVEL=info
|
||||
SFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SMURF_LOG_LEVEL=info
|
||||
SMURF_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
STARTUP_LOG=/var/log/shorewall6-init.log
|
||||
|
||||
TCP_FLAGS_LOG_LEVEL=info
|
||||
TCP_FLAGS_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
UNTRACKED_LOG_LEVEL=
|
||||
|
||||
@@ -106,11 +106,11 @@ TC=
|
||||
# D E F A U L T A C T I O N S / M A C R O S
|
||||
###############################################################################
|
||||
|
||||
ACCEPT_DEFAULT=none
|
||||
BLACKLIST_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
ACCEPT_DEFAULT="none"
|
||||
BLACKLIST_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,dropInvalid:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
DROP_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP)"
|
||||
NFQUEUE_DEFAULT=none
|
||||
QUEUE_DEFAULT=none
|
||||
NFQUEUE_DEFAULT="none"
|
||||
QUEUE_DEFAULT="none"
|
||||
REJECT_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP)"
|
||||
|
||||
###############################################################################
|
||||
@@ -188,6 +188,8 @@ MANGLE_ENABLED=Yes
|
||||
|
||||
MARK_IN_FORWARD_CHAIN=No
|
||||
|
||||
MINIUPNPD=No
|
||||
|
||||
MODULE_SUFFIX="ko ko.xz"
|
||||
|
||||
MUTEX_TIMEOUT=60
|
||||
@@ -196,6 +198,8 @@ OPTIMIZE=All
|
||||
|
||||
OPTIMIZE_ACCOUNTING=No
|
||||
|
||||
PERL_HASH_SEED=0
|
||||
|
||||
REJECT_ACTION=
|
||||
|
||||
REQUIRE_INTERFACE=No
|
||||
@@ -206,7 +210,7 @@ RESTORE_ROUTEMARKS=Yes
|
||||
|
||||
SAVE_IPSETS=No
|
||||
|
||||
TC_ENABLED=No
|
||||
TC_ENABLED=Shared
|
||||
|
||||
TC_EXPERT=No
|
||||
|
||||
|
@@ -34,7 +34,7 @@ FIREWALL=
|
||||
# L O G G I N G
|
||||
###############################################################################
|
||||
|
||||
LOG_LEVEL=info
|
||||
LOG_LEVEL="info"
|
||||
|
||||
BLACKLIST_LOG_LEVEL=
|
||||
|
||||
@@ -54,19 +54,19 @@ LOGLIMIT="s:1/sec:10"
|
||||
|
||||
LOGTAGONLY=No
|
||||
|
||||
MACLIST_LOG_LEVEL=info
|
||||
MACLIST_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
RELATED_LOG_LEVEL=
|
||||
|
||||
RPFILTER_LOG_LEVEL=info
|
||||
RPFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SFILTER_LOG_LEVEL=info
|
||||
SFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SMURF_LOG_LEVEL=info
|
||||
SMURF_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
STARTUP_LOG=/var/log/shorewall6-init.log
|
||||
|
||||
TCP_FLAGS_LOG_LEVEL=info
|
||||
TCP_FLAGS_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
UNTRACKED_LOG_LEVEL=
|
||||
|
||||
@@ -106,11 +106,11 @@ TC=
|
||||
# D E F A U L T A C T I O N S / M A C R O S
|
||||
###############################################################################
|
||||
|
||||
ACCEPT_DEFAULT=none
|
||||
BLACKLIST_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
ACCEPT_DEFAULT="none"
|
||||
BLACKLIST_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,dropInvalid:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
DROP_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP)"
|
||||
NFQUEUE_DEFAULT=none
|
||||
QUEUE_DEFAULT=none
|
||||
NFQUEUE_DEFAULT="none"
|
||||
QUEUE_DEFAULT="none"
|
||||
REJECT_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP)"
|
||||
|
||||
###############################################################################
|
||||
@@ -188,6 +188,8 @@ MANGLE_ENABLED=Yes
|
||||
|
||||
MARK_IN_FORWARD_CHAIN=No
|
||||
|
||||
MINIUPNPD=No
|
||||
|
||||
MODULE_SUFFIX="ko ko.xz"
|
||||
|
||||
MUTEX_TIMEOUT=60
|
||||
@@ -196,6 +198,8 @@ OPTIMIZE=All
|
||||
|
||||
OPTIMIZE_ACCOUNTING=No
|
||||
|
||||
PERL_HASH_SEED=0
|
||||
|
||||
REJECT_ACTION=
|
||||
|
||||
REQUIRE_INTERFACE=No
|
||||
@@ -206,7 +210,7 @@ RESTORE_ROUTEMARKS=Yes
|
||||
|
||||
SAVE_IPSETS=No
|
||||
|
||||
TC_ENABLED=No
|
||||
TC_ENABLED=Shared
|
||||
|
||||
TC_EXPERT=No
|
||||
|
||||
|
@@ -27,6 +27,7 @@ DropDNSrep inline # Drops DNS replies
|
||||
DropSmurfs noinline # Handles packets with a broadcast source address
|
||||
Established inline,\ # Handles packets in the ESTABLISHED state
|
||||
state=ESTABLISHED
|
||||
forwardUPnP noinline # Allow traffic that upnpd has redirected from 'upnp' interfaces.
|
||||
IfEvent noinline # Perform an action based on an event
|
||||
Invalid inline,audit,\ # Handles packets in the INVALID conntrack state
|
||||
state=INVALID
|
||||
|
@@ -34,7 +34,7 @@ FIREWALL=
|
||||
# L O G G I N G
|
||||
###############################################################################
|
||||
|
||||
LOG_LEVEL=info
|
||||
LOG_LEVEL="info"
|
||||
|
||||
BLACKLIST_LOG_LEVEL=
|
||||
|
||||
@@ -54,19 +54,19 @@ LOGLIMIT="s:1/sec:10"
|
||||
|
||||
LOGTAGONLY=No
|
||||
|
||||
MACLIST_LOG_LEVEL=$LOG_LEVEL
|
||||
MACLIST_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
RELATED_LOG_LEVEL=
|
||||
|
||||
RPFILTER_LOG_LEVEL=$LOG_LEVEL
|
||||
RPFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SFILTER_LOG_LEVEL=$LOG_LEVEL
|
||||
SFILTER_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
SMURF_LOG_LEVEL=$LOG_LEVEL
|
||||
SMURF_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
STARTUP_LOG=/var/log/shorewall6-init.log
|
||||
|
||||
TCP_FLAGS_LOG_LEVEL=$LOG_LEVEL
|
||||
TCP_FLAGS_LOG_LEVEL="$LOG_LEVEL"
|
||||
|
||||
UNTRACKED_LOG_LEVEL=
|
||||
|
||||
@@ -106,11 +106,11 @@ TC=
|
||||
# D E F A U L T A C T I O N S / M A C R O S
|
||||
###############################################################################
|
||||
|
||||
ACCEPT_DEFAULT=none
|
||||
BLACKLIST_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
ACCEPT_DEFAULT="none"
|
||||
BLACKLIST_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,dropInvalid:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
DROP_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP)"
|
||||
NFQUEUE_DEFAULT=none
|
||||
QUEUE_DEFAULT=none
|
||||
NFQUEUE_DEFAULT="none"
|
||||
QUEUE_DEFAULT="none"
|
||||
REJECT_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP)"
|
||||
|
||||
###############################################################################
|
||||
@@ -188,6 +188,8 @@ MANGLE_ENABLED=Yes
|
||||
|
||||
MARK_IN_FORWARD_CHAIN=No
|
||||
|
||||
MINIUPNPD=No
|
||||
|
||||
MODULE_SUFFIX=ko
|
||||
|
||||
MUTEX_TIMEOUT=60
|
||||
@@ -196,6 +198,8 @@ OPTIMIZE=All
|
||||
|
||||
OPTIMIZE_ACCOUNTING=No
|
||||
|
||||
PERL_HASH_SEED=0
|
||||
|
||||
REJECT_ACTION=
|
||||
|
||||
REQUIRE_INTERFACE=No
|
||||
@@ -206,7 +210,7 @@ RESTORE_ROUTEMARKS=Yes
|
||||
|
||||
SAVE_IPSETS=No
|
||||
|
||||
TC_ENABLED=No
|
||||
TC_ENABLED=Shared
|
||||
|
||||
TC_EXPERT=No
|
||||
|
||||
|
@@ -1026,8 +1026,9 @@ Normal-Service => 0x00</programlisting>
|
||||
role="bold">all}[,...]}</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Protocol - <emphasis role="bold">ipp2p</emphasis> requires
|
||||
ipp2p match support in your kernel and iptables.</para>
|
||||
<para>See <ulink
|
||||
url="shorewall-rules.html">shorewall6-rules(5)</ulink> for
|
||||
details.</para>
|
||||
|
||||
<para>Beginning with Shorewall 4.5.12, this column can accept a
|
||||
comma-separated list of protocols.</para>
|
||||
|
@@ -1392,7 +1392,7 @@
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">PROTO</emphasis> - {<emphasis
|
||||
role="bold">-</emphasis>|<emphasis
|
||||
role="bold">tcp:syn</emphasis>|<emphasis
|
||||
role="bold">tcp:[!]syn</emphasis>|<emphasis
|
||||
role="bold">ipp2p</emphasis>|<emphasis
|
||||
role="bold">ipp2p:udp</emphasis>|<emphasis
|
||||
role="bold">ipp2p:all</emphasis>|<emphasis>protocol-number</emphasis>|<emphasis>protocol-name</emphasis>|<emphasis
|
||||
@@ -1403,7 +1403,9 @@
|
||||
requires ipp2p match support in your kernel and ip6tables. <emphasis
|
||||
role="bold">tcp:syn</emphasis> implies <emphasis
|
||||
role="bold">tcp</emphasis> plus the SYN flag must be set and the
|
||||
RST,ACK and FIN flags must be reset.</para>
|
||||
RST,ACK and FIN flags must be reset. Beginning with Shorewall 5.1.3,
|
||||
you may also specify <emphasis role="bold">tcp:!syn</emphasis>,
|
||||
which matches if SYN is not set or if RST, ACK or FIN is set.</para>
|
||||
|
||||
<para>Beginning with Shorewall6 4.4.19, this column can contain a
|
||||
comma-separated list of protocol-numbers and/or protocol names
|
||||
|
@@ -222,8 +222,9 @@
|
||||
role="bold">all}</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Protocol - <emphasis role="bold">ipp2p</emphasis> requires
|
||||
ipp2p match support in your kernel and iptables.</para>
|
||||
<para>See <ulink
|
||||
url="shorewall-rules.html">shorewall6-rules(5)</ulink> for
|
||||
details.</para>
|
||||
|
||||
<para>Beginning with Shorewall 4.5.12, this column can accept a
|
||||
comma-separated list of protocols.</para>
|
||||
|
@@ -234,8 +234,9 @@
|
||||
|
||||
<listitem>
|
||||
<para>If you wish to restrict this entry to a particular protocol
|
||||
then enter the protocol name (from protocols(5)) or number
|
||||
here.</para>
|
||||
then enter the protocol name (from protocols(5)) or number here. See
|
||||
<ulink url="shorewall-rules.html">shorewall6-rules(5)</ulink> for
|
||||
details.</para>
|
||||
|
||||
<para>Beginning with Shorewall 4.5.12, this column can accept a
|
||||
comma-separated list of protocols.</para>
|
||||
|
@@ -1555,6 +1555,28 @@ LOG:info:,bar net fw</programlisting>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">MINIUPNPD=</emphasis>[<emphasis
|
||||
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 5.1.4. If set to Yes, Shorewall will create
|
||||
a chain in the nat table named MINIUPNPD-POSTROUTING and will add
|
||||
jumps from POSTROUTING to that chain for each interface with the
|
||||
<option>upnpd</option> option specified. Default is No.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis
|
||||
role="bold">MARK_IN_FORWARD_CHAIN=</emphasis>[<emphasis
|
||||
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
|
||||
|
||||
<listitem>
|
||||
<para/>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">MODULE_SUFFIX=</emphasis>[<emphasis
|
||||
role="bold">"</emphasis><emphasis>extension</emphasis> ...<emphasis
|
||||
@@ -1868,6 +1890,21 @@ LOG:info:,bar net fw</programlisting>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">PERL_HASH_SEED=</emphasis><emphasis
|
||||
role="bold"><replaceable>seed</replaceable><emphasis
|
||||
role="bold">|random</emphasis></emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 5.1.4. Sets the Perl hash
|
||||
<replaceable>seed</replaceable> (an integer in the range 0-99999)
|
||||
when running the Shorewall rules compiler. If not specified, the
|
||||
value 0 is assumed. If <option>random</option> is specified, a
|
||||
random seed will be chosed by Perl. See perlsec(1) for additional
|
||||
information.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis
|
||||
role="bold">PROVIDER_BITS</emphasis>=[<replaceable>number</replaceable>]</term>
|
||||
|
@@ -16,7 +16,7 @@ RemainAfterExit=yes
|
||||
EnvironmentFile=-/etc/default/shorewall6
|
||||
StandardOutput=syslog
|
||||
ExecStart=/sbin/shorewall -6 $OPTIONS start $STARTOPTIONS
|
||||
ExecStop=/sbin/shorewall -6 $OPTIONS stop
|
||||
ExecStop=/sbin/shorewall -6 $OPTIONS clear
|
||||
ExecReload=/sbin/shorewall -6 $OPTIONS reload $RELOADOPTIONS
|
||||
|
||||
[Install]
|
||||
|
@@ -351,8 +351,8 @@ ACCEPT - - tcp 135,139,445</programlisting>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>The recommended settings for the 6 policy actions for IPv4 are:
|
||||
</para>
|
||||
<para>The recommended settings for the 6 policy actions for IPv4
|
||||
are:</para>
|
||||
|
||||
<programlisting> ACCEPT_DEFAULT=none
|
||||
BLACKLIST_DEFAULT="Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,dropInvalid:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
@@ -365,7 +365,7 @@ ACCEPT - - tcp 135,139,445</programlisting>
|
||||
<para>The recommended settings for IPv6 are:</para>
|
||||
|
||||
<programlisting> ACCEPT_DEFAULT=none
|
||||
BLACKLIST_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
BLACKLIST_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP),dropNotSyn:$LOG_LEVEL,dropInvalid:$LOG_LEVEL,DropDNSrep:$LOG_LEVEL"
|
||||
DROP_DEFAULT="AllowICMPs,Broadcast(DROP),Multicast(DROP)"
|
||||
NFQUEUE_DEFAULT=none
|
||||
QUEUE_DEFAULT=none
|
||||
|
@@ -18,7 +18,7 @@
|
||||
<pubdate><?dbtimestamp format="Y/m/d"?></pubdate>
|
||||
|
||||
<copyright>
|
||||
<year>2001-2016</year>
|
||||
<year>2001-2017</year>
|
||||
|
||||
<holder>Thomas M. Eastep</holder>
|
||||
</copyright>
|
||||
|
17
docs/KVM.xml
17
docs/KVM.xml
@@ -66,10 +66,10 @@
|
||||
<section>
|
||||
<title>Networking Configuration</title>
|
||||
|
||||
<para>I use a network configuration where each VM has its own VNET and
|
||||
tap device and the tap devices are all configured as ports on a Linux
|
||||
Bridge. For clarity, I've only shown four of the virtual machines
|
||||
available on the system.</para>
|
||||
<para>I use a network configuration where each VM has its own VNET and tap
|
||||
device and the tap devices are all configured as ports on a Linux Bridge.
|
||||
For clarity, I've only shown four of the virtual machines available on the
|
||||
system.</para>
|
||||
|
||||
<graphic align="center" fileref="images/KVM1.png"/>
|
||||
|
||||
@@ -82,11 +82,10 @@
|
||||
|
||||
<para>With this configuration, and with only a single network interface on
|
||||
the laptop, this is just a simple <ulink
|
||||
url="two-interface.html">two-interface masquerading setup</ulink> where
|
||||
the local network interface is <filename
|
||||
class="devicefile">br0</filename>. As with all bridges, <filename
|
||||
class="devicefile">br0</filename> must be configured with the
|
||||
<option>routeback</option> option in <ulink
|
||||
url="two-interface.htm">two-interface masquerading setup</ulink> where the
|
||||
local network interface is <filename class="devicefile">br0</filename>. As
|
||||
with all bridges, <filename class="devicefile">br0</filename> must be
|
||||
configured with the <option>routeback</option> option in <ulink
|
||||
url="manpages/shorewall-interfaces.html">shorewall-interfaces</ulink>(5).</para>
|
||||
|
||||
<para>For additional information about this setup, including the Shorewall
|
||||
|
@@ -446,16 +446,13 @@ br0 - routeback</programlisting></para>
|
||||
backslash (<quote>\</quote>) followed immediately by a new line character
|
||||
(Enter key).</para>
|
||||
|
||||
<example id="continuation">
|
||||
<title>Line Continuation</title>
|
||||
|
||||
<programlisting>ACCEPT net $FW tcp \↵
|
||||
smtp,www,pop3,imap #Services running on the firewall</programlisting>
|
||||
|
||||
<para>In certain cases, leading white space is ignored in continuation
|
||||
lines:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>The continued line ends with a colon (":")</para>
|
||||
</listitem>
|
||||
@@ -463,7 +460,13 @@ smtp,www,pop3,imap #Services running on the firewall</programlisting>
|
||||
<listitem>
|
||||
<para>The continued line ends with a comma (",")</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</orderedlist>
|
||||
|
||||
<important>
|
||||
<para>What follows does NOT apply to <ulink
|
||||
url="manpages/shorewall-params.html">shorewall-params(5)</ulink> and
|
||||
<ulink url="shorewall.conf.html">shorewall.conf(5)</ulink>.</para>
|
||||
</important>
|
||||
|
||||
<para>Example (<filename>/etc/shorewall/rules</filename>):</para>
|
||||
|
||||
@@ -479,7 +482,6 @@ ACCEPT net:\
|
||||
"net:206.124.146.177,206.124.147.178,206.124.146.180". Because the third
|
||||
continuation line does not end with a comma or colon, the leading white
|
||||
space in the last line is not ignored.</para>
|
||||
</example>
|
||||
|
||||
<important>
|
||||
<para>A trailing backslash is not ignored in a comment. So the continued
|
||||
@@ -2273,6 +2275,18 @@ SSH(ACCEPT) net:$MYIP $FW
|
||||
<command>restart</command>, <command>reload</command>,
|
||||
<command>refresh</command>, or one of the <command>safe</command>-*
|
||||
commands.</para>
|
||||
|
||||
<para>See the VERBOSE_MESSAGES option in <ulink
|
||||
url="manpages/shorewall.conf.html">shorewall.conf(5)</ulink> for
|
||||
additional information.</para>
|
||||
|
||||
<para>In Shorewall 5.1.4, the behavior of ?ERROR, ?WARNING and ?INFO was
|
||||
changed when they appear in an action file. Rather than reporting the
|
||||
action filename and line number, the generated message reports where the
|
||||
action was invoked. For example, the GlusterFS message above was changed
|
||||
to:</para>
|
||||
|
||||
<programlisting> ERROR: Invalid value (2000) for the GlusterFS Bricks argument /etc/shorewall/rules (line 45)</programlisting>
|
||||
</section>
|
||||
|
||||
<section id="Embedded">
|
||||
|
@@ -26,6 +26,8 @@
|
||||
|
||||
<year>2015</year>
|
||||
|
||||
<year>2017</year>
|
||||
|
||||
<holder>Thomas M. Eastep</holder>
|
||||
</copyright>
|
||||
|
||||
@@ -54,7 +56,12 @@
|
||||
<ulink url="http://xtables-addons.sourceforge.net/">xtables-addons</ulink>
|
||||
if they are not available in your current distribution. Instructions for
|
||||
installing xtables-addons may be found in the <ulink
|
||||
url="Dynamic.html">Dynamic Zones article</ulink>.</para>
|
||||
url="Dynamic.html">Dynamic Zones article</ulink>.
|
||||
Note that xtables-addons might not be required
|
||||
with the 'ipset' package provided by your distribution.
|
||||
See also the section <ulink url="configuration_file_basics.htm#capabilities">capabilities</ulink>
|
||||
in the <ulink url="configuration_file_basics.htm">configuration file basics article</ulink>
|
||||
and the <ulink url="Shorewall-Lite.html#Shorecap">Shorecap program</ulink>.</para>
|
||||
|
||||
<para>Ipset allows you to create one or more named sets of addresses then
|
||||
use those sets to define Netfilter/iptables rules. Possible uses of ipsets
|
||||
|
Reference in New Issue
Block a user