'\" t .\" Title: shorewall.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 09/24/2020 .\" Manual: Configuration Files .\" Source: Configuration Files .\" Language: English .\" .TH "SHOREWALL\&.CONF" "5" "09/24/2020" "Configuration Files" "Configuration Files" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" shorewall.conf \- Shorewall global configuration file .SH "SYNOPSIS" .HP \w'\fB/etc/shorewall/shorewall\&.conf\fR\ 'u \fB/etc/shorewall/shorewall\&.conf\fR .HP \w'\fB/etc/shorewall6/shorewall6\&.conf\fR\ 'u \fB/etc/shorewall6/shorewall6\&.conf\fR .SH "DESCRIPTION" .PP The IPv4 and IPv6 environments each have their own configuration\&. The IPv4 configuration resides in /etc/shorewall/ while the IPv6 configuration resides in /etc/shorewall6/\&. .PP The \&.conf files set options that apply to Shorewall and Shorewall6 as a whole\&. .PP The \&.conf files consist of Shell comments (lines beginning with \*(Aq#\*(Aq), blank lines and assignment statements (\fIvariable\fR=\fIvalue\fR)\&. If the \fIvalue\fR contains shell meta characters or white\-space, then it must be enclosed in quotes\&. Example: MACLIST_LOG_LEVEL="NFLOG(1,0,1)"\&. .SH "OPTIONS" .PP Many options have as their value a \fIlog\-level\fR\&. Log levels are a method of describing to syslog (8) the importance of a message and a number of parameters in this file have log levels as their value\&. .PP These levels are defined by syslog and are used to determine the destination of the messages through entries in /etc/syslog\&.conf (5)\&. The syslog documentation refers to these as "priorities"; Netfilter calls them "levels" and Shorewall also uses that term\&. .PP Valid levels are: .sp .if n \{\ .RS 4 .\} .nf 7 debug 6 info 5 notice 4 warning 3 err 2 crit 1 alert 0 emerg .fi .if n \{\ .RE .\} .PP For most Shorewall logging, a level of 6 (info) is appropriate\&. Shorewall log messages are generated by NetFilter and are logged using facility \*(Aqkern\*(Aq 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\&. .PP If you have built your kernel with ULOG (IPv4 only) and/or NFLOG target support, you may also specify a log level of ULOG and/or NFLOG (must be all caps)\&. Rather than log its messages to syslogd, Shorewall will direct netfilter to log the messages via the ULOG or NFLOG target which will send them to a process called \*(Aqulogd\*(Aq\&. ulogd is available with most Linux distributions (although it probably isn\*(Aqt installed by default)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP If you want to specify parameters to ULOG or NFLOG (e\&.g\&., NFLOG(1,0,1)), then you must quote the setting\&. .PP Example: .sp .if n \{\ .RS 4 .\} .nf LOG_LEVEL="NFLOG(1,0,1)" .fi .if n \{\ .RE .\} .sp .5v .RE .PP Beginning with Shorewall 5\&.0\&.0, the log level may be followed by a colon (":") and a log tag\&. The log tag normally follows the packet disposition in Shorewall\-generated Netfilter log messages, separated from the disposition by a colon (e\&.g, "DROP:mytag")\&. See LOGTAGONLY below for additional information\&. .PP Beginning with Shorewall 4\&.4\&.22, LOGMARK is also a valid level which logs the packet\*(Aqs mark value along with the other usual information\&. The syntax is: .RS 4 \fBLOGMARK[\fR\fI(priority)\fR\fB]\fR .RE .PP where \fIpriority\fR is one of the levels listed in the list above\&. If omitted, the default is info (6)\&. .PP The following options may be set in shorewall\&.conf\&. .PP \fBACCEPT_DEFAULT=\fR{\fIaction\fR[(\fIparameters\fR)][:\fIlevel\fR][,\&.\&.\&.]|\fBnone\fR} .RS 4 .RE .PP \fBBLACKLIST_DEFAULT=\fR{\fIaction\fR[(\fIparameters\fR)][:\fIlevel\fR][,\&.\&.\&.]|\fBnone\fR} .RS 4 .RE .PP \fBDROP_DEFAULT=\fR{\fIaction\fR[(\fIparameters\fR)][:\fIlevel\fR][,\&.\&.\&.]|\fBnone\fR} .RS 4 .RE .PP \fBNFQUEUE_DEFAULT=\fR{\fIaction\fR[(\fIparameters\fR)][:\fIlevel\fR][,\&.\&.\&.]|\fBnone\fR} .RS 4 .RE .PP \fBQUEUE_DEFAULT=\fR{\fIaction\fR[(\fIparameters\fR)][:\fIlevel\fR][,\&.\&.\&.]|\fBnone\fR} .RS 4 .RE .PP \fBREJECT_DEFAULT=\fR{\fIaction\fR[(\fIparameters\fR)][:\fIlevel\fR][,\&.\&.\&.]|\fBnone\fR} .RS 4 In earlier Shorewall versions, a "default action" for DROP and REJECT policies was specified in the file /usr/share/shorewall/actions\&.std\&. .sp In Shorewall 4\&.4\&.0, the DROP_DEFAULT, REJECT_DEFAULT, ACCEPT_DEFAULT, QUEUE_DEFAULT and NFQUEUE_DEFAULT options were added\&. .sp DROP_DEFAULT describes the rules to be applied before a connection request is dropped by a DROP policy; REJECT_DEFAULT describes the rules to be applied if a connection request is rejected by a REJECT policy\&. The other three are similar for ACCEPT, QUEUE and NFQUEUE policies\&. .sp The value applied to these may be: .RS 4 a) The name of an \fIaction\fR\&. The name may optionally be followed by a comma\-separated list of parameters enclosed in parentheses if the specified action accepts parameters (e\&.g\&., \*(AqDrop(audit)\*(Aq)\&. .RE .RS 4 c) \fBNone\fR or \fBnone\fR .RE Prior to Shorewall 5\&.1\&.2, the default values are: .RS 4 DROP_DEFAULT="Drop" .RE .RS 4 REJECT_DEFAULT="Reject" .RE .RS 4 BLACKLIST_DEFAULT="Drop" (added in Shorewall 5\&.1\&.1) .RE .RS 4 ACCEPT_DEFAULT="none" .RE .RS 4 QUEUE_DEFAULT="none" .RE .RS 4 NFQUEUE_DEFAULT="none" .RE Beginning with Shorewall 5\&.1\&.2, the default value is \*(Aqnone\*(Aq for all of these\&. Note that the sample configuration files do, however, provide settings for DROP_DEFAULT, BLACKLIST_DEFAULT and REJECT_DEFAULT\&. .sp If you set the value of either option to "None" then no default action will be used and the default action or macro must be specified in \m[blue]\fBshorewall\-policy\fR\m[]\&\s-2\u[1]\d\s+2(5)\&. .sp You can pass \fIparameters\fR to the specified action (e\&.g\&., \fImyaction(audit,DROP)\fR)\&. .sp Beginning with Shorewall 4\&.5\&.10, the action name can be followed optionally by a colon and a log \fIlevel\fR\&. The level will be applied to each rule in the action or body that does not already have a log level\&. .sp Beginning with Shorewall 5\&.1\&.2, multiple \fIaction\fR[(\fIparameters\fR)][:\fIlevel\fR] specifications may be listed, separated by commas\&. .RE .PP \fBACCOUNTING=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 4\&.4\&.7\&. If set to Yes, Shorewall accounting is enabled (see \m[blue]\fBshorewall\-accounting\fR\m[]\&\s-2\u[2]\d\s+2(5))\&. If not specified or set to the empty value, ACCOUNTING=Yes is assumed\&. .RE .PP \fBACCOUNTING_TABLE=\fR[\fBfilter\fR|\fBmangle\fR] .RS 4 Added in Shorewall 4\&.4\&.20\&. This setting determines which Netfilter table the accounting rules are added in\&. By default, ACCOUNTING_TABLE=filter is assumed\&. See also \m[blue]\fBshorewall\-accounting\fR\m[]\&\s-2\u[2]\d\s+2(5)\&. .RE .PP \fBADD_IP_ALIASES=\fR[\fBYes\fR|\fBNo\fR] .RS 4 This parameter determines whether Shorewall automatically adds the external address(es) in \m[blue]\fBshorewall\-nat\fR\m[]\&\s-2\u[3]\d\s+2(5), and is only available in IPv4 configurations\&. If the variable is set to \fBYes\fR or \fByes\fR then Shorewall automatically adds these aliases\&. If it is set to \fBNo\fR or \fBno\fR, you must add these aliases yourself using your distribution\*(Aqs network configuration tools\&. .sp If this variable is not set or is given an empty value (ADD_IP_ALIASES="") then ADD_IP_ALIASES=Yes is assumed\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBWarning\fR .ps -1 .br Addresses added by ADD_IP_ALIASES=Yes are deleted and re\-added during \fBshorewall reload\fR and \fBshorewall restart\fR\&. As a consequence, connections using those addresses may be severed\&. .sp .5v .RE .RE .PP \fBADD_SNAT_ALIASES=\fR[\fBYes\fR|\fBNo\fR] .RS 4 This parameter determines whether Shorewall automatically adds the SNAT ADDRESS in \m[blue]\fBshorewall\-masq\fR\m[]\&\s-2\u[4]\d\s+2(5), and is only available in IPv4 configurations\&. If the variable is set to \fBYes\fR or \fByes\fR then Shorewall automatically adds these addresses\&. If it is set to \fBNo\fR or \fBno\fR, you must add these addresses yourself using your distribution\*(Aqs network configuration tools\&. .sp If this variable is not set or is given an empty value (ADD_SNAT_ALIASES="") then ADD_SNAT_ALIASES=No is assumed\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBWarning\fR .ps -1 .br Addresses added by ADD_SNAT_ALIASES=Yes are deleted and re\-added during \fBshorewall reload\fR and \fBshorewall restart\fR\&. As a consequence, connections using those addresses may be severed\&. .sp .5v .RE .RE .PP \fBADMINISABSENTMINDED=\fR[\fBYes\fR|\fBNo\fR] .RS 4 The value of this variable affects Shorewall\*(Aqs stopped state\&. The behavior differs depending on whether \m[blue]\fBshorewall\-routestopped\fR\m[]\&\s-2\u[5]\d\s+2(5) or \m[blue]\fBshorewall\-stoppedrules\fR\m[]\&\s-2\u[6]\d\s+2(5) is used: .PP routestopped .RS 4 When ADMINISABSENTMINDED=No, only traffic to/from those addresses listed in routestopped is accepted when Shorewall is stopped\&. When ADMINISABSENTMINDED=Yes, in addition to traffic to/from addresses in routestopped, connections that were active when Shorewall stopped continue to work and all new connections from the firewall system itself are allowed\&. .sp Note that the routestopped file is not supported in Shorewall 5\&.0 and later versions\&. .RE .PP stoppedrules .RS 4 All existing connections continue to work\&. To sever all existing connections when the firewall is stopped, install the conntrack utility and place the command \fBconntrack \-F\fR in the stopped user exit (/etc/shorewall/stopped)\&. .sp If ADMINISABSENTMINDED=No, only new connections matching entries in stoppedrules are accepted when Shorewall is stopped\&. Response packets and related connections are automatically accepted\&. .sp If ADMINISABSENTMINDED=Yes, in addition to connections matching entries in stoppedrules, all new connections from the firewall system itself are allowed when the firewall is stopped\&. Response packets and related connections are automatically accepted\&. .RE .sp If this variable is not set or is given the empty value then ADMINISABSENTMINDED=No is assumed\&. .RE .PP \fBARPTABLES=\fR[\fIpathname\fR] .RS 4 Added in Shorewall 4\&.5\&.12 and available in IPv4 only\&. This parameter names the arptables executable to be used by Shorewall\&. If not specified or if specified as a null value, then the arptables executable located using the PATH option is used\&. .sp Regardless of how the arptables utility is located (specified via arptables= or located via PATH), Shorewall uses the arptables\-restore and arptables\-save utilities from that same directory\&. .RE .PP \fBAUTOCOMMENT=\fR[\fBYes\fR|\fBNo\fR] .RS 4 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 line of the macro file was "COMMENT "\&. If not specified, the AUTO_COMMENT option has a default value of \*(AqYes\*(Aq\&. .RE .PP \fBAUTOHELPERS=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 4\&.5\&.7\&. When set to \fBYes\fR (the default), the generated ruleset will automatically associate helpers with applications that require them (FTP, IRC, etc\&.)\&. When configuring your firewall on systems running kernel 3\&.5 or later, it is recommended that you: .sp .RS 4 .ie n \{\ \h'-04' 1.\h'+01'\c .\} .el \{\ .sp -1 .IP " 1." 4.2 .\} Set AUTOHELPERS=No\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 2.\h'+01'\c .\} .el \{\ .sp -1 .IP " 2." 4.2 .\} Modify the HELPERS setting (see below) to list the helpers that you need\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 3.\h'+01'\c .\} .el \{\ .sp -1 .IP " 3." 4.2 .\} Either: .sp .RS 4 .ie n \{\ \h'-04' 1.\h'+01'\c .\} .el \{\ .sp -1 .IP " 1." 4.2 .\} Modify \m[blue]\fBshorewall\-conntrack\fR\m[]\&\s-2\u[7]\d\s+2 (5) to only apply helpers where they are required; or .RE .sp .RS 4 .ie n \{\ \h'-04' 2.\h'+01'\c .\} .el \{\ .sp -1 .IP " 2." 4.2 .\} Specify the appropriate helper in the HELPER column in \m[blue]\fBshorewall\-rules\fR\m[]\&\s-2\u[8]\d\s+2 (5)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br The macros for those applications requiring a helper automatically specify the appropriate HELPER where required\&. .sp .5v .RE .RE .RE .RE .PP \fBAUTOMAKE=\fR[\fBYes\fR|\fBNo\fR|\fBrecursive\fR|\fIdepth\fR] .RS 4 If set, the behavior of the \fBstart\fR, \fBreload\fR and \fBrestart\fR commands are changed; if no files in CONFIG_PATH (see below) have been changed since the last successful \fBstart, reload\fR or \fBrestart\fR command, then the compilation step is skipped and the compiled script that executed the last \fBstart\fR, \fBreload\fR or \fBrestart\fR command is used\&. If not specified, the default is AUTOMAKE=No\&. .sp The setting of the AUTOMAKE option is ignored if the \fBstart\fR, \fBreload\fR or \fBrestart\fR command includes a directory name (e\&.g\&.,\fB shorewall restart /etc/shorewall\&.new\fR)\&. .sp When AUTOMAKE=Yes, each directory in the CONFIG_PATH was originally searched recursively for files newer than the compiled script\&. That was changed in Shorewall 5\&.1\&.10\&.2 such that only the listed directories themselves were searched\&. That broke some configurations that played tricks with embedded SHELL such as "\fBSHELL cat /etc/shorewall/rules\&.d/loc/*\&.rules"\&.\fR Prior to 5\&.1\&.10\&.2, a change to a file in or adding a file to /etc/shorewall/rules\&.d/loc/ would trigger recompilation\&. Beginning with 5\&.1\&.10\&.2, such changes would not trigger recompilation\&. Beginning with Shorewall 5\&.2\&.0, the pre\-5\&.1\&.10\&.2 behavior can be obtained by setting AUTOMAKE=recursive\&. .sp Also beginning with Shorewall 5\&.2\&.0, AUTOMAKE may be set to a numeric \fIdepth\fR which specifies how deeply each listed directory is to be searched\&. AUTOMAKE=1 only searches each directory itself and is equivalent to AUTOMAKE=Yes\&. AUTOMAKE=2 will search each directory and its immediate sub\-directories; AUTOMAKE=3 will search each directory, each of its immediate sub\-directories, and each of their immediate sub\-directories, etc\&. .RE .PP \fBBALANCE_PROVIDERS=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 5\&.1\&.1\&. When USE_DEFAULT_RT=Yes, this option determines whether the \fBbalance\fR provider option (see \m[blue]\fBshorewall\-providers(5)\fR\m[]\&\s-2\u[9]\d\s+2) is the default\&. When BALANCE_PROVIDERS=Yes, then the \fBbalance\fR option is assumed unless the \fBfallback\fR, \fBloose\fR, \fBload\fR or \fBtproxy\fR option is specified\&. If this option is not set or is set to the empty value, then the default value is the value of USE_DEFAULT_RT\&. .RE .PP \fBBASIC_FILTERS=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall\-4\&.6\&.0\&. When set to \fBYes\fR, causes entries in \m[blue]\fBshorewall\-tcfilters(5)\fR\m[]\&\s-2\u[10]\d\s+2 to generate a basic filter rather than a u32 filter\&. This setting requires the Basic Ematch capability in your kernel and iptables\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br One of the advantages of basic filters is that ipset matches are supported in newer iproute2 and kernel versions\&. Because Shorewall cannot reliably detect this capability, use of basic filters is controlled by this option\&. .sp .5v .RE The default value is \fBNo\fR which causes u32 filters to be generated\&. .RE .PP \fBBLACKLIST=\fR[{\fBALL\fR|\fB\fIstate\fR\fR\fB[,\&.\&.\&.]\fR}] .RS 4 where state is one of NEW, ESTABLISHED, RELATED, INVALID,or UNTRACKED\&. .sp Added in Shorewall 4\&.5\&.13 to replace the BLACKLISTNEWONLY option\&. Specifies the connection tracking states that are to be subject to blacklist screening\&. If BLACKLIST is not specified then the states subject to blacklisting are NEW,ESTABLISHED,INVALID,UNTRACKED\&. .sp ALL sends all packets through the blacklist chains\&. .sp Note: The ESTABLISHED state may not be specified if FASTACCEPT=Yes is specified\&. .RE .PP \fBBLACKLIST_DISPOSITION=\fR[\fBDROP\fR|A_DROP|\fBREJECT|A_REJECT\fR] .RS 4 This parameter determines the disposition of packets from blacklisted hosts\&. It may have the value DROP if the packets are to be dropped or REJECT if the packets are to be replied with an ICMP port unreachable reply or a TCP RST (tcp only)\&. If you do not assign a value or if you assign an empty value then DROP is assumed\&. .sp A_DROP and A_REJECT are audited versions of DROP and REJECT respectively and were added in Shorewall 4\&.4\&.20\&. They require AUDIT_TARGET in the kernel and iptables\&. .sp The BLACKLIST_DISPOSITION setting determines the disposition of packets sent to the \fBblacklog\fR target of \m[blue]\fBshorewall\-blrules\fR\m[]\&\s-2\u[11]\d\s+2(5), but otherwise does not affect entries in that file\&. .RE .PP \fBBLACKLIST_LOG_LEVEL=\fR[\fIlog\-level\fR[:\fIlog\-tag\fR]] .RS 4 Formerly named BLACKLIST_LOGLEVEL\&. This parameter determines if packets from blacklisted hosts are logged and it determines the syslog level that they are to be logged at\&. Its value is a syslog level (Example: BLACKLIST_LOG_LEVEL=debug)\&. If you do not assign a value or if you assign an empty value then packets from blacklisted hosts are not logged\&. The setting determines the log level of packets sent to the \fBblacklog\fR target of \m[blue]\fBshorewall\-blrules\fR\m[]\&\s-2\u[11]\d\s+2(5)\&. .RE .PP \fBCLAMPMSS=[\fR\fBYes\fR|\fBNo\fR|\fIvalue\fR] .RS 4 This parameter enables the TCP Clamp MSS to PMTU feature of Netfilter and is usually required when your internet connection is through PPPoE or PPTP\&. If set to \fBYes\fR or \fByes\fR, the feature is enabled\&. If left blank or set to \fBNo\fR or \fBno\fR, the feature is not enabled\&. .sp \fBImportant\fR: This option requires CONFIG_IP_NF_TARGET_TCPMSS in your kernel\&. .sp You may also set CLAMPMSS to a numeric \fIvalue\fR (e\&.g\&., CLAMPMSS=1400)\&. This will set the MSS field in TCP SYN packets going through the firewall to the \fIvalue\fR that you specify\&. .RE .PP \fBCLEAR_TC=\fR[\fBYes\fR|\fBNo\fR] .RS 4 If this option is set to \fBNo\fR then Shorewall won\*(Aqt clear the current traffic control rules during [\fBre\fR]\fBstart\fR or \fBreload\fR\&. This setting is intended for use by people who prefer to configure traffic shaping when the network interfaces come up rather than when the firewall is started\&. If that is what you want to do, set TC_ENABLED=Yes and CLEAR_TC=No and do not supply an /etc/shorewall/tcstart file\&. That way, your traffic shaping rules can still use the \(lqfwmark\(rq classifier based on packet marking defined in \m[blue]\fBshorewall\-tcrules\fR\m[]\&\s-2\u[12]\d\s+2(5)\&. If not specified, CLEAR_TC=Yes is assumed\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBWarning\fR .ps -1 .br When you specify TC_ENABLED=shared (see below), then you should also specify CLEAR_TC=No\&. .sp .5v .RE .RE .PP \fBCOMPLETE=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 4\&.4\&.12\&. When you set this option to Yes, you are asserting that the configuration is complete so that your set of zones encompasses any hosts that can send or receive traffic to/from/through the firewall\&. This causes Shorewall to omit the rules that catch packets in which the source or destination IP address is outside of any of your zones\&. Default is No\&. It is recommended that this option only be set to Yes if: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} You have defined an interface whose effective physical setting is \*(Aq+\*(Aq\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} That interface is assigned to a zone\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} You have no CONTINUE policies or rules\&. .RE .RE .PP \fBCONFIG_PATH\fR=[[:]\fIdirectory\fR[:\fIdirectory\fR]\&.\&.\&.] .RS 4 Specifies where configuration files other than shorewall[6]\&.conf may be found\&. CONFIG_PATH is specifies as a list of directory names separated by colons (":")\&. When looking for a configuration file: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If the command is "try" or a "" was specified in the command (e\&.g\&., \fBshorewall [\-6] check \&./gateway\fR) then the directory given in the command is searched first\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Next, each directory in the CONFIG_PATH setting is searched in sequence\&. .RE .sp If CONFIG_PATH is not given or if it is set to the empty value then the contents of /usr/share/shorewall/configpath are used\&. As released from shorewall\&.net, that file sets the CONFIG_PATH to /etc/shorewall:/usr/share/shorewall but your particular distribution may set it differently\&. See the output of shorewall show config for the default on your system\&. .sp Beginning with Shorewall 5\&.1\&.10, the CONFIG_PATH setting may begin with a colon (":"), to signal that the first \fIdirectory\fR 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 /etc/shorewall[6]/ when compilation is being done by a non\-root user or if the generated script is to be sent to a remote firewall system\&. .RE .PP \fBDEFER_DNS_RESOLUTION=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 4\&.5\&.12\&. When set to \*(AqYes\*(Aq (the default), DNS names are validated in the compiler and then passed on to the generated script where they are resolved by ip[6]tables\-restore\&. This is an advantage if you use AUTOMAKE=Yes and the IP address associated with the DNS name is subject to change\&. When DEFER_DNS_RESOLUTION=No, DNS names are converted into IP addresses by the compiler\&. This has the advantage that when AUTOMAKE=Yes, the \fBstart\fR, \fBreload\fR and \fBrestart\fR commands will succeed even if no DNS server is reachable (assuming that the configuration hasn\*(Aqt changed since the compiled script was last generated)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBImportant\fR .ps -1 .br When DEFER_DNS_RESOLUTION=No and AUTOMAKE=Yes and a DNS change makes it necessary to recompile an existing firewall script, the \fB\-c\fR option must be used with the \fBreload\fR or \fBrestart\fR command to force recompilation\&. .sp .5v .RE .RE .PP \fBDELETE_THEN_ADD=\fR{\fBYes\fR|\fBNo\fR} .RS 4 If set to Yes (the default value), entries in the /etc/shorewall[6]/rtrules files cause an \*(Aqip rule del\*(Aq command to be generated in addition to an \*(Aqip rule add\*(Aq command\&. Setting this option to No, causes the \*(Aqip rule del\*(Aq command to be omitted\&. .RE .PP \fBDETECT_DNAT_IPADDRS=\fR[\fBYes\fR|\fBNo\fR] .RS 4 IPv4 only\&. .sp If set to \fBYes\fR or \fByes\fR, Shorewall will detect the first IP address of the interface to the source zone and will include this address in DNAT rules as the original destination IP address\&. If set to \fBNo\fR or \fBno\fR, Shorewall will not detect this address and any destination IP address will match the DNAT rule\&. If not specified or empty, \(lqDETECT_DNAT_IPADDRS=Yes\(rq is assumed\&. .RE .PP \fBDISABLE_IPV6=\fR[\fBYes\fR|\fBNo\fR] .RS 4 IPv4 only\&. .sp If set to \fBYes\fR or \fByes\fR, IPv6 traffic to, from and through the firewall system is disabled\&. If set to \fBNo\fR or \fBno\fR, Shorewall will take no action with respect to allowing or disallowing IPv6 traffic\&. If not specified or empty, \(lqDISABLE_IPV6=No\(rq is assumed\&. .sp It is important to note that changing DISABLE_IPV6=Yes to DISABLE_IPV6=No does \fInot\fR enable IPV6\&. The recommended approach for enabling IPv6 on your system is: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Install, configure and start \m[blue]\fBShorewall6\fR\m[]\&\s-2\u[13]\d\s+2\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Change DISABLE_IPV6=Yes to DISABLE_IPV6=No in /etc/shorewall/shorewall\&.conf\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Reload Shorewall .RE .RE .PP \fBDOCKER=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 5\&.0\&.6; IPv4 only\&. When set to \fBYes\fR, the generated script will save Docker\-generated rules before and restore them after executing the \fBstart\fR, \fBstop\fR, \fBreload\fR and \fBrestart\fR commands\&. If set to \fBNo\fR (the default), the generated script will delete any Docker\-generated rules when executing those commands\&. See\m[blue]\fBhttps://shorewall\&.org/Docker\&.html\fR\m[]\&\s-2\u[14]\d\s+2 for additional information\&. .RE .PP \fBDOCKER_BRIDGE=\fR[\fIbridgename\fR] .RS 4 Added in Shorewall 5\&.2\&.4; IPv4 only\&. Specifies the name of the default Docker bridge\&. If not specified, the value \*(Aqdocker0\*(Aq is assumed\&. .RE .PP \fBDONT_LOAD=\fR[\fImodule\fR[,\fImodule\fR]\&.\&.\&.] .RS 4 Causes Shorewall to not load the listed kernel modules\&. .RE .PP \fBDYNAMIC_BLACKLIST=\fR{\fBYes\fR|\fBNo\fR||\fBipset\fR[\fB\-only\fR][\fI,option\fR[,\&.\&.\&.]][:[\fIsetname\fR][:\fIlog_level\fR|:l\fIog_tag\fR]]]} .RS 4 Added in Shorewall 4\&.4\&.7\&. When set to \fBNo\fR or \fBno\fR, chain\-based dynamic blacklisting using \fBshorewall [\-6] [\-l] drop\fR, \fBshorewall [\-6] [\-l] reject\fR, \fBshorewall logdrop\fR and \fBshorewall [\-6] [\-l] logreject\fR is disabled\&. Default is \fBYes\fR\&. Beginning with Shorewall 5\&.0\&.8, ipset\-based dynamic blacklisting using the \fBshorewall blacklist\fR command is also supported\&. The name of the set (\fIsetname\fR) and the level (\fIlog_level\fR), if any, at which blacklisted traffic is to be logged may also be specified\&. The default IPv4 set name is SW_DBL4 and the default IPv6 set name is SW_DBL6\&. The default log level is \fBnone\fR (no logging)\&. If \fBipset\-only\fR is given, then chain\-based dynamic blacklisting is disabled just as if DYNAMIC_BLACKLISTING=No had been specified\&. .sp Possible \fIoption\fRs are: .PP src\-dst .RS 4 Normally, only packets whose source address matches an entry in the ipset are dropped\&. If \fBsrc\-dst\fR is included, then packets whose destination address matches an entry in the ipset are also dropped\&. .RE .PP \fBdisconnect\fR .RS 4 The \fBdisconnect\fR option was added in Shorewall 5\&.0\&.13 and requires that the conntrack utility be installed on the firewall system\&. When an address is blacklisted using the \fBblacklist\fR command, all connections originating from that address are disconnected\&. if the \fBsrc\-dst\fR option was also specified, then all connections to that address are also disconnected\&. .RE .PP \fBtimeout\fR=\fIseconds\fR .RS 4 Added in Shorewall 5\&.0\&.13\&. Normally, Shorewall creates the dynamic blacklisting ipset with timeout 0 which means that entries are permanent\&. If you want entries in the set that are not accessed for a period of time to be deleted from the set, you may specify that period using this option\&. Note that the \fBblacklist\fR command can override the ipset\*(Aqs timeout setting\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBImportant\fR .ps -1 .br Once the dynamic blacklisting ipset has been created, changing this option setting requires a complete restart of the firewall; \fBshorewall [\-6] restart\fR if RESTART=restart, otherwise \fBshorewall [\-6] [\-l] stop && shorewall [\-6] [\-l] start\fR .sp .5v .RE .RE .PP log .RS 4 Added in Shorewall 5\&.2\&.5\&. When specified, successful \*(Aqblacklist\*(Aq and \*(Aqallow\*(Aq commands will log a message to the system log\&. .RE .PP noupdate .RS 4 Added in Shorewall 5\&.2\&.5\&. Normally, once an address has been blacklisted, each time that a packet is received from the packet, the ipset\*(Aqs entry for the address is updated to reset the timeout to the value specifyed in the \fBtimeout\fR option above\&. Setting the \fBnoupdate\fR option, inhibits this resetting of the entry\*(Aqs timeout\&. This option is ignored when the \fBtimeout\fR option is not specified\&. .RE .sp When ipset\-based dynamic blacklisting is enabled, the contents of the blacklist will be preserved over \fBstop\fR/\fBreboot\fR/\fBstart\fR sequences\&. .RE .PP \fBEXPAND_POLICIES=\fR{\fBYes\fR|\fBNo\fR} .RS 4 Normally, when the SOURCE or DEST columns in shorewall\-policy(5) contains \*(Aqall\*(Aq, a single policy chain is created and thes policy is enforced in that chain\&. For example, if the policy entry is .sp .if n \{\ .RS 4 .\} .nf #SOURCE DEST POLICY LOG # LEVEL net all DROP info .fi .if n \{\ .RE .\} .sp then the chain name is \*(Aqnet\-all\*(Aq (\*(Aqnet2all if ZONE2ZONE=2) which is also the chain named in Shorewall log messages generated as a result of the policy\&. If EXPAND_POLICIES=Yes, then Shorewall will create a separate chain for each pair of zones covered by the policy\&. This makes the resulting log messages easier to interpret since the chain in the messages will have a name of the form \*(Aqa2b\*(Aq where \*(Aqa\*(Aq is the SOURCE zone and \*(Aqb\*(Aq is the DEST zone\&. .RE .PP \fBEXPORTMODULES=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 4\&.4\&.17\&. When set to Yes when compiling for use by Shorewall Lite (\fBshorewall [\-6] remote\-start\fR, \fBshorewall [\-6] remote\-reload, shorewall [\-6] remote\-restart \fRor \fBshorewall [\-6] export\fR commands), the compiler will copy the modules or helpers file from the administrative system into the script\&. When set to No or not specified, the compiler will not copy the modules or helpers file from /usr/share/shorewall[6] but will copy those found in another location on the CONFIG_PATH\&. .sp When compiling for direct use by Shorewall, causes the contents of the local module or helpers file to be copied into the compiled script\&. When set to No or not set, the compiled script reads the file itself\&. .RE .PP \fBFASTACCEPT=\fR{\fBYes\fR|\fBNo\fR} .RS 4 Normally, Shorewall defers accepting ESTABLISHED/RELATED packets until these packets reach the chain in which the original connection was accepted\&. So for packets going from the \*(Aqloc\*(Aq zone to the \*(Aqnet\*(Aq zone, ESTABLISHED/RELATED packets are ACCEPTED in the \*(Aqloc\-net\*(Aq or \*(Aqloc2net\*(Aq chain, depending on the setting of ZONE2ZONE (see below)\&. .sp If you set FASTACCEPT=Yes, then ESTABLISHED/RELATED packets are accepted early in the INPUT, FORWARD and OUTPUT chains\&. If you set FASTACCEPT=Yes then you may not include rules in the ESTABLISHED or RELATED sections of \m[blue]\fBshorewall\-rules\fR\m[]\&\s-2\u[8]\d\s+2(5)\&. .RE .PP \fBFIREWALL\fR=[\fIdnsname\-or\-ip\-address\fR] .RS 4 This option was added in Shorewall 5\&.0\&.13 and may be used on an administrative system in directories containing the configurations of remote firewalls\&. The contents of the variable are the default value for the \fIsystem\fR parameter to the \fBremote\-start\fR, \fBremote\-reload\fR and \fBremote\-restart\fR commands\&. .RE .PP \fBFORWARD_CLEAR_MARK=\fR{\fBYes\fR|\fBNo\fR} .RS 4 Added in Shorewall 4\&.4\&.11\&. Traditionally, Shorewall has cleared the packet mark in the first rule in the mangle FORWARD chain\&. This behavior is maintained with the default setting of this option (FORWARD_CLEAR_MARK=Yes)\&. If FORWARD_CLEAR_MARK is set to \*(AqNo\*(Aq, packet marks set in the mangle PREROUTING chain are retained in the FORWARD chains\&. .RE .PP \fBGEOIPDIR\fR=[\fIpathname\fR] .RS 4 Added in Shorewall 4\&.5\&.4\&. Specifies the pathname of the directory containing the GeoIP Match database\&. See \m[blue]\fBhttps://shorewall\&.org/ISO\-3661\&.html\fR\m[]\&\s-2\u[15]\d\s+2\&. If not specified, the default value is /usr/share/xt_geoip/LE which is the default location of the little\-endian database\&. .RE .PP \fBHELPERS\fR=[\fIhelper\fR[,\fIhelper\fR\&.\&.\&.]] .RS 4 Added in Shorewall 4\&.5\&.7\&. This option specifies a comma\-separated list naming the Netfilter application helpers that are to be enabled\&. If not specified, the default is to enable all helpers\&. .sp Possible values for \fIhelper\fR are: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBamanda\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBftp\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBh323\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBirc\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBnetbios\-ns\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBnone\fR \- This special value was added in Shorewall 4\&.5\&.16 and indicates that no helpers are to be enabled\&. It also prevents the compiler for probing for helper support; such probing generates messages on the system log of the form "xt_CT: No such helper XXX" where XXX is the helper name\&. When used, \fBnone\fR must be the only helper specified\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBpptp\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBsane\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBsip\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBsnmp\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBtftp\fR .RE .sp When HELPERS is specified on a system running Kernel 3\&.5\&.0 or later, automatic association of helpers to connections is disabled\&. .RE .PP \fBIGNOREUNKNOWNVARIABLES=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 4\&.5\&.11\&. Normally, if an unknown shell variable is encountered in a configuration file (except in ?IF and ?ELSIF directives), the compiler raises a fatal error\&. If IGNOREUNKNOWNVARIABLES is set to \fBYes\fR, then such variables simply expand to an empty string\&. Default is \fBNo\fR\&. .RE .PP \fBIMPLICIT_CONTINUE=\fR{\fBYes\fR|\fBNo\fR} .RS 4 When this option is set to \fBYes\fR, it causes subzones to be treated differently with respect to policies\&. .sp Subzones are defined by following their name with ":" and a list of parent zones (in \m[blue]\fBshorewall\-zones\fR\m[]\&\s-2\u[16]\d\s+2(5))\&. Normally, you want to have a set of special rules for the subzone and if a connection doesn\*(Aqt match any of those subzone\-specific rules then you want the parent zone rules and policies to be applied; see \m[blue]\fBshorewall\-nesting\fR\m[]\&\s-2\u[17]\d\s+2(5)\&. With IMPLICIT_CONTINUE=Yes, that happens automatically\&. .sp If IMPLICIT_CONTINUE=No or if IMPLICIT_CONTINUE is not set, then subzones are not subject to this special treatment\&. With IMPLICIT_CONTINUE=Yes, an implicit CONTINUE policy may be overridden by including an explicit policy (one that does not specify "all" in either the SOURCE or the DEST columns)\&. .RE .PP \fBINVALID_DISPOSITION=[A_DROP|A_REJECT|DROP|REJECT|CONTINUE]\fR .RS 4 Added in Shorewall 4\&.5\&.13\&. Shorewall has traditionally passed INVALID packets through the NEW section of \m[blue]\fBshorewall\-rules\fR\m[]\&\s-2\u[8]\d\s+2 (5)\&. When a packet in INVALID state fails to match any rule in the INVALID section, the packet is disposed of based on this setting\&. The default value is CONTINUE for compatibility with earlier versions\&. .RE .PP \fBINVALID_LOG_LEVEL=\fR\fIlog\-level\fR[:\fIlog\-tag\fR] .RS 4 Added in Shorewall 4\&.5\&.13\&. Packets in the INVALID state that do not match any rule in the INVALID section of \m[blue]\fBshorewall\-rules\fR\m[]\&\s-2\u[8]\d\s+2 (5) are logged at this level\&. The default value is empty which means no logging is performed\&. .RE .PP \fBIP\fR=[\fIpathname\fR] .RS 4 If specified, gives the pathname of the \*(Aqip\*(Aq executable\&. If not specified, \*(Aqip\*(Aq is assumed and the utility will be located using the current PATH setting\&. .RE .PP \fBIP_FORWARDING=\fR[\fBOn\fR|\fBOff\fR|\fBKeep\fR] .RS 4 This IPv4 parameter determines whether Shorewall enables or disables IPv4 Packet Forwarding (/proc/sys/net/ipv4/ip_forward)\&. In an IPv6 configuration, this parameter determines the setting of /proc/sys/net/ipv6/config/all/ip_forwarding\&. .sp Possible values are: .PP \fBOn\fR or \fBon\fR .RS 4 packet forwarding will be enabled\&. .RE .PP \fBOff\fR or \fBoff\fR .RS 4 packet forwarding will be disabled\&. .RE .PP \fBKeep\fR or \fBkeep\fR .RS 4 Shorewall will neither enable nor disable packet forwarding\&. .RE .sp If this variable is not set or is given an empty value (IP_FORWARD="") then IP_FORWARD=On is assumed\&. .RE .PP \fBIPSET\fR=[\fIpathname\fR] .RS 4 If specified, gives the pathname of the \*(Aqipset\*(Aq executable\&. If not specified, \*(Aqipset\*(Aq is assumed and the utility will be located using the current PATH setting\&. .RE .PP \fBIPSET_WARNINGS=\fR{\fBYes\fR|\fBNo\fR} .RS 4 Added in Shorewall 4\&.5\&.2\&. Default is Yes\&. When set, causes the rules compiler to issue a warning when: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The compiler is being run by root and an ipset specified in the configuration does not exists\&. Only one warning is issued for each missing ipset\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} When [src] is specified in a destination column and when [dst] is specified in a source column\&. .RE .RE .PP \fBIPTABLES=\fR[\fIpathname\fR] .RS 4 IPv4 only\&. .sp This parameter names the iptables executable to be used by Shorewall\&. If not specified or if specified as a null value, then the iptables executable located using the PATH option is used\&. .sp Regardless of how the iptables utility is located (specified via IPTABLES= or located via PATH), Shorewall uses the iptables\-restore and iptables\-save utilities from that same directory\&. .RE .PP \fBIP6TABLES=\fR[\fIpathname\fR] .RS 4 IPv6 only\&. .sp 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\&. .sp 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\&. .RE .PP \fBKEEP_RT_TABLES=\fR{\fBYes\fR|\fBNo\fR} .RS 4 IPv4: When set to \fBYes\fR, this option prevents generated scripts from altering the /etc/iproute2/rt_tables database when there are entries in /etc/shorewall/providers\&. If you set this option to \fBYes\fR while Shorewall (Shorewall\-lite) is running, you should remove the file /var/lib/shorewall/rt_tables (/var/lib/shorewall\-lite/rt_tables) before your next \fBstop\fR, \fBrestore\fR, \fBreload\fR or \fBrestart\fR command\&. IPv6: When set to \fBYes\fR, this option prevents scripts generated by Shorewall6 from altering the /etc/iproute2/rt_tables database when there are entries in /etc/shorewall6/providers\&. If you set this option to \fBYes\fR while Shorewall6 (Shorewall6\-lite) is running, you should remove the file /var/lib/shorewall6/rt_tables (/var/lib/shorewall6\-lite/rt_tables) before your next \fBstop\fR, \fBrestore\fR, \fBreload\fR or \fBrestart\fR command\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBImportant\fR .ps -1 .br 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\&. .sp .5v .RE The default is KEEP_RT_TABLES=No\&. .RE .PP \fBLOAD_HELPERS_ONLY=\fR{\fBYes\fR|\fBNo\fR} .RS 4 Added in Shorewall 4\&.4\&.7\&. When set to Yes, restricts the set of modules loaded by shorewall to those listed in /var/lib/shorewall[6]/helpers and those that are actually used\&. When not set, or set to the empty value, LOAD_HELPERS_ONLY=No is assumed in Shorewall versions 5\&.2\&.2 and earlier\&. Beginning with Shorewall 5\&.2\&.3, the LOAD_HELPERS_ONLY option is removed, and the behavior is as if LOAD_HELPERS_ONLY=Yes had been specified\&. .RE .PP \fBLOCKFILE\fR=[\fIpathname\fR] .RS 4 Specifies the name of the Shorewall[6] lock file, used to prevent simultaneous state\-changing commands\&. If not specified, ${VARDIR}/shorewall[6]/lock is assumed (${VARDIR} is normally /var/lib but can be changed when Shorewall\-core is installed \-\- see the output of \fBshorewall show vardir\fR)\&. .RE .PP \fBLOG_BACKEND=\fR[\fIbackend\fR] .RS 4 Added in Shorewall 4\&.6\&.4\&. LOG_BACKEND determines the logging backend to be used for the \fBiptrace\fR command (see \m[blue]\fBshorewall(8)\fR\m[]\&\s-2\u[18]\d\s+2)\&. .sp \fIbackend\fR is one of: .PP LOG .RS 4 Use standard kernel logging\&. .RE .PP ULOG .RS 4 IPv4 only\&. .sp Use ULOG logging to ulogd\&. .RE .PP netlink .RS 4 Use netlink logging to ulogd version 2 or later\&. .RE .RE .PP \fBLOG_ZONE=\fR[\fB\fBsrc\fR\fR\fB|\fR\fB\fBdst\fR\fR\fB|\fR\fB\fBboth\fR\fR] .RS 4 Added in Shorewall 5\&.2\&.0\&. When a log message is issued from a chain that relates to a pair of zones (e\&.g, \*(Aqfw\-net\*(Aq), the chain name normally appears in the log message (unless LOGTAGONLY=Yes and a log tag is specified)\&. This can prevent OPTIMIZE category 8 from combining chains which are identical except for the names of the zones involved\&. LOG_ZONE allows for only the source or destination zone to appear in the messages by setting LOG_ZONE to \fBsrc\fR or \fBdest\fR respectively\&. If LOG_ZONE=\fBboth\fR (the default), then the full chain name is included in log messages\&. .RE .PP \fBLOG_LEVEL=\fR\fIlog\-level\fR[:\fIlog\-tag\fR] .RS 4 Added in Shorewall 5\&.1\&.2\&. Beginning with that release, the sample configurations use this as the default log level and changing it will change all packet logging done by the configuration\&. In any configuration file (except \m[blue]\fBshorewall\-params(5)\fR\m[]\&\s-2\u[19]\d\s+2), $LOG_LEVEL will expand to this value\&. .RE .PP \fBLOG_MARTIANS=\fR[\fBYes\fR|\fBNo\fR|Keep] .RS 4 IPv4 only\&. .sp If set to \fBYes\fR or \fByes\fR, sets /proc/sys/net/ipv4/conf/*/log_martians to 1 with the exception of /proc/sys/net/ipv4/conf/all/log_martians which is set to 0\&. The default value is \fBYes\fR which sets both of the above to one\&. If you do not enable martian logging for all interfaces, you may still enable it for individual interfaces using the \fBlogmartians\fR interface option in \m[blue]\fBshorewall\-interfaces\fR\m[]\&\s-2\u[20]\d\s+2(5)\&. .sp The value \fBKeep\fR causes Shorewall to ignore the option\&. If the option is set to \fBYes\fR, then martians are logged on all interfaces\&. If the option is set to \fBNo\fR, then martian logging is disabled on all interfaces except those specified in \m[blue]\fBshorewall\-interfaces\fR\m[]\&\s-2\u[20]\d\s+2(5)\&. .RE .PP \fBLOG_VERBOSITY=\fR[\fInumber\fR] .RS 4 This option controls the amount of information logged to the file specified in the STARTUP_LOG option\&. .sp Values are: .RS 4 \-1 \- Logging is disabled .RE .RS 4 0 \- Silent\&. Only error messages are logged\&. .RE .RS 4 1 \- Major progress messages logged\&. .RE .RS 4 2 \- All progress messages logged .RE If not specified, then \-1 is assumed\&. .RE .PP \fBLOGALLNEW=\fR[\fIlog\-level\fR] .RS 4 This option is intended for use as a debugging aid\&. When set to a log level, this option causes Shorewall to generate a logging rule as the first rule in each builtin chain\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The table name is used as the chain name in the log prefix\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The chain name is used as the target in the log prefix\&. .RE .sp For example, using the default LOGFORMAT, the log prefix for logging from the nat table\*(Aqs PREROUTING chain is as follows in versions prior to 5\&.1\&.0: .sp .if n \{\ .RS 4 .\} .nf Shorewall:nat:PREROUTING .fi .if n \{\ .RE .\} .sp In Shorewall 5\&.1\&.0 and later releases, the log prefix is: .sp .if n \{\ .RS 4 .\} .nf nat:PREROUTING .fi .if n \{\ .RE .\} .sp .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBImportant\fR .ps -1 .br To help insure that all packets in the NEW state are logged, rate limiting (LOGLIMIT) should be disabled when using LOGALLNEW\&. Use LOGALLNEW at your own risk; it may cause high CPU and disk utilization and you may not be able to control your firewall after you enable this option\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br Do not use this option if the resulting log messages will be sent to another system\&. .sp .5v .RE .RE .PP \fBLOGFILE=\fR[\fIpathname\fR|\fBsystemd\fR] .RS 4 This parameter tells the /sbin/shorewall program where to look for Shorewall messages when processing the \fBdump\fR, \fBlogwatch\fR, \fBshow log\fR, and \fBhits\fR commands\&. If not assigned or if assigned an empty value, /var/log/messages is assumed\&. For further information, see \m[blue]\fBshorewall\-logging(8)\fR\m[]\&\s-2\u[21]\d\s+2\&. Beginning with Shorewall 5\&.0\&.10\&.1, you may specify \fBsystemd\fR to use \fBjournelctl \-r\fR to read the log\&. .RE .PP \fBLOGFORMAT=\fR[\fB"\fR\fIformattemplate\fR\fB"\fR] .RS 4 The value of this variable generate the \-\-log\-prefix setting for Shorewall logging rules\&. It contains a \(lqprintf\(rq formatting template which accepts three arguments (the chain name, logging rule number (optional) and the disposition)\&. To use LOGFORMAT with fireparse, set it as: .sp .if n \{\ .RS 4 .\} .nf LOGFORMAT="fp=%s:%d a=%s " .fi .if n \{\ .RE .\} .sp If the LOGFORMAT value contains the substring \(lq%d\(rq then the logging rule number is calculated and formatted in that position; if that substring is not included then the rule number is not included\&. If not supplied or supplied as empty (LOGFORMAT="") then \(lqShorewall:%s:%s:\(rq is assumed\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br The setting of LOGFORMAT has an effect of the permitted length of zone names\&. See \m[blue]\fBshorewall\-zones\fR\m[]\&\s-2\u[16]\d\s+2 (5)\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br Beginning with Shorewall 5\&.1\&.0, the default and sample shorewall[6]\&.conf files set LOGFORMAT="%s %s "\&. .sp Regardless of the LOGFORMAT setting, Shorewall IPv4 log messages that use this LOGFORMAT can be uniquely identified using the following regular expression: .RS 4 \*(AqIN=\&.* OUT=\&.* SRC=\&.*\e\&.\&.* DST=\*(Aq .RE and Shorewall IPv6 log messages can be uniquely identified using the following regular expression: .RS 4 \*(AqIN=\&.* OUT=\&.* SRC=\&.*:\&.* DST=\*(Aq .RE To match all Netfilter log messages (Both IPv4 and IPv6 and regardless of the LOGFORMAT setting), use: .RS 4 \*(AqIN=\&.* OUT=\&.* SRC=\&.* DST=\*(Aq .RE .sp .5v .RE .RE .PP \fBLOGLIMIT=[\fR[{\fIs\fR|\fBd\fR}:]\fIrate\fR\fB/\fR{\fBsec\fR|\fBsecond|min\fR|\fBminute|hour\fR|\fBday\fR}[:\fIburst\fR]] .RS 4 Added in Shorewall 4\&.4\&.12\&. Limits the logging rate, either overall, or by source or destination IP address\&. .sp If the value starts with \*(Aqs:\*(Aq then logging is limited per source IP\&. If the value starts with \*(Aqd:\*(Aq, then logging is limited per destination IP\&. Otherwise, the overall logging rate is limited\&. .sp If \fIburst\fR is not specified, then a value of 5 is assumed\&. .sp The keywords \fBsecond\fR and \fBminute\fR are accepted beginning with Shorewall 4\&.6\&.13\&. .RE .PP \fBLOGTAGONLY=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Using LOGFORMAT=\(lqShorewall:%s:%s:\(rq, chain names may not exceed 5 characters or truncation of the log prefix may occur\&. Longer chain names may be used with log tags if you set LOGTAGONLY=Yes\&. With LOGTAGONLY=Yes, if a log tag is specified then the tag is included in the log prefix in place of the chain name\&. .sp Beginning with Shorewall 4\&.5\&.12, when LOGTAGONLY=Yes, you have more control over the generated log prefix\&. Beginning with that release, the tag is interpreted as a \fIchain name\fR and a \fIdisposition\fR separated by a comma\&. So this rule: .sp .if n \{\ .RS 4 .\} .nf #ACTION SOURCE DEST LOG:info:foo,bar net fw .fi .if n \{\ .RE .\} .sp would generate the following log prefix when using LOGFORMAT=\(lqShorewall:%s:%s:\(rq: .RS 4 Shorewall:foo:bar: .RE Similarly, .sp .if n \{\ .RS 4 .\} .nf #ACTION SOURCE DEST LOG:info:,bar net fw .fi .if n \{\ .RE .\} .sp would generate .RS 4 Shorewall:net2fw:bar: .RE .RE .PP \fBMACLIST_DISPOSITION=\fR[\fBACCEPT\fR|\fBDROP\fR|\fBREJECT\fR|A_DROP|A_REJECT] .RS 4 Determines the disposition of connections requests that fail MAC Verification and must have the value ACCEPT (accept the connection request anyway), REJECT (reject the connection request) or DROP (ignore the connection request)\&. If not set or if set to the empty value (e\&.g\&., MACLIST_DISPOSITION="") then MACLIST_DISPOSITION=REJECT is assumed\&. .sp A_DROP and A_REJECT are audited versions of DROP and REJECT respectively and were added in Shorewall 4\&.4\&.20\&. They require AUDIT_TARGET in the kernel and ip[6]tables\&. .RE .PP \fBMACLIST_LOG_LEVEL=\fR[\fIlog\-level\fR[:\fIlog\-tag\fR]] .RS 4 Determines the syslog level for logging connection requests that fail MAC Verification\&. The value must be a valid syslogd log level\&. If you don\*(Aqt want to log these connection requests, set to the empty value (e\&.g\&., MACLIST_LOG_LEVEL="")\&. .RE .PP \fBMACLIST_TABLE=\fR[\fBfilter\fR|\fBmangle\fR] .RS 4 Normally, MAC verification occurs in the filter table (INPUT and FORWARD) chains\&. When forwarding a packet from an interface with MAC verification to a bridge interface, that doesn\*(Aqt work\&. .sp This problem can be worked around by setting MACLIST_TABLE=mangle which will cause Mac verification to occur out of the PREROUTING chain\&. Because REJECT isn\*(Aqt available in that environment, you may not specify MACLIST_DISPOSITION=REJECT or MACLIST_DISPOSITION=A_REJECT with MACLIST_TABLE=mangle\&. .RE .PP \fBMACLIST_TTL=[\fR\fInumber\fR] .RS 4 The performance of configurations with a large numbers of entries in \m[blue]\fBshorewall\-maclist\fR\m[]\&\s-2\u[22]\d\s+2(5) can be improved by setting the MACLIST_TTL variable in \m[blue]\fBshorewall[6]\&.conf\fR\m[]\&\s-2\u[23]\d\s+2(5)\&. .sp If your iptables and kernel support the "Recent Match" (see the output of "shorewall check" near the top), you can cache the results of a \*(Aqmaclist\*(Aq file lookup and thus reduce the overhead associated with MAC Verification\&. .sp When a new connection arrives from a \*(Aqmaclist\*(Aq interface, the packet passes through then list of entries for that interface in \m[blue]\fBshorewall\-maclist\fR\m[]\&\s-2\u[22]\d\s+2(5)\&. If there is a match then the source IP address is added to the \*(AqRecent\*(Aq set for that interface\&. Subsequent connection attempts from that IP address occurring within $MACLIST_TTL seconds will be accepted without having to scan all of the entries\&. After $MACLIST_TTL from the first accepted connection request from an IP address, the next connection request from that IP address will be checked against the entire list\&. .sp If MACLIST_TTL is not specified or is specified as empty (e\&.g, MACLIST_TTL="" or is specified as zero then \*(Aqmaclist\*(Aq lookups will not be cached)\&. .RE .PP \fBMANGLE_ENABLED=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Determines whether Shorewall will generate rules in the Netfilter mangle table\&. Setting MANGLE_ENABLED=No disables all Shorewall features that require the mangle table\&. The default is MANGLE_ENABLED=Yes\&. .RE .PP \fBMINIUPNPD=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 5\&.0\&.8\&. 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 \fBupnpd\fR option specified\&. Default is No\&. .RE .PP \fBMARK_IN_FORWARD_CHAIN=\fR[\fBYes\fR|\fBNo\fR] .RS 4 If your kernel has a FORWARD chain in the mangle table, you may set MARK_IN_FORWARD_CHAIN=Yes to cause the marking specified in the tcrules file to occur in that chain rather than in the PREROUTING chain\&. This permits you to mark inbound traffic based on its destination address when DNAT is in use\&. To determine if your kernel has a FORWARD chain in the mangle table, use the \fBshorewall [\-6] show mangle\fR command; if a FORWARD chain is displayed then your kernel will support this option\&. If this option is not specified or if it is given the empty value (e\&.g\&., MARK_IN_FORWARD_CHAIN="") then MARK_IN_FORWARD_CHAIN=No is assumed\&. .RE .PP \fBMASK_BITS\fR=[\fInumber\fR] .RS 4 Added in Shorewall 4\&.4\&.26\&. Number of bits on the right of the 32\-bit packet mark to be masked when clearing the traffic shaping mark\&. Must be >= TC_BITS and <= PROVIDER_OFFSET (if PROVIDER_OFFSET > 0)\&. Prior to Shorewall 5\&.0\&.0, default value and the default values of the other mark layout options is determined as follows: .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&Default Packet Mark Layout .TS tab(:); l l l l l l l l. T{ WIDE_TC_MARKS=No, HIGH_ROUTE_MARKS=No T}:T{ TC_BITS=8, PROVIDER_BITS=8, PROVIDER_OFFSET=0, MASK_BITS=8 T} T{ WIDE_TC_MARKS=No, HIGH_ROUTE_MARKS=Yes T}:T{ TC_BITS=8, PROVIDER_BITS=8, PROVIDER_OFFSET=8, MASK_BITS=8 T} T{ WIDE_TC_MARKS=Yes, HIGH_ROUTE_MARKS=No T}:T{ TC_BITS=14, PROVIDER_BITS=8, PROVIDER_OFFSET=0, MASK_BITS=16 T} T{ WIDE_TC_MARKS=Yes, HIGH_ROUTE_MARKS=Yes T}:T{ TC_BITS=14, PROVIDER_BITS=8, PROVIDER_OFFSET=16, MASK_BITS=16 T} .TE .sp 1 From 5\&.0\&.0 onward, the default value of MASK_BITS is 8, the default value of PROVIDER_BITS, TC_BITS, MASK_BITS and PROVIDER_OFFSET is 8\&. .RE .PP \fBMODULESDIR=\fR[[+]\fIpathname\fR[\fB:\fR\fIpathname\fR]\&.\&.\&.] .RS 4 This parameter specifies the directory/directories where your kernel netfilter modules may be found\&. If you leave the variable empty, Shorewall will supply the value "/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 \fBuname\fR holds the output of \*(Aq\fBuname \-r\fR\*(Aq and \fBg_family\fR holds \*(Aq4\*(Aq in IPv4 configurations and \*(Aq6\*(Aq in IPv6 configurations\&. .sp The option plus sign (\*(Aq+\*(Aq) was added in Shorewall 5\&.0\&.3 and causes the listed pathnames to be appended to the default list above\&. .RE .PP \fBMULTICAST=\fR[\fBYes\fR|\fBNo\fR] .RS 4 IPv4 only\&. .sp This option will normally be set to \*(AqNo\*(Aq (the default)\&. It should be set to \*(AqYes\*(Aq under the following circumstances: .sp .RS 4 .ie n \{\ \h'-04' 1.\h'+01'\c .\} .el \{\ .sp -1 .IP " 1." 4.2 .\} You have an interface that has parallel zones defined via /etc/shorewall/hosts\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 2.\h'+01'\c .\} .el \{\ .sp -1 .IP " 2." 4.2 .\} You want to forward multicast packets to two or more of those parallel zones\&. .RE .sp In such cases, you will configure a \fBdestonly\fR network on each zone receiving multicasts\&. .RE .PP \fBMUTEX_TIMEOUT=\fR[\fIseconds\fR] .RS 4 The value of this variable determines the number of seconds that programs will wait for exclusive access to the Shorewall[6] lock file\&. After the number of seconds corresponding to the value of this variable, programs will assume that the last program to hold the lock died without releasing the lock\&. .sp If not set or set to the empty value, a value of 60 (60 seconds) is assumed\&. .sp An appropriate value for this parameter would be twice the length of time that it takes your firewall system to process a \fBshorewall [\-6] restart\fR command\&. .RE .PP \fBNFACCT=\fR[\fIpathname\fR] .RS 4 Added in Shorewall 4\&.5\&.7\&. Specifies the pathname of the nfacct utility\&. If not specified, Shorewall will use the PATH setting to find the program\&. .RE .PP \fBNULL_ROUTE_RFC1918=\fR[\fBYes\fR|\fBNo\fR|\fBblackhole\fR|\fBunreachable\fR|\fBprohibit\fR] .RS 4 IPv4 only\&. .sp When set to Yes, causes Shorewall to null\-route the IPv4 address ranges reserved by RFC1918\&. The default value is \*(AqNo\*(Aq\&. .sp When combined with route filtering (ROUTE_FILTER=Yes or \fBroutefilter\fR in \m[blue]\fBshorewall\-interfaces\fR\m[]\&\s-2\u[20]\d\s+2(5)), this option ensures that packets with an RFC1918 source address are only accepted from interfaces having known routes to networks using such addresses\&. .sp Beginning with Shorewall 4\&.5\&.15, you may specify \fBblackhole\fR, \fBunreachable\fR or \fBprohibit\fR to set the type of route to be created\&. See \m[blue]\fBhttps://shorewall\&.org/MultiISP\&.html#null_routing\fR\m[]\&\s-2\u[24]\d\s+2\&. .RE .PP \fBOPTIMIZE=\fR[\fIvalue\fR] .RS 4 The specified \fIvalue\fR enables certain optimizations\&. Each optimization category is associated with a power of two\&. To enable multiple optimization categories, simply add their corresponding numbers together\&. .sp Beginning with Shorewall 4\&.5\&.20, you may specify OPTIMIZE=All to enable all optimization categories, and you may also specify OPTIMIZE=None to disable optimization\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Optimization category 1 \- Traditionally, Shorewall has created rules for the complete matrix of host groups defined by the zones, interfaces and hosts files\&. Any traffic that didn\*(Aqt correspond to an element of that matrix was rejected in one of the built\-in chains\&. When the matrix is sparse, this results in lots of largely useless rules\&. .sp These extra rules can be eliminated by setting the 1 bit in OPTIMIZE\&. .sp The 1 bit setting also controls the suppression of redundant wildcard rules (those specifying "all" in the SOURCE or DEST column)\&. A wildcard rule is considered to be redundant when it has the same ACTION and Log Level as the applicable policy\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br Optimization level 1 is ignored when optimization level 4 is also selected, since level 4 performs similar optimizations in a more robust way\&. .sp .5v .RE .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Optimization category 2 \- Added in Shorewall 4\&.4\&.7\&. When set, suppresses superfluous ACCEPT rules in a policy chain that implements an ACCEPT policy\&. Any ACCEPT rules that immediately precede the final blanket ACCEPT rule in the chain are now omitted\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Optimization category 4 \- Added in Shorewall 4\&.4\&.7\&. When set, causes short chains (those with less than 2 rules) to be optimized away\&. The following chains are excluded from optimization: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} accounting chains (unless OPTIMIZE_ACCOUNTING=Yes) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} action chains (user\-defined) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \*(Aqblacklst\*(Aq chain .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} dynamic .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} forwardUPnP .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} UPnP (nat table) .RE .sp Additionally: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If a built\-in chain has a single rule that branches to a second chain, then the rules from the second chain are moved to the built\-in chain and the target chain is omitted\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Chains with no references are deleted\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Accounting chains are subject to optimization if the OPTIMIZE_ACCOUNTING option is set to \*(AqYes\*(Aq\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If a chain ends with an unconditional branch to a second chain (other than to \*(Aqreject\*(Aq), then the branch is deleted from the first chain and the rules from the second chain are appended to it\&. .RE .sp An additional optimization was added in Shorewall 4\&.5\&.4\&. If the last rule in a chain is an unqualified jump to a simple target, then all immediately preceding rules with the same simple target are omitted\&. .sp For example, consider this chain: .sp .if n \{\ .RS 4 .\} .nf \-A fw\-net \-p udp \-\-dport 67:68 \-j ACCEPT \-A fw\-net \-p udp \-\-sport 1194 \-j ACCEPT \-A fw\-net \-p 41 \-j ACCEPT \-A fw\-net \-j ACCEPT .fi .if n \{\ .RE .\} .sp Since all of the rules are jumps to the simple target ACCEPT, this chain is totally optimized away and jumps to the chain are replace with jumps to ACCEPT\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Optimization category 8 \- Added in Shorewall 4\&.4\&.9\&. When set, causes chains with identical rules to be collapsed into a single chain\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBWarning\fR .ps -1 .br While Optimization category 8 can significantly reduce the size of the generated iptables ruleset, it can also take significant system resources during compilation\&. If you find that compilation takes an unreasonably long time, try disabling this category by setting OPTIMIZE=23\&. .sp .5v .RE .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Optimization category 16 \- Added in Shorewall 4\&.4\&.26\&. When set, causes sequences of compatible rules to be combined into a single rule\&. Rules are considered compatible if they differ only in their destination ports and comments\&. .sp A sequence of compatible rules is often generated when macros are invoked in sequence\&. .sp The ability to combine adjacent rules is limited by two factors: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Destination port lists may only be combined up to a maximum of 15 ports, where a port\-pair counts as two ports\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Rules may only be combined until the length of their concatenated comment reaches 255 characters\&. .RE .sp When either of these limits would be exceeded, the current combined rule is emitted and the compiler attempts to combine rules beginning with the one that would have exceeded the limit\&. Adjacent combined comments are separated by \*(Aq, \*(Aq\&. Empty comments at the front of a group of combined comments are replaced by \*(AqOthers and\*(Aq\&. Empty comments at the end of a group of combined comments are replaced by \*(Aqand others\*(Aq\&. .sp Beginning in Shorewall 4\&.5\&.10, this option also suppresses duplicate adjacent rules and duplicate non\-adjacent rules that don\*(Aqt include \fBmark\fR, \fBconnmark\fR, \fBdscp\fR, \fBecn\fR, \fBset\fR, \fBtos\fR or \fBu32\fR matches\&. .PP Example 1: .RS 4 Rules with comments "FOO", and "BAR" would result in the combined comment "FOO and others, BAR"\&. .RE .PP Example 2: .RS 4 Rules with comments , "FOO" and "BAR" would result in the combined comment "Others and FOO, BAR"\&. Note: Optimize level 16 requires "Extended Multi\-port Match" in your iptables and kernel\&. .RE .RE .sp In versions prior to 5\&.1\&.0, the default value is zero which disables all optimizations\&. Beginning with Shorewall 5\&.1\&.0, the default value is \fBAll\fR which enables all optimizations\&. .RE .PP \fBOPTIMIZE_ACCOUNTING=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 4\&.4\&.7\&. If set to Yes, Shorewall accounting changes are subject to optimization (OPTIMIZE=4,5,6 or 7)\&. If not specified or set to the empty value, OPTIMIZE_ACCOUNTING=No is assumed\&. .RE .PP \fBPAGER=\fR\fIpathname\fR .RS 4 Added in Shorewall 5\&.0\&.6\&. Specifies a path name of a pager program like \fBless\fR or \fBmore\fR\&. When PAGER is given, the output of verbose \fBstatus\fR commands and the \fBdump\fR command are piped through the named program when the output file is a terminal\&. .sp Beginning with Shorewall 5\&.0\&.12, the default value of this option is the DEFAULT_PAGER setting in shorewallrc\&. .RE .PP \fBPATH=\fR\fIpathname\fR[\fB:\fR\fIpathname\fR]\&.\&.\&. .RS 4 Determines the order in which Shorewall searches directories for executable files\&. .RE .PP \fBPERL=\fR\fIpathname\fR .RS 4 Added in Shorewall 4\&.4\&.11 RC1\&. Specifies the path name of the Perl executable\&. Default is /usr/bin/perl\&. If the pathname specified by this option does not exist or the named file is not executable, then Shorewall falls back to /usr/bin/perl .RE .PP \fBPERL_HASH_SEED=\fR\fB\fIseed\fR\fR\fB\fB|random\fR\fR .RS 4 Added in Shorewall 5\&.1\&.4\&. Sets the Perl hash \fIseed\fR (an integer in the range 0\-99999) when running the Shorewall rules compiler\&. If not specified, the value 0 is assumed\&. If \fBrandom\fR is specified, a random seed will be chosed by Perl\&. See perlsec(1) for additional information\&. .RE .PP \fBPROVIDER_BITS\fR=[\fInumber\fR] .RS 4 Added in Shorewall 4\&.4\&.26\&. The number of bits in the 32\-bit packet mark to be used for provider numbers\&. May be zero\&. See MASK_BITS above for default value\&. .RE .PP \fBPROVIDER_OFFSET\fR=[\fInumber\fR]If .RS 4 Added in Shorewall 4\&.4\&.26\&. The offset from the right (low\-order end) of the provider number field in the 32\-bit packet mark\&. If non\-zero, must be >= TC_BITS (Shorewall automatically adjusts PROVIDER_OFFSET\*(Aqs value)\&. PROVIDER_OFFSET + PROVIDER_BITS + ZONE_BITS must be < 32\&. See MASK_BITS above for default value\&. .RE .PP \fBRCP_COMMAND="\fR\fIcommand\fR\fB"\fR .RS 4 .RE .PP \fBRSH_COMMAND="\fR\fIcommand\fR\fB"\fR .RS 4 Earlier generations of Shorewall Lite required that remote root login via ssh be enabled in order to use the \fBload\fR and \fBreload\fR commands\&. Beginning with release 3\&.9\&.5, you may define an alternative means for accessing the remote firewall system\&. In that release, two new options were added to shorewall\&.conf: .RS 4 RSH_COMMAND .RE .RS 4 RCP_COMMAND .RE The default values for these are as follows: .sp .if n \{\ .RS 4 .\} .nf RSH_COMMAND: ssh ${root}@${system} ${command} RCP_COMMAND: scp ${files} ${root}@${system}:${destination} .fi .if n \{\ .RE .\} .sp Shell variables that will be set when the commands are invoked are as follows: .sp .if n \{\ .RS 4 .\} .nf \fIroot\fR \- root user\&. Normally \fBroot\fR but may be overridden using the \*(Aq\-r\*(Aq option\&. \fIsystem\fR \- The name/IP address of the remote firewall system\&. \fIcommand\fR \- For RSH_COMMAND, the command to be executed on the firewall system\&. \fIfiles\fR \- For RCP_COMMAND, a space\-separated list of files to be copied to the remote firewall system\&. \fIdestination\fR \- The directory on the remote system that the files are to be copied into\&. .fi .if n \{\ .RE .\} .RE .PP \fBRELATED_DISPOSITION=[ACCEPT|A_ACCEPT|A_DROP|A_REJECT|DROP|REJECT|CONTINUE]\fR .RS 4 Added in Shorewall 4\&.4\&.27\&. Shorewall has traditionally ACCEPTed RELATED packets that don\*(Aqt match any rule in the RELATED section of \m[blue]\fBshorewall\-rules\fR\m[]\&\s-2\u[8]\d\s+2 (5)\&. Concern about the safety of this practice resulted in the addition of this option\&. When a packet in RELATED state fails to match any rule in the RELATED section, the packet is disposed of based on this setting\&. The default value is ACCEPT for compatibility with earlier versions\&. .RE .PP \fBRELATED_LOG_LEVEL=\fR\fIlog\-level\fR[:\fIlog\-tag\fR] .RS 4 Added in Shorewall 4\&.4\&.27\&. Packets in the related state that do not match any rule in the RELATED section of \m[blue]\fBshorewall\-rules\fR\m[]\&\s-2\u[8]\d\s+2 (5) are logged at this level\&. The default value is empty which means no logging is performed\&. .RE .PP \fBREJECT_ACTION=\fR\fIaction\fR .RS 4 Added in Shorewall 4\&.5\&.21\&. When a REJECT target is specified, Shorewall normally handles the response as follows: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If the destination address of the packet is a broadcast or multicast address, the packet is dropped\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} if the protocol is ICMP (2) then the packet is dropped\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} if the protocol is TCP (6) then the packet is rejected with an RST\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} if the protocol is UDP (17) then the packet is rejected with an \*(Aqport\-unreachable\*(Aq ICMP\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} if the protocol is ICMP (1) then the packet is rejected with a \*(Aqhost\-unreachable\*(Aq ICMP\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} if the protocol is ICMP6 (1) then the packet is rejected with a \*(Aqicmp6\-addr\-unreachable\*(Aq ICMP6\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} otherwise, the packet is rejected with a \*(Aqhost\-prohibited\*(Aq ICMP\&. .RE .sp You can modify this behavior by implementing your own \fIaction\fR that handles REJECT and specifying it\*(Aqs name in this option\&. The \fBnolog\fR and \fBnoinline\fR options will automatically be assumed for the specified \fIaction\fR\&. .sp The following action implements the default reject action: .sp .if n \{\ .RS 4 .\} .nf ?format 2 #TARGET SOURCE DEST PROTO Broadcast(DROP) \- \- \- DROP \- \- 2 INLINE \- \- 6 ;; \-j REJECT \-\-reject\-with tcp\-reset ?if __ENHANCED_REJECT INLINE \- \- 17 ;; \-j REJECT ?if __IPV4 INLINE \- \- 1 ;; \-j REJECT \-\-reject\-with icmp\-host\-unreachable INLINE \- \- \- ;; \-j REJECT \-\-reject\-with icmp\-host\-prohibited ?else INLINE \- \- 58 ;; \-j REJECT \-\-reject\-with icmp6\-addr\-unreachable INLINE \- \- \- ;; \-j REJECT \-\-reject\-with icmp6\-adm\-prohibited ?endif ?else INLINE \- \- \- ;; \-j REJECT ?endif .fi .if n \{\ .RE .\} .RE .PP \fBRENAME_COMBINED=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 5\&.2\&.0\&. Traditionally, when OPTIMIZE category 8 is enabled, identical chains are combined under a name beginning with \*(Aq~comb\*(Aq or \*(Aq~blacklist\*(Aq\&. This behavior is maintained under the default setting RENAME_COMBINED=Yes\&. If RENAMED_COMBINED=No, the chains are combined under the original name of one of the chains\&. .RE .PP \fBREQUIRE_INTERFACE=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 4\&.4\&.10\&. The default is No\&. If set to Yes, at least one optional interface must be up in order for the firewall to be in the started state\&. Intended to be used with the \m[blue]\fBShorewall Init Package\fR\m[]\&\s-2\u[25]\d\s+2\&. .RE .PP \fBRESTART=\fR[\fBrestart\fR|\fBreload\fR] .RS 4 Added in Shorewall 5\&.0\&.1 to replace LEGACY_RESTART which was added in Shorewall 5\&.0\&.0\&. In that release, the \fBreload\fR command was redefined to do what \fBrestart\fR had done in earlier releases and \fBrestart\fR became a true restart (equivalent to \fBstop\fR followed by \fBstart\fR)\&. When RESTART=reload, the \fBrestart\fR command performs the same operation as the \fBreload\fR command making it compatible with earlier releases\&. If not specified, RESTART=reload is assumed\&. .RE .PP \fBRESTORE_DEFAULT_ROUTE=\fR[\fBYes\fR|\fBNo\fR] .RS 4 This option determines whether to restore the default route saved when here are \*(Aqbalance\*(Aq providers defined but all of them are down\&. .sp The default is RESTORE_DEFAULT_ROUTE=Yes which preserves the pre\-4\&.2\&.6 behavior\&. .sp RESTORE_DEFAULT_ROUTE=No is appropriate when you don\*(Aqt want a default route in the main table (USE_DEFAULT_RT=No) or in the default table (USE_DEFAULT_RT=Yes) when there are no balance providers available\&. In that case, RESTORE_DEFAULT_ROUTE=No will cause any default route in the relevant table to be deleted\&. .RE .PP \fBRESTORE_ROUTEMARKS=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 4\&.5\&.9\&. When set to \fBYes\fR (the default), provider marks are restored unconditionally at the top of the mangle OUTPUT and PREROUTING chains, even if the saved mark is zero\&. When this option is set to \fBNo\fR, the mark is restored only if it is non\-zero\&. If you have problems with IPSEC ESP packets not being routed correctly on output, try setting this option to \fBNo\fR\&. .RE .PP \fBRESTOREFILE=\fR\fIfilename\fR .RS 4 Specifies the simple name of a file in /var/lib/shorewall to be used as the default restore script in the \fBshorewall [\-6] save\fR, \fBshorewall [\-6] restore\fR, \fBshorewall [\-6] forget \fRand \fBshorewall [6] \-f start\fR commands\&. .RE .PP \fBRETAIN_ALIASES=\fR{\fBYes\fR|\fBNo\fR} .RS 4 IPv4 only\&. .sp During \fBshorewall star\fRt, IP addresses to be added as a consequence of ADD_IP_ALIASES=Yes and ADD_SNAT_ALIASES=Yes are quietly deleted when \m[blue]\fBshorewall\-nat\fR\m[]\&\s-2\u[3]\d\s+2(5) and \m[blue]\fBshorewall\-masq\fR\m[]\&\s-2\u[4]\d\s+2(5) are processed then are re\-added later\&. This is done to help ensure that the addresses can be added with the specified labels but can have the undesirable side effect of causing routes to be quietly deleted\&. When RETAIN_ALIASES is set to Yes, existing addresses will not be deleted\&. Regardless of the setting of RETAIN_ALIASES, addresses added during \fBshorewall start\fR are still deleted at a subsequent \fBshorewall [stop\fR, \fBshorewall reload\fR or \fBshorewall restart\fR\&. .RE .PP \fBROUTE_FILTER=\fR[\fBYes\fR|\fBNo\fR|Keep] .RS 4 If this parameter is given the value \fBYes\fR or \fByes\fR then route filtering (anti\-spoofing) is enabled on all network interfaces which are brought up while Shorewall is in the started state\&. The default value is \fBno\fR\&. .sp The value \fBKeep\fR causes Shorewall to ignore the option\&. If the option is set to \fBYes\fR, then route filtering occurs on all interfaces\&. If the option is set to \fBNo\fR, then route filtering is disabled on all interfaces except those specified in \m[blue]\fBshorewall\-interfaces\fR\m[]\&\s-2\u[20]\d\s+2(5)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBImportant\fR .ps -1 .br If you need to disable route filtering on any interface, then you must set ROUTE_FILTER=No then set routefilter=1 or routefilter=2 on those interfaces where you want route filtering\&. See \m[blue]\fBshorewall\-interfaces\fR\m[]\&\s-2\u[20]\d\s+2(5) for additional details\&. .sp .5v .RE .RE .PP \fBRPFILTER_DISPOSITION=\fR[\fBDROP\fR|\fBREJECT\fR|A_DROP|A_REJECT] .RS 4 Added in Shorewall 4\&.5\&.7\&. Determines the disposition of packets entering from interfaces the \fBrpfilter\fR option (see \m[blue]\fBshorewall\-interfaces\fR\m[]\&\s-2\u[20]\d\s+2(5))\&. Packets disposed of by this option are those whose response packets would not be sent through the same interface receiving the packet\&. .RE .PP \fBRPFILTER_LOG_LEVEL=\fR\fIlog\-level\fR[:\fIlog\-tag\fR] .RS 4 Added in shorewall 4\&.5\&.7\&. Determines the logging of packets disposed via the RPFILTER_DISPOSITION\&. The default value is \fBinfo\fR\&. .RE .PP \fBSAVE_ARPTABLES=\fR{\fBYes\fR|\fBNo\fR} .RS 4 Added in Shorewall 4\&.5\&.12\&. If SAVE_ARPTABLES=Yes, then the current arptables contents will be saved by \fBshorewall save\fR command and restored by \fBshorewall restore\fR command\&. Default value is No\&. .RE .PP \fBSAVE_IPSETS=\fR{\fBYes\fR|\fBNo|ipv4|\fR\fB\fIsetlist\fR\fR} .RS 4 Re\-enabled in Shorewall 4\&.4\&.6\&. If SAVE_IPSETS=Yes, then the current contents of your ipsets will be saved by the \fBshorewall stop\fR and \fBshorewall save\fR commands and restored by the \fBshorewall start\fR and \fBshorewall restore\fR commands\&. .sp Beginning with Shorewall 4\&.6\&.4, you can restrict the set of ipsets saved by specifying a setlist (a comma\-separated list of ipv4 ipset names)\&. You may also restrict the saved sets to just the ipv4 ones by specifying \fBipv4\fR\&. .RE .PP \fBSFILTER_DISPOSITION=\fR[\fBDROP\fR|\fBREJECT\fR|A_DROP|A_REJECT] .RS 4 Added in Shorewall 4\&.4\&.20\&. Determines the disposition of packets matching the \fBsfilter\fR option (see \m[blue]\fBshorewall\-interfaces\fR\m[]\&\s-2\u[20]\d\s+2(5)) and of hairpin packets on interfaces without the \fBrouteback\fR option\&.\&\s-2\u[26]\d\s+2 .RE .PP \fBSFILTER_LOG_LEVEL=\fR\fIlog\-level\fR[:\fIlog\-tag\fR] .RS 4 Added on Shorewall 4\&.4\&.20\&. Determines the logging of packets matching the \fBsfilter\fR option (see \m[blue]\fBshorewall\-interfaces\fR\m[]\&\s-2\u[20]\d\s+2(5)) and of hairpin packets on interfaces without the \fBrouteback\fR option\&.\&\s-2\u[27]\d\s+2 The default is \fBinfo\fR\&. If you don\*(Aqt wish for these packets to be logged, use SFILTER_LOG_LEVEL=none\&. .RE .PP \fBSHOREWALL_SHELL=\fR[\fIpathname\fR] .RS 4 This option is used to specify the shell program to be used to interpret the compiled script\&. If not specified or specified as a null value, /bin/sh is assumed\&. Using a light\-weight shell such as ash or dash can significantly improve performance\&. .RE .PP \fBSMURF_DISPOSITION=\fR[\fBDROP\fR|A_DROP] .RS 4 Added in Shorewall 4\&.4\&.20\&. The default setting is DROP which causes smurf packets (see the nosmurfs option in \m[blue]\fBshorewall\-interfaces\fR\m[]\&\s-2\u[20]\d\s+2(5)) to be dropped\&. A_DROP causes the packets to be audited prior to being dropped and requires AUDIT_TARGET support in the kernel and iptables\&. .RE .PP \fBSMURF_LOG_LEVEL=\fR[\fIlog\-level\fR[:\fIlog\-tag\fR]] .RS 4 Specifies the logging level for smurf packets (see the nosmurfs option in \m[blue]\fBshorewall\-interfaces\fR\m[]\&\s-2\u[20]\d\s+2(5))\&. If set to the empty value ( SMURF_LOG_LEVEL="" ) then smurfs are not logged\&. .RE .PP \fBSTARTUP_ENABLED=\fR{\fBYes\fR|\fBNo\fR} .RS 4 Determines if Shorewall is allowed to start\&. As released from shorewall\&.net, this option is set to \fBNo\fR\&. When set to \fBYes\fR or \fByes\fR, Shorewall may be started\&. Used as a guard against Shorewall being accidentally started before it has been configured\&. .RE .PP \fBSTARTUP_LOG=\fR[\fIpathname\fR] .RS 4 If specified, determines where Shorewall will log the details of each \fBstart\fR, \fBreload\fR, \fBrestart\fR, \fBtry\fR, and \fBsafe\-\fR* command\&. Logging verbosity is determined by the setting of LOG_VERBOSITY above\&. .RE .PP \fBSUBSYSLOCK=\fR[\fIpathname\fR] .RS 4 This parameter should be set to the name of a file that the firewall should create if it starts successfully and remove when it stops\&. Creating and removing this file allows Shorewall to work with your distribution\*(Aqs initscripts\&. For OpenSuSE, this should be set to /var/lock/subsys/shorewall (var/lock/subsys/shorewall\-lite if building for export)\&. For Gentoo, it should be set to /run/lock/shorewall (/run/lock/shorewall\-lite)\&. For Redhat and derivatives as well as Debian and derivatives, the pathname should be omitted\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBImportant\fR .ps -1 .br Beginning with Shorewall 5\&.1\&.0, this setting is ignored when SERVICEDIR is non\-empty in ${SHAREDIR}/shorewall/shorewallrc (usually /usr/share/shorewall/shorewallrc)\&. .sp .5v .RE .RE .PP \fBTC\fR=[\fIpathname\fR] .RS 4 If specified, gives the pathname of the \*(Aqtc\*(Aq executable\&. If not specified, \*(Aqtc\*(Aq is assumed and the utility will be located using the current PATH setting\&. .RE .PP \fBTC_BITS\fR=[\fInumber\fR] .RS 4 The number of bits at the low end of the 32\-bit packet mark to be used for traffic shaping marking\&. May be zero\&. See MASK_BITS above for default value\&. .RE .PP \fBTC_ENABLED=\fR[\fBYes\fR|\fBNo\fR|\fBInternal\fR|\fBSimple\fR|\fBShared\fR] .RS 4 If you say \fBYes\fR or \fByes\fR here, Shorewall will use a script that you supply to configure traffic shaping\&. The script must be named \*(Aqtcstart\*(Aq and must be placed in a directory on your CONFIG_PATH\&. .sp If you say \fBNo\fR or \fBno\fR then traffic shaping is not enabled\&. .sp If you set TC_ENABLED=Simple (Shorewall 4\&.4\&.6 and later), simple traffic shaping using \m[blue]\fBshorewall\-tcinterfaces\fR\m[]\&\s-2\u[28]\d\s+2(5) and \m[blue]\fBshorewall\-tcpri\fR\m[]\&\s-2\u[29]\d\s+2(5) is enabled\&. .sp If you set TC_ENABLED=Internal or internal or leave the option empty then Shorewall will use its builtin traffic shaper (tc4shorewall written by Arne Bernin\&. .sp Beginning with Shorewall 4\&.4\&.15, you can set TC_ENABLED=Shared\&. This allows you to configure the tcdevices and tcclasses in your Shorewall6 configuration yet make them available to the compiler when compiling your Shorewall configuration\&. In addition to setting TC_ENABLED=Shared, you need to create symbolic links from your Shorewall configuration directory (normally /etc/shorewall/) to the tcdevices and tcclasses files in your Shorewall6 configuration directory (normally /etc/shorewall6/)\&. .RE .PP \fBTC_EXPERT=\fR{\fBYes\fR|\fBNo\fR} .RS 4 Normally, Shorewall tries to protect users from themselves by preventing PREROUTING and OUTPUT tcrules from being applied to packets that have been marked by the \*(Aqtrack\*(Aq option in \m[blue]\fBshorewall\-providers\fR\m[]\&\s-2\u[9]\d\s+2(5)\&. .sp If you know what you are doing, you can set TC_EXPERT=Yes and Shorewall will not include these cautionary checks\&. .RE .PP \fBTC_PRIOMAP\fR=\fImap\fR .RS 4 Added in Shorewall 4\&.4\&.6\&. Determines the mapping of a packet\*(Aqs TOS field to priority bands\&. See \m[blue]\fBshorewall\-tcpri\fR\m[]\&\s-2\u[29]\d\s+2(5)\&. The \fImap\fR consists of 16 space\-separated digits with values 1, 2 or 3\&. A value of 1 corresponds to Linux priority 0, 2 to Linux priority 1, and 3 to Linux Priority 2\&. The first entry gives the priority of TOS value 0, the second of TOS value 1, and so on\&. See tc\-prio(8) for additional information\&. .sp The default setting is TC_PRIOMAP="2 3 3 3 2 3 1 1 2 2 2 2 2 2 2 2"\&. .RE .PP \fBTCP_FLAGS_DISPOSITION=\fR[\fBACCEPT\fR|\fBDROP\fR|\fBREJECT\fR|A_DROP|A_REJECT] .RS 4 Determines the disposition of TCP packets that fail the checks enabled by the \fBtcpflags\fR interface option (see \m[blue]\fBshorewall\-interfaces\fR\m[]\&\s-2\u[20]\d\s+2(5)) and must have a value of ACCEPT (accept the packet), REJECT (send an RST response) or DROP (ignore the packet)\&. If not set or if set to the empty value (e\&.g\&., TCP_FLAGS_DISPOSITION="") then TCP_FLAGS_DISPOSITION=DROP is assumed\&. .sp A_DROP and A_REJECT are audited versions of DROP and REJECT respectively and were added in Shorewall 4\&.4\&.20\&. They require AUDIT_TARGET in the kernel and iptables\&. .RE .PP \fBTCP_FLAGS_LOG_LEVEL=\fR[\fIlog\-level\fR[:\fIlog\-tag\fR]] .RS 4 Determines the syslog level for logging packets that fail the checks enabled by the tcpflags interface option\&. The value must be a valid syslogd log level\&. If you don\*(Aqt want to log these packets, set to the empty value (e\&.g\&., TCP_FLAGS_LOG_LEVEL="")\&. .RE .PP \fBTRACK_PROVIDERS=\fR{\fBYes\fR|\fBNo\fR} .RS 4 Added in Shorewall 4\&.4\&.3\&. When set to Yes, causes the \fBtrack\fR option to be assumed on all providers defined in \m[blue]\fBshorewall\-providers\fR\m[]\&\s-2\u[9]\d\s+2(5)\&. May be overridden on an individual provider through use of the \fBnotrack\fR option\&. The default value is \*(AqNo\*(Aq\&. .sp Beginning in Shorewall 4\&.4\&.6, setting this option to \*(AqYes\*(Aq also simplifies PREROUTING rules in \m[blue]\fBshorewall\-tcrules\fR\m[]\&\s-2\u[12]\d\s+2(5)\&. Previously, when TC_EXPERT=No, packets arriving through \*(Aqtracked\*(Aq provider interfaces were unconditionally passed to the PREROUTING tcrules\&. This was done so that tcrules could reset the packet mark to zero, thus allowing the packet to be routed using the \*(Aqmain\*(Aq routing table\&. Using the main table allowed dynamic routes (such as those added for VPNs) to be effective\&. The rtrules file was created to provide a better alternative to clearing the packet mark\&. As a consequence, passing these packets to PREROUTING complicates things without providing any real benefit\&. Beginning with Shorewall 4\&.4\&.6, when TRACK_PROVIDERS=Yes and TC_EXPERT=No, packets arriving through \*(Aqtracked\*(Aq interfaces will not be passed to the PREROUTING rules\&. Since TRACK_PROVIDERS was just introduced in 4\&.4\&.3, this change should be transparent to most, if not all, users\&. .RE .PP \fBTRACK_RULES=\fR{\fBYes\fR|\fBNo\fR|File} .RS 4 Added in Shorewall 4\&.5\&.20\&. If set to \fBYes\fR, causes the compiler to add a comment to iptables rules to indicate the file name and line number of the configuration entry that generated the rule\&. If set to \fBNo\fR (the default), then no such comments are added\&. .sp Setting this option to \fBYes\fR requires the Comments capability in iptables and kernel\&. .sp Beginning with Shorewall 5\&.0\&.5, the option may also be set to \fBFile\fR\&. That setting causes similar comments to be added to the \&.iptables\-restore\-input file, which is normally created in /var/lib/shorewall\&. .RE .PP \fBUNTRACKED_DISPOSITION=[ACCEPT|A_ACCEPT|A_DROP|A_REJECT|DROP|REJECT|CONTINUE]\fR .RS 4 Added in Shorewall 4\&.5\&.13\&. Shorewall has traditionally passed UNTRACKED packets through the NEW section of \m[blue]\fBshorewall\-rules\fR\m[]\&\s-2\u[8]\d\s+2 (5)\&. When a packet in UNTRACKED state fails to match any rule in the UNTRACKED section, the packet is disposed of based on this setting\&. The default value is CONTINUE for compatibility with earlier versions\&. .RE .PP \fBUNTRACKED_LOG_LEVEL=\fR\fIlog\-level\fR[:\fIlog\-tag\fR] .RS 4 Added in Shorewall 4\&.5\&.13\&. Packets in the UNTRACKED state that do not match any rule in the UNTRACKED section of \m[blue]\fBshorewall\-rules\fR\m[]\&\s-2\u[8]\d\s+2 (5) are logged at this level\&. The default value is empty which means no logging is performed\&. .RE .PP \fBUSE_DEFAULT_RT=\fR[\fBYes\fR|\fBNo\fR] .RS 4 When set to \*(AqYes\*(Aq, this option causes the Shorewall multi\-ISP feature to create a set of routing rules which are resilient to changes in the main routing table\&. Such changes can occur for a number of reasons, VPNs going up and down being an example\&. The idea is to send packets through the main table prior to applying any of the Shorewall\-generated routing rules\&. So changes to the main table will affect the routing of packets by default\&. .sp When USE_DEFAULT_RT=Yes: .sp .RS 4 .ie n \{\ \h'-04' 1.\h'+01'\c .\} .el \{\ .sp -1 .IP " 1." 4.2 .\} Both the DUPLICATE and the COPY columns in \m[blue]\fBproviders\fR\m[]\&\s-2\u[9]\d\s+2(5) file must remain empty (or contain "\-")\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 2.\h'+01'\c .\} .el \{\ .sp -1 .IP " 2." 4.2 .\} The default route is added to the the \*(Aqdefault\*(Aq table rather than to the main table\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 3.\h'+01'\c .\} .el \{\ .sp -1 .IP " 3." 4.2 .\} If running Shorewall 5\&.1\&.0 or earlier or if BALANCE_PROVIDERS=Yes (Shorewall 5\&.1\&.1 or later), then the \fBbalance\fR provider option is assumed unless the \fBfallback\fR, \fBloose\fR, \fBload\fR or \fBtproxy\fR option is specified\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 4.\h'+01'\c .\} .el \{\ .sp -1 .IP " 4." 4.2 .\} Packets are sent through the main routing table by a rule with priority 999\&. In \m[blue]\fBshorewall\-rtrules\fR\m[]\&\s-2\u[30]\d\s+2(5), the range 1\-998 may be used for inserting rules that bypass the main table\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 5.\h'+01'\c .\} .el \{\ .sp -1 .IP " 5." 4.2 .\} All provider gateways must be specified explicitly in the GATEWAY column\&. \fBdetect\fR may not be specified\&..if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br \fBdetect\fR may be specified for interfaces whose configuration is managed by dhcpcd\&. Shorewall will use dhcpcd\*(Aqs database to find the interface\*(Aqs gateway\&. .sp .5v .RE .RE .sp .RS 4 .ie n \{\ \h'-04' 6.\h'+01'\c .\} .el \{\ .sp -1 .IP " 6." 4.2 .\} You should disable all default route management outside of Shorewall\&. If a default route is added to the main table while Shorewall is started, then all policy routing will stop working (except for those routing rules in the priority range 1\-998)\&. .RE .sp Prior to Shorewall 4\&.6\&.0, if USE_DEFAULT_RT was not set or if it was set to the empty string then USE_DEFAULT_RT=No was assumed\&. Beginning with Shorewall 4\&.6\&.0, the default is USE_DEFAULT_RT=Yes and use of USE_DEFAULT_RT=No is deprecated\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBWarning\fR .ps -1 .br The \fBenable\fR, \fBdisable\fR and \fBreenable\fR commands do not work correctly when USE_DEFAULT_RT=No\&. .sp .5v .RE .RE .PP \fBUSE_NFLOG_SIZE=\fR[\fBYes\fR|\fBNo\fR] .RS 4 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: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Added a warning message when \-\-nflog\-range is used .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Added \-\-nflog\-size which works like \-\-nflog\-range was intended to work\&. .RE .sp 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\&. .sp 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\&. .RE .PP \fBUSE_PHYSICAL_NAMES=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 4\&.4\&.27\&. Normally, when Shorewall creates a Netfilter chain that relates to an interface, it uses the interface\*(Aqs logical name as the base of the chain name\&. For example, if the logical name for an interface is OAKLAND, then the input chain for traffic arriving on that interface would be \*(AqOAKLAND_in\*(Aq\&. If this option is set to Yes, then the physical name of the interface will be used the base of the chain name\&. .RE .PP \fBUSE_RT_NAMES=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 4\&.5\&.15\&. When set to \*(AqYes\*(Aq, Shorewall will use routing table (provider) names in the generated script rather than table numbers\&. When set to \*(AqNo\*(Aq (the default), routing table numbers will be used\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br If you set USE_RT_NAMES=Yes and KEEP_RT_TABLES=Yes, then you must insure that all of your providers have entries in /etc/iproute2/rt_tables as well as the following entries: .RS 4 255 local .RE .RS 4 254 main .RE .RS 4 253 default .RE .RS 4 250 balance .RE .RS 4 0 unspec .RE Without these entries, the firewall will fail to start\&. .sp .5v .RE .RE .PP \fBVERBOSE_MESSAGES=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 5\&.0\&.9\&. When Yes (the default), messages produced by the ?INFO and ?WARNING directives include the filename and linenumber of the directive\&. When set to No, that additional information is omitted\&. The setting may be overridden on a directive by directive basis by following ?INFO or ?WARNING with \*(Aq!\*(Aq (no intervening white space)\&. .RE .PP \fBVERBOSITY=\fR[\fInumber\fR] .RS 4 Shorewall has traditionally been very noisy (produced lots of output)\&. You may set the default level of verbosity using the VERBOSITY OPTION\&. .sp Values are: .RS 4 0 \- Silent\&. You may make it more verbose using the \-v option .RE .RS 4 1 \- Major progress messages displayed .RE .RS 4 2 \- All progress messages displayed (pre Shorewall\-3\&.2\&.0 behavior) .RE If not specified, then 2 is assumed\&. .RE .PP \fBWARNOLDCAPVERSION=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 4\&.5\&.12\&. When set to \fBYes\fR (the default), the compiler issues a warning when it finds a capabilities file that doesn\*(Aqt specify all of the capabilities supported by the compiler\&. When WARNOLDCAPVERSION is set to \fBNo\fR, no warning is issued\&. .RE .PP \fBWORKAROUNDS=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 4\&.6\&.11\&. Over time, there have been a number of changes in Shorewall that work around defects in other products such as iptables and ipset\&. When WORKAROUNDS=Yes, these workarounds are enabled; when WORKAROUNDS=No, they are disabled\&. If not specified or if specified as empty, WORKAROUNDS=Yes is assumed\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBWarning\fR .ps -1 .br Do not set WORKAROUNDS=Yes if you need to be able to use Shorewall\-generated scripts (such as created by the \fBsave\fR command) built by Shorewall 4\&.4\&.7 or older\&. .sp .5v .RE .RE .PP \fBZERO_MARKS=\fR[\fBYes\fR|\fBNo\fR] .RS 4 Added in Shorewall 5\&.0\&.12, this is a workaround for an issue where packet marks are not zeroed by the kernel\&. It should be set to No (the default) unless you find that incoming packets are being mis\-routed for no apparent reasons\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br Do not set this option to Yes if you have IPSEC software running on the firewall system\&. .sp .5v .RE .RE .PP \fBZONE_BITS\fR=[\fInumber\fR] .RS 4 Added in Shorewall 4\&.4\&.26\&. When non\-zero, enables automatic packet marking by source zone and determines the number of bits in the 32\-bit packet mark to be used for the zone mark\&. Default value is 0\&. .RE .PP \fBZONE2ZONE\fR=[\fB2\fR|\fB\-\fR] .RS 4 Added in Shorewall 4\&.4\&.4\&. This option determines how Shorewall constructs chain names involving zone names and/or \*(Aqall\*(Aq\&. Beginning with Shorewall 4\&.6\&.0, the default is \*(Aq\-\*(Aq (e\&.g\&., fw\-net); prior to that release, the default was \*(Aq2\*(Aq (e\&.g\&., fw2net)\&. .RE .SH "FILES" .PP /etc/shorewall/shorewall\&.conf .PP /etc/shorewall6/shorewall6\&.conf .SH "SEE ALSO" .PP shorewall(8) .SH "NOTES" .IP " 1." 4 shorewall-policy .RS 4 \%https://shorewall.org/manpages/shorewall-policy.html .RE .IP " 2." 4 shorewall-accounting .RS 4 \%https://shorewall.org/manpages/shorewall-accounting.html .RE .IP " 3." 4 shorewall-nat .RS 4 \%https://shorewall.org/manpages/shorewall-nat.html .RE .IP " 4." 4 shorewall-masq .RS 4 \%https://shorewall.org/manpages/shorewall-masq.html .RE .IP " 5." 4 shorewall-routestopped .RS 4 \%https://shorewall.org/manpages/shorewall-routestopped.html .RE .IP " 6." 4 shorewall-stoppedrules .RS 4 \%https://shorewall.org/manpages/shorewall-stoppedrules.html .RE .IP " 7." 4 shorewall-conntrack .RS 4 \%https://shorewall.org/manpages/shorewall-conntrack.html .RE .IP " 8." 4 shorewall-rules .RS 4 \%https://shorewall.org/manpages/shorewall-rules.html .RE .IP " 9." 4 shorewall-providers(5) .RS 4 \%https://shorewall.org/manpages/shorewall-providers.html .RE .IP "10." 4 shorewall-tcfilters(5) .RS 4 \%https://shorewall.org/manpages/shorewall-tcfilters.html .RE .IP "11." 4 shorewall-blrules .RS 4 \%https://shorewall.org/manpages/shorewall-blrules.html .RE .IP "12." 4 shorewall-tcrules .RS 4 \%https://shorewall.org/manpages/shorewall-tcrules.html .RE .IP "13." 4 Shorewall6 .RS 4 \%https://shorewall.org/IPv6Support.html .RE .IP "14." 4 https://shorewall.org/Docker.html .RS 4 \%https://shorewall.org/Docker.html .RE .IP "15." 4 https://shorewall.org/ISO-3661.html .RS 4 \%https://shorewall.org/ISO-3661.html .RE .IP "16." 4 shorewall-zones .RS 4 \%https://shorewall.org/manpages/shorewall-zones.html .RE .IP "17." 4 shorewall-nesting .RS 4 \%https://shorewall.org/manpages/shorewall-nesting.html .RE .IP "18." 4 shorewall(8) .RS 4 \%https://shorewall.org/manpages/shorewall.html .RE .IP "19." 4 shorewall-params(5) .RS 4 \%https://shorewall.org/manpages/shorewall-params.html .RE .IP "20." 4 shorewall-interfaces .RS 4 \%https://shorewall.org/manpages/shorewall-interfaces.html .RE .IP "21." 4 shorewall-logging(8) .RS 4 \%https://shorewall.org/manpages/shorewall-logging.html .RE .IP "22." 4 shorewall-maclist .RS 4 \%https://shorewall.org/manpages/shorewall-maclist.html .RE .IP "23." 4 shorewall[6].conf .RS 4 \%https://shorewall.org/manpages/shorewall.conf.html .RE .IP "24." 4 https://shorewall.org/MultiISP.html#null_routing .RS 4 \%https://shorewall.org/MultiISP.html#null_routing .RE .IP "25." 4 Shorewall Init Package .RS 4 \%https://shorewall.org/manpages/shorewall-init.html .RE .IP "26." 4 Hairpin packets are packets that are routed out of the same interface that they arrived on. .IP "27." 4 Hairpin packets are packets that are routed out of the same interface that they arrived on. .IP "28." 4 shorewall-tcinterfaces .RS 4 \%https://shorewall.org/manpages/shorewall-tcinterfaces.html .RE .IP "29." 4 shorewall-tcpri .RS 4 \%https://shorewall.org/manpages/shorewall-tcpri.html .RE .IP "30." 4 shorewall-rtrules .RS 4 \%https://shorewall.org/manpages/shorewall-rtrules.html .RE