shorewall6-conntrack5conntrackshorewall conntrack file/etc/shorewall/conntrackDescriptionThe original intent of the notrack
file was to exempt certain traffic from Netfilter connection tracking.
Traffic matching entries in the file were not to be tracked.The role of the file was expanded in Shorewall 4.4.27 to include all
rules that can be added in the Netfilter raw table. In 4.5.7, the file's name was changed to
conntrack.The file supports two different column layouts: FORMAT 1, FORMAT 2,
and FORMAT 3, FORMAT 1 being the default. The three differ as
follows:in FORMAT 2 and 3, there is an additional leading ACTION
column.in FORMAT 3, the SOURCE column accepts no zone name; rather the
ACTION column allows a SUFFIX that determines the chain(s) that the
generated rule will be added to.When an entry in the following form is encountered, the format of
the following entries are assumed to be of the specified
format.[?]FORMATformatwhere format is either 1,2 or 3.Format 3 was introduced in Shorewall 4.5.10. The optional '?' was
introduced in Shorewall 4.5.11 and ?FORMAT is the preferred form; the form
without the '?' is deprecated.Comments may be attached to Netfilter rules generated from entries
in this file through the use of COMMENT lines. These lines begin with the
word COMMENT; the remainder of the line is treated as a comment which is
attached to subsequent rules until another COMMENT line is found or until
the end of the file is reached. To stop adding comments to rules, use a
line with only the word COMMENT.Beginning with Shorewall 4.5.11, ?COMMENT is a synonym for COMMENT
and is preferred.The columns in the file are as follows (where the column name is
followed by a different name in parentheses, the different name is used in
the alternate specification syntax).ACTION - {NOTRACK|CT:helper:name[(arg=val[,...])|CT:notrack|DROP}[:chain-designator]This column is only present when FORMAT >= 2. Values other
than NOTRACK or DROP require CT Target
support in your iptables and kernel. or
Disables connection tracking for this packet.Added in Shorewall 4.5.10. Silently discard the
packet.:nameAttach the helper identified by the
name to this connection. This is more
flexible than loading the conntrack helper with preset
ports.At this writing, the available helpers are:amandaRequires that the amanda netfilter helper is
present.ftpRequires that the FTP netfilter helper is
present.ircRequires that the IRC netfilter helper is
present.netbios-nsRequires that the netbios_ns (sic) helper is
present.RAS and Q.931These require that the H323 netfilter helper is
present.pptpRequires that the pptp netfilter helper is
present.saneRequires that the SANE netfilter helper is
present.sipRequires that the SIP netfilter helper is
present.snmpRequires that the SNMP netfilter helper is
present.tftpRequires that the TFTP netfilter helper is
present.May be followed by an option list of
arg=val
pairs in parentheses:=event[,...]Only generate the specified conntrack events for this
connection. Possible event types are: new, related, destroy, reply, assured, protoinfo, helper, mark (this is connection mark, not
packet mark), natseqinfo,
and secmark. If more than
one event is listed, the
event list must be enclosed in
parentheses (e.g., ctevents=(new,related)).Only generate a new
expectation events for this connection.When FORMAT = 1, this column is not present and the rule is
processed as if NOTRACK had been entered in this column.Beginning with Shorewall 4.5.10, when FORMAT = 3, this column
can end with a colon followed by a
chain-designator. The
chain-designator can be one of the
following:PThe rule is added to the raw table PREROUTING chain.
This is the default if no
chain-designator is present.OThe rule is added to the raw table OUTPUT chain.PO or OPThe rule is added to the raw table PREROUTING and OUTPUT
chains.SOURCE (formats 1 and 2) ‒
{zone[:interface][:address-list]|COMMENT}where zone is the name of a zone,
interface is an interface to that zone,
and address-list is a comma-separated
list of addresses (may contain exclusion - see shorewall-exclusion
(5)).Beginning with Shorewall 4.5.7, can be
used as the zone name to mean
all zones.Beginning with Shorewall 4.5.10, can be
used as the zone name to mean all
off-firewall zones.SOURCE (format 3) ‒
{-|interface[:address-list]|address-list}Where interface is an interface to
that zone, and address-list is a
comma-separated list of addresses (may contain exclusion - see
shorewall-exclusion
(5)).COMMENT is only allowed in format 1; the remainder of the line
is treated as a comment that will be associated with the generated
rule(s).DEST ‒
{-|interface[:address-list]|address-list}where address-list is a
comma-separated list of addresses (may contain exclusion - see
shorewall6-exclusion
(5)).PROTO ‒
protocol-name-or-number[,...]A protocol name from /etc/protocols or a
protocol number.Beginning with Shorewall 4.5.12, this column is labeled
PROTOS and can accept a
comma-separated list of protocols. Either proto or protos is accepted in the alternate input
format.DEST PORT(S) (dport) - port-number/service-name-listA comma-separated list of port numbers and/or service names
from /etc/services. May also include port
ranges of the form
low-port:high-port
if your kernel and iptables include port range support.SOURCE PORT(S) (sport) - port-number/service-name-listA comma-separated list of port numbers and/or service names
from /etc/services. May also include port
ranges of the form
low-port:high-port
if your kernel and iptables include port range support.USER/GROUP (user) ‒
[user][:group]May only be specified if the SOURCE
zone is $FW. Specifies the effective user
id and or group id of the process sending the traffic.SWITCH -
[!]switch-name[={0|1}]Added in Shorewall 4.5.10 and allows enabling and disabling
the rule without requiring shorewall
restart.The rule is enabled if the value stored in
/proc/net/nf_condition/switch-name
is 1. The rule is disabled if that file contains 0 (the default). If
'!' is supplied, the test is inverted such that the rule is enabled
if the file contains 0.Within the switch-name, '@0' and
'@{0}' are replaced by the name of the chain to which the rule is a
added. The switch-name (after '...'
expansion) must begin with a letter and be composed of letters,
decimal digits, underscores or hyphens. Switch names must be 30
characters or less in length.Switches are normally off. To
turn a switch on:echo 1 >
/proc/net/nf_condition/switch-nameTo turn it off again:echo 0 >
/proc/net/nf_condition/switch-nameSwitch settings are retained over shorewall
restart.When the switch-name is followed by
or , then the switch is
initialized to off or on respectively by the
start command. Other commands do not affect the
switch setting.EXAMPLEExample 1:#ACTION SOURCE DEST PROTO DEST SOURCE USER/GROUP
# PORT(S) PORT(S)
CT:helper:ftp(expevents=new) fw - tcp 21 Example 2 (Shorewall 4.5.10 or later):Drop traffic to/from all zones to IP address 1.2.3.4FORMAT 2
#ACTION SOURCE DEST PROTO DEST SOURCE USER/GROUP
# PORT(S) PORT(S)
DROP all-:1.2.3.4 -
DROP all 1.2.3.4orFORMAT 3
#ACTION SOURCE DEST PROTO DEST SOURCE USER/GROUP
# PORT(S) PORT(S)
DROP:P 1.2.3.4 -
DROP:PO - 1.2.3.4
FILES/etc/shorewall/notrackSee ALSOhttp://shorewall.net/configuration_file_basics.htm#Pairsshorewall(8), shorewall-accounting(5), shorewall-actions(5),
shorewall-blacklist(5), shorewall-hosts(5), shorewall_interfaces(5),
shorewall-ipsets(5), shorewall-masq(5), shorewall-nat(5),
shorewall-netmap(5), shorewall-params(5), shorewall-policy(5),
shorewall-providers(5), shorewall-proxyarp(5), shorewall-rtrules(5),
shorewall-routestopped(5), shorewall-rules(5), shorewall.conf(5),
shorewall-secmarks(5), shorewall-tcclasses(5), shorewall-tcdevices(5),
shorewall-tcrules(5), shorewall-tos(5), shorewall-tunnels(5),
shorewall-zones(5)