?? shorewall-policy.5
字號:
.\" Title: shorewall-policy.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author].\" Generator: DocBook XSL Stylesheets v1.74.0 <http://docbook.sf.net/>.\" Date: 03/19/2009.\" Manual: [FIXME: manual].\" Source: [FIXME: source].\" Language: English.\".TH "SHOREWALL\-POLICY" "5" "03/19/2009" "[FIXME: source]" "[FIXME: manual]".\" -----------------------------------------------------------------.\" * (re)Define some macros.\" -----------------------------------------------------------------.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.\" toupper - uppercase a string (locale-aware).\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.de toupper.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ\\$*.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz...\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.\" SH-xref - format a cross-reference to an SH section.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.de SH-xref.ie n \{\.\}.toupper \\$*.el \{\\\$*.\}...\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.\" SH - level-one heading that works better for non-TTY output.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.de1 SH.\" put an extra blank line of space above the head in non-TTY output.if t \{\.sp 1.\}.sp \\n[PD]u.nr an-level 1.set-an-margin.nr an-prevailing-indent \\n[IN].fi.in \\n[an-margin]u.ti 0.HTML-TAG ".NH \\n[an-level]".it 1 an-trap.nr an-no-space-flag 1.nr an-break-flag 1\." make the size of the head bigger.ps +3.ft B.ne (2v + 1u).ie n \{\.\" if n (TTY output), use uppercase.toupper \\$*.\}.el \{\.nr an-break-flag 0.\" if not n (not TTY), use normal case (not uppercase)\\$1.in \\n[an-margin]u.ti 0.\" if not n (not TTY), put a border/line under subheading.sp -.6\l'\n(.lu'.\}...\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.\" SS - level-two heading that works better for non-TTY output.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.de1 SS.sp \\n[PD]u.nr an-level 1.set-an-margin.nr an-prevailing-indent \\n[IN].fi.in \\n[IN]u.ti \\n[SN]u.it 1 an-trap.nr an-no-space-flag 1.nr an-break-flag 1.ps \\n[PS-SS]u\." make the size of the head bigger.ps +2.ft B.ne (2v + 1u).if \\n[.$] \&\\$*...\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.\" BB/BE - put background/screen (filled box) around block of text.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.de BB.if t \{\.sp -.5.br.in +2n.ll -2n.gcolor red.di BX.\}...de EB.if t \{\.if "\\$2"adjust-for-leading-newline" \{\.sp -1.\}.br.di.in.ll.gcolor.nr BW \\n(.lu-\\n(.i.nr BH \\n(dn+.5v.ne \\n(BHu+.5v.ie "\\$2"adjust-for-leading-newline" \{\\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[].\}.el \{\\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[].\}.in 0.sp -.5v.nf.BX.in.sp .5v.fi.\}...\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.\" BM/EM - put colored marker in margin next to block of text.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.de BM.if t \{\.br.ll -2n.gcolor red.di BX.\}...de EM.if t \{\.br.di.ll.gcolor.nr BH \\n(dn.ne \\n(BHu\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[].in 0.nf.BX.in.fi.\}...\" -----------------------------------------------------------------.\" * set default formatting.\" -----------------------------------------------------------------.\" disable hyphenation.nh.\" disable justification (adjust text to left margin only).ad l.\" -----------------------------------------------------------------.\" * MAIN CONTENT STARTS HERE *.\" -----------------------------------------------------------------.SH "Name"policy \- Shorewall policy file.SH "Synopsis".fam C.HP \w'\fB/etc/shorewall/policy\fR\ 'u\fB/etc/shorewall/policy\fR.fam.SH "Description".PPThis file defines the high\-level policy for connections between zones defined in\m[blue]\fBshorewall\-zones\fR\m[]\&\s-2\u[1]\d\s+2(5)\&..if n \{\.sp.\}.RS 4.BM yellow.it 1 an-trap.nr an-no-space-flag 1.nr an-break-flag 1.br.ps +1\fBImportant\fR.ps -1.br.PPThe order of entries in this file is important.PPThis file determines what to do with a new connection request if we don\'t get a match from the /etc/shorewall/rules file \&. For each source/destination pair, the file is processed in order until a match is found ("all" will match any client or server)\&..sp .5v.EM yellow.RE.if n \{\.sp.\}.RS 4.BM yellow.it 1 an-trap.nr an-no-space-flag 1.nr an-break-flag 1.br.ps +1\fBImportant\fR.ps -1.br.PPIntra\-zone policies are pre\-defined.PPFor $FW and for all of the zones defined in /etc/shorewall/zones, the POLICY for connections from the zone to itself is ACCEPT (with no logging or TCP connection rate limiting but may be overridden by an entry in this file\&. The overriding entry must be explicit (cannot use "all" in the SOURCE or DEST)\&..PPSimilarly, if you have IMPLICIT_CONTINUE=Yes in shorewall\&.conf, then the implicit policy to/from any sub\-zone is CONTINUE\&. These implicit CONTINUE policies may also be overridden by an explicit entry in this file\&..sp .5v.EM yellow.RE.PPThe columns in the file are as follows\&..PP\fBSOURCE\fR \- \fIzone\fR|\fB$FW\fR|\fBall\fR.RS 4Source zone\&. Must be the name of a zone defined in\m[blue]\fBshorewall\-zones\fR\m[]\&\s-2\u[1]\d\s+2(5), $FW or "all"\&..RE.PP\fBDEST\fR \- \fIzone\fR|\fB$FW\fR|\fBall\fR.RS 4Destination zone\&. Must be the name of a zone defined in\m[blue]\fBshorewall\-zones\fR\m[]\&\s-2\u[1]\d\s+2(5), $FW or "all"\&. If the DEST is a bport zone, then the SOURCE must be "all", another bport zone associated with the same bridge, or it must be an ipv4 zone that is associated with only the same bridge\&..RE.PP\fBPOLICY\fR \- {\fBACCEPT\fR|\fBDROP\fR|\fBREJECT\fR|\fBCONTINUE\fR|\fBQUEUE\fR|\fBNFQUEUE\fR[(\fIqueuenumber\fR)]|\fBNONE\fR}[\fB:\fR{\fIdefault\-action\-or\-macro\fR|\fBNone\fR}].RS 4Policy if no match from the rules file is found\&..spIf the policy is other than CONTINUE or NONE then the policy may be followed by ":" and one of the following:.sp.RS 4.ie n \{\\h'-04' 1.\h'+01'\c.\}.el \{\.sp -1.IP " 1." 4.2.\}The word "None" or "none"\&. This causes any default action defined in\m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[2]\d\s+2(5) to be omitted for this policy\&..RE.sp.RS 4.ie n \{\\h'-04' 2.\h'+01'\c.\}.el \{\.sp -1.IP " 2." 4.2.\}The name of an action (requires that USE_ACTIONS=Yes in\m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[2]\d\s+2(5))\&. That action will be invoked before the policy is enforced\&..RE.sp.RS 4.ie n \{\\h'-04' 3.\h'+01'\c.\}.el \{\.sp -1.IP " 3." 4.2.\}The name of a macro\&. The rules in that macro will be applied before the policy is enforced\&. This does not require USE_ACTIONS=Yes\&..RE.RS 4.sp.if n \{\.RS 4.\}.fam C.ps -1.nf.BB lightgray.EB lightgray.fi.fam.ps +1.if n \{\.RE.\}.spPossible policies are:.PP\fBACCEPT\fR.RS 4Accept the connection\&..RE.PP\fBDROP\fR.RS 4Ignore the connection request\&..RE.PP\fBREJECT\fR.RS 4For TCP, send RST\&. For all other, send an "unreachable" ICMP\&..RE.PP\fBQUEUE\fR.RS 4Queue the request for a user\-space application such as Snort\-inline\&..RE.PP\fBNFQUEUE\fR.RS 4Added in Shorewall\-perl 4\&.0\&.3\&. Queue the request for a user\-space application using the nfnetlink_queue mechanism\&. If a\fIqueuenumber\fRis not given, queue zero (0) is assumed\&..RE.PP\fBCONTINUE\fR.RS 4Pass the connection request past any other rules that it might also match (where the source or destination zone in those rules is a superset of the SOURCE or DEST in this policy)\&. See\m[blue]\fBshorewall\-nesting\fR\m[]\&\s-2\u[3]\d\s+2(5) for additional information\&..RE.PP\fBNONE\fR.RS 4Assume that there will never be any packets from this SOURCE to this DEST\&. Shorewall will not create any infrastructure to handle such packets and you may not have any rules with this SOURCE and DEST in the /etc/shorewall/rules file\&. If such a packet\fBis\fRreceived, the result is undefined\&. NONE may not be used if the SOURCE or DEST columns contain the firewall zone ($FW) or "all"\&..RE.RE.PP\fBLOG LEVEL\fR (Optional) \- [\fIlog\-level\fR|\fBULOG|NFLOG\fR].RS 4If supplied, each connection handled under the default POLICY is logged at that level\&. If not supplied, no log message is generated\&. See syslog\&.conf(5) for a description of log levels\&..spYou may also specify ULOG or NFLOG (must be in upper case)\&. This will log to the ULOG or NFLOG target and will send to a separate log through use of ulogd (\m[blue]\fBhttp://www\&.netfilter\&.org/projects/ulogd/index\&.html\fR\m[])\&..spIf you don\'t want to log but need to specify the following column, place "\-" here\&..RE.PP\fBBURST:LIMIT\fR \- \fIrate\fR\fB/\fR{\fBsecond\fR|\fBminute\fR}:\fIburst\fR.RS 4If passed, specifies the maximum TCP connection\fIrate\fRand the size of an acceptable\fIburst\fR\&. If not specified, TCP connections are not limited\&..RE.PP\fBCONNLIMIT\fR \- \fIlimit\fR[:\fImask\fR].RS 4Added in Shorewall\-perl 4\&.2\&.1\&. May be used to limit the number of simultaneous connections from each individual host to\fIlimit\fRconnections\&. While the limit is only checked on connections to which this policy could apply, the number of current connections is calculated over all current connections from the SOURCE host\&. By default, the limit is applied to each host individually but can be made to apply to networks of hosts by specifying a\fImask\fR\&. The\fImask\fRspecifies the width of a VLSM mask to be applied to the source address; the number of current connections is then taken over all hosts in the subnet\fIsource\-address\fR/\fImask\fR\&..RE.SH "Example".sp.RS 4.ie n \{\\h'-04' 1.\h'+01'\c.\}.el \{\.sp -1.IP " 1." 4.2.\}All connections from the local network to the internet are allowed.RE.sp.RS 4.ie n \{\\h'-04' 2.\h'+01'\c.\}.el \{\.sp -1.IP " 2." 4.2.\}All connections from the internet are ignored but logged at syslog level KERNEL\&.INFO\&..RE.sp.RS 4.ie n \{\\h'-04' 3.\h'+01'\c.\}.el \{\.sp -1.IP " 3." 4.2.\}All other connection requests are rejected and logged at level KERNEL\&.INFO\&..RE.sp.if n \{\.RS 4.\}.fam C.ps -1.nf.BB lightgray #SOURCE DEST POLICY LOG BURST:LIMIT # LEVEL loc net ACCEPT net all DROP info # # THE FOLLOWING POLICY MUST BE LAST # all all REJECT info.EB lightgray.fi.fam.ps +1.if n \{\.RE.\}.SH "FILES".PP/etc/shorewall/policy.SH "See ALSO".PPshorewall(8), shorewall\-accounting(5), shorewall\-actions(5), shorewall\-blacklist(5), shorewall\-hosts(5), shorewall\-interfaces(5), shorewall\-ipsec(5), shorewall\-maclist(5), shorewall\-masq(5), shorewall\-nat(5), shorewall\-netmap(5), shorewall\-params(5), shorewall\-policy(5), shorewall\-providers(5), shorewall\-proxyarp(5), shorewall\-route_rules(5), shorewall\-routestopped(5), shorewall\-rules(5), shorewall\&.conf(5), shorewall\-tcclasses(5), shorewall\-tcdevices(5), shorewall\-tcrules(5), shorewall\-tos(5), shorewall\-tunnels(5), shorewall\-zones(5).SH "Notes".IP " 1." 4shorewall-zones.RS 4\%http://www.shorewall.net/manpages/shorewall-zones.html.RE.IP " 2." 4shorewall.conf.RS 4\%http://www.shorewall.net/manpages/shorewall.conf.html.RE.IP " 3." 4shorewall-nesting.RS 4\%http://www.shorewall.net/manpages/shorewall-nesting.html.RE
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -