'\" t .\" Title: shorewall-zones .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 06/28/2012 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" .TH "SHOREWALL\-ZONES" "5" "06/28/2012" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * 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" zones \- Shorewall zone declaration file .SH "SYNOPSIS" .HP \w'\fB/etc/shorewall/zones\fR\ 'u \fB/etc/shorewall/zones\fR .SH "DESCRIPTION" .PP The /etc/shorewall/zones file declares your network zones\&. You specify the hosts in each zone through entries in /etc/shorewall/interfaces or /etc/shorewall/hosts\&. .PP 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)\&. .PP \fBZONE\fR \- \fIzone\fR[\fB:\fR\fIparent\-zone\fR[\fB,\fR\fIparent\-zone\fR]\&.\&.\&.] .RS 4 Name of the \fIzone\fR\&. Must start with a letter and consist of letters, digits or \*(Aq_\*(Aq\&. The names "all", "none", "any", "SOURCE" and "DEST" are reserved and may not be used as zone names\&. The maximum length of a zone name is determined by the setting of the LOGFORMAT option in \m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5)\&. With the default LOGFORMAT, zone names can be at most 5 characters long\&. The maximum length of an iptables log prefix is 29 bytes\&. As explained in \m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2 (5), the default LOGPREFIX formatting string is \(lqShorewall:%s:%s:\(rq where the first %s is replaced by the chain name and the second is replaced by the disposition\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The default formatting string has 12 fixed characters ("Shorewall" and three colons)\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The longest of the standard dispositions are ACCEPT and REJECT which have 6 characters each\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The canonical name for the chain containing the rules for traffic going from zone 1 to zone 2 is "2" or "\-"\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} So if M is the maximum zone name length, such chains can have length 2*M + 1\&. .RS 4 12 + 6 + 2*M + 1 = 29 which reduces to .RE .RS 4 2*M = 29 \- 12 \- 6 \- 1 = 10 or .RE .RS 4 M = 5 .RE .RE The order in which Shorewall matches addresses from packets to zones is determined by the order of zone declarations\&. Where a zone is nested in one or more other zones, you may either ensure that the nested zone precedes its parents in this file, or you may follow the (sub)zone name by ":" and a comma\-separated list of the parent zones\&. The parent zones must have been declared in earlier records in this file\&. See \m[blue]\fBshorewall\-nesting\fR\m[]\&\s-2\u[2]\d\s+2(5) for additional information\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf #ZONE TYPE OPTIONS IN OPTIONS OUT OPTIONS a ipv4 b ipv4 c:a,b ipv4 .fi .if n \{\ .RE .\} .sp Currently, Shorewall uses this information to reorder the zone list so that parent zones appear after their subzones in the list\&. The IMPLICIT_CONTINUE option in \m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5) can also create implicit CONTINUE policies to/from the subzone\&. .sp Where an \fBipsec\fR zone is explicitly included as a child of an \fBipv4\fR zone, the ruleset allows CONTINUE policies (explicit or implicit) to work as expected\&. .sp In the future, Shorewall may make additional use of nesting information\&. .RE .PP \fBTYPE\fR .RS 4 .PP \fBipv4\fR .RS 4 This is the standard Shorewall zone type and is the default if you leave this column empty or if you enter "\-" in the column\&. Communication with some zone hosts may be encrypted\&. Encrypted hosts are designated using the \*(Aqipsec\*(Aqoption in \m[blue]\fBshorewall\-hosts\fR\m[]\&\s-2\u[3]\d\s+2(5)\&. .RE .PP \fBipsec\fR (or \fBipsec4\fR) .RS 4 Communication with all zone hosts is encrypted\&. Your kernel and iptables must include policy match support\&. .RE .PP \fBfirewall\fR .RS 4 Designates the firewall itself\&. You must have exactly one \*(Aqfirewall\*(Aq zone\&. No options are permitted with a \*(Aqfirewall\*(Aq zone\&. The name that you enter in the ZONE column will be stored in the shell variable $FW which you may use in other configuration files to designate the firewall zone\&. .RE .PP \fBbport\fR (or \fBbport4\fR) .RS 4 The zone is associated with one or more ports on a single bridge\&. .RE .PP \fBvserver\fR .RS 4 Added in Shorewall 4\&.4\&.11 Beta 2 \- A zone composed of Linux\-vserver guests\&. The zone contents must be defined in \m[blue]\fBshorewall\-hosts\fR\m[]\&\s-2\u[3]\d\s+2 (5)\&. .sp Vserver zones are implicitly handled as subzones of the firewall zone\&. .RE .RE .PP \fBOPTIONS, IN OPTIONS and OUT OPTIONS\fR (options, in_options, out_options) \- [\fIoption\fR[\fB,\fR\fIoption\fR]\&.\&.\&.] .RS 4 A comma\-separated list of options\&. With the exception of the \fBmss\fR and \fBblacklist\fR options, these only apply to TYPE \fBipsec\fR zones\&. .PP \fBblacklist\fR .RS 4 Added in Shorewall 4\&.4\&.13\&. May not be specified for \fBfirewall\fR or \fBvserver\fR zones\&. .sp When specified in the IN_OPTIONS column, causes all traffic from this zone to be passed against the \fBsrc\fR entries in s\m[blue]\fBhorewall\-blacklist\fR\m[]\&\s-2\u[4]\d\s+2(5)\&. .sp When specified in the OUT_OPTIONS column, causes all traffic to this zone to be passed against the \fBdst\fR entries in s\m[blue]\fBhorewall\-blacklist\fR\m[]\&\s-2\u[4]\d\s+2(5)\&. .sp Specifying this option in the OPTIONS column is equivalent to entering it in both of the IN_OPTIONS and OUT_OPTIONS column\&. .RE .PP \fBreqid=\fR\fInumber\fR .RS 4 where \fInumber\fR is specified using setkey(8) using the \*(Aqunique:\fInumber\fR option for the SPD level\&. .RE .PP \fBspi=\fR .RS 4 where \fInumber\fR is the SPI of the SA used to encrypt/decrypt packets\&. .RE .PP \fBproto=\fR\fBah\fR|\fBesp\fR|\fBipcomp\fR .RS 4 IPSEC Encapsulation Protocol .RE .PP \fBmss=\fR\fInumber\fR .RS 4 sets the MSS field in TCP packets\&. If you supply this option, you should also set FASTACCEPT=No in \m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5) to insure that both the SYN and SYN,ACK packets have their MSS field adjusted\&. .RE .PP \fBmode=\fR\fBtransport\fR|\fBtunnel\fR .RS 4 IPSEC mode .RE .PP \fBtunnel\-src=\fR\fIaddress\fR[/\fImask\fR] .RS 4 only available with mode=tunnel .RE .PP \fBtunnel\-dst=\fR\fIaddress\fR[/\fImask\fR] .RS 4 only available with mode=tunnel .RE .PP \fBstrict\fR .RS 4 Means that packets must match all rules\&. .RE .PP \fBnext\fR .RS 4 Separates rules; can only be used with strict .RE .sp The options in the OPTIONS column are applied to both incoming and outgoing traffic\&. The IN OPTIONS are applied to incoming traffic (in addition to OPTIONS) and the OUT OPTIONS are applied to outgoing traffic\&. .sp If you wish to leave a column empty but need to make an entry in a following column, use "\-"\&. .RE .SH "FILES" .PP /etc/shorewall/zones .SH "SEE ALSO" .PP \m[blue]\fBhttp://www\&.shorewall\&.net/Multiple_Zones\&.html\fR\m[]\&. .PP \m[blue]\fBhttp://shorewall\&.net/configuration_file_basics\&.htm#Pairs\fR\m[] .PP shorewall(8), shorewall\-accounting(5), shorewall\-actions(5), shorewall\-blacklist(5), shorewall\-hosts(5), shorewall_interfaces(5), shorewall\-ipsets(5), shorewall\-maclist(5), shorewall\-masq(5), shorewall\-nat(5), shorewall\-nesting(8), 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) .SH "NOTES" .IP " 1." 4 shorewall.conf .RS 4 \%http://www.shorewall.net/manpages/shorewall.conf.html .RE .IP " 2." 4 shorewall-nesting .RS 4 \%http://www.shorewall.net/manpages/shorewall-nesting.html .RE .IP " 3." 4 shorewall-hosts .RS 4 \%http://www.shorewall.net/manpages/shorewall-hosts.html .RE .IP " 4." 4 horewall-blacklist .RS 4 \%http://www.shorewall.net/manpages/shorewall-blacklist.html .RE