📄 shorewall.8
字号:
.\}.RS 4.BM yellow.it 1 an-trap.nr an-no-space-flag 1.nr an-break-flag 1.br.ps +1\fBCaution\fR.ps -1.brThe\fBadd\fRcommand is not very robust\&. If there are errors in the\fIhost\-list\fR, you may see a large number of error messages yet a subsequent\fBshorewall show zones\fRcommand will indicate that all hosts were added\&. If this happens, replace\fBadd\fRby\fBdelete\fRand run the same command again\&. Then enter the correct command\&..sp .5v.EM yellow.RE.RE.PP\fBallow\fR.RS 4Re\-enables receipt of packets from hosts previously blacklisted by a\fBdrop\fR,\fBlogdrop\fR,\fBreject\fR, or\fBlogreject\fRcommand\&..RE.PP\fBcheck\fR.RS 4Compiles the configuraton in the specified\fIdirectory\fRand discards the compiled output script\&. If no\fIdirectory\fRis given, then /etc/shorewall is assumed\&..spThe\fB\-e\fRoption causes the compiler to look for a file named capabilities\&. This file is produced using the command\fBshorewall\-lite show \-f capabilities > capabilities\fRon a system with Shorewall Lite installed\&..spThe\fB\-C\fRoption determines the compiler to use (Shorewall\-shell or Shorewall\-perl)\&. If not specified, the SHOREWALL_COMPILER setting in\m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5) determines the compiler to use\&..spThe\fB\-d\fRoption only works when the compiler is Shorewall\-perl\&. It causes the compiler to be run under control of the Perl debugger\&..spThe\fB\-p\fRoption only works when the compiler is Shorewall\-perl\&. It causes the compiler to be profiled via the Perl\fB\-wd:DProf\fRcommand\-line option\&..RE.PP\fBclear\fR.RS 4Clear will remove all rules and chains installed by Shorewall\&. The firewall is then wide open and unprotected\&. Existing connections are untouched\&. Clear is often used to see if the firewall is causing connection problems\&..spThe\fB\-f\fRoption was added in Shorewall 4\&.0\&.3\&. If\fB\-f\fRis given, the command will be processed by the compiled script that executed the last successful\fBstart\fR,\fBrestart\fRor\fBrefresh\fRcommand if that script exists\&..RE.PP\fBcompile\fR.RS 4Compiles the current configuration into the executable file\fIpathname\fR\&. If a directory is supplied, Shorewall will look in that directory first for configuration files\&..spWhen \-e is specified, the compilation is being performed on a system other than where the compiled script will run\&. This option disables certain configuration options that require the script to be compiled where it is to be run\&. The use of \-e requires the presense of a configuration file named\FCcapabilities\F[]which may be produced using the command\fBshorewall\-lite show \-f capabilities > capabilities\fRon a system with Shorewall Lite installed.spThe\fB\-C\fRoption determines the compiler to use (Shorewall\-shell or Shorewall\-perl)\&. If not specified, the SHOREWALL_COMPILER setting in\m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5) determines the compiler to use\&..spThe\fB\-d\fRoption only works when the compiler is Shorewall\-perl\&. It causes the compiler to be run under control of the Perl debugger\&..spThe\fB\-p\fRoption only works when the compiler is Shorewall\-perl\&. It causes the compiler to be profiled via the Perl\fB\-wd:DProf\fRcommand\-line option\&..RE.PP\fBdelete\fR.RS 4The delete command reverses the effect of an earlier\fBadd\fRcommand\&..spThe\fIinterface\fRargument names an interface defined in the\m[blue]\fBshorewall\-interfaces\fR\m[]\&\s-2\u[2]\d\s+2(5) file\&. A\fIhost\-list\fRis comma\-separated list whose elements are a host or network address\&..RE.PP\fBdrop\fR.RS 4Causes traffic from the listed\fIaddress\fRes to be silently dropped\&..RE.PP\fBdump\fR.RS 4Produces a verbose report about the firewall configuration for the purpose of problem analysis\&..spThe\fB\-x\fRoption causes actual packet and byte counts to be displayed\&. Without that option, these counts are abbreviated\&. The\fB\-m\fRoption causes any MAC addresses included in Shorewall log messages to be displayed\&..RE.PP\fBexport\fR.RS 4If\fIdirectory1\fRis omitted, the current working directory is assumed\&..spThe\fB\-C\fRoption determines the compiler to use (Shorewall\-shell or Shorewall\-perl)\&. If not specified, the SHOREWALL_COMPILER setting in\m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5) determines the compiler to use\&..spAllows a non\-root user to compile a shorewall script and stage it on a system (provided that the user has access to the system via ssh)\&. The command is equivalent to:.sp.if n \{\.RS 4.\}.fam C.ps -1.nf.BB lightgray \fB/sbin/shorewall compile \-e\fR \fIdirectory1\fR \fIdirectory1\fR\fB/firewall &&\e\fR \fBscp\fR directory1\fB/firewall\fR \fIdirectory1\fR\fB/firewall\&.conf\fR [\fIuser\fR@]\fBsystem\fR:[\fIdirectory2\fR].EB lightgray.fi.fam.ps +1.if n \{\.RE.\}.spIn other words, the configuration in the specified (or defaulted) directory is compiled to a file called firewall in that directory\&. If compilation succeeds, then firewall and firewall\&.conf are copied to\fIsystem\fRusing scp\&..RE.PP\fBforget\fR.RS 4Deletes /var/lib/shorewall/\fIfilenam\fRe and /var/lib/shorewall/save\&. If no\fIfilename\fRis given then the file specified by RESTOREFILE in\m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5) is assumed\&..RE.PP\fBhelp\fR.RS 4Displays a syntax summary\&..RE.PP\fBhits\fR.RS 4Generates several reports from Shorewall log messages in the current log file\&. If the\fB\-t\fRoption is included, the reports are restricted to log messages generated today\&..RE.PP\fBipcalc\fR.RS 4Ipcalc displays the network address, broadcast address, network in CIDR notation and netmask corresponding to the input[s]\&..RE.PP\fBiprange\fR.RS 4Iprange decomposes the specified range of IP addresses into the equivalent list of network/host addresses\&..RE.PP\fBload\fR.RS 4If\fIdirectory\fRis omitted, the current working directory is assumed\&. Allows a non\-root user to compile a shorewall script and install it on a system (provided that the user has root access to the system via ssh)\&. The command is equivalent to:.sp.if n \{\.RS 4.\}.fam C.ps -1.nf.BB lightgray \fB/sbin/shorewall compile \-e\fR \fI\fIdirectory\fR\fR \fIdirectory\fR\fB/firewall &&\e\fR \fBscp\fR \fIdirectory\fR\fB/firewall\fR \fIdirectory\fR\fB/firewall\&.conf\fR \fBroot@\fR\fIsystem\fR\fB:/var/lib/shorewall\-lite/ &&\e\fR \fBssh root@\fR\fIsystem\fR \fB\'/sbin/shorewall\-lite start\'\fR.EB lightgray.fi.fam.ps +1.if n \{\.RE.\}.spIn other words, the configuration in the specified (or defaulted) directory is compiled to a file called firewall in that directory\&. If compilation succeeds, then firewall is copied to\fIsystem\fRusing scp\&. If the copy succeeds, Shorewall Lite on\fIsystem\fRis started via ssh\&..spIf\fB\-s\fRis specified and the\fBstart\fRcommand succeeds, then the remote Shorewall\-lite configuration is saved by executing\fBshorewall\-lite save\fRvia ssh\&..spif\fB\-c\fRis included, the command\fBshorewall\-lite show capabilities \-f > /var/lib/shorewall\-lite/capabilities\fRis executed via ssh then the generated file is copied to\fIdirectory\fRusing scp\&. This step is performed before the configuration is compiled\&..spIf\fB\-r\fRis included, it specifies that the root user on\fIsystem\fRis named\fIroot\-user\-name\fRrather than "root"\&..spThe\fB\-C\fRoption determines the compiler to use (Shorewall\-shell or Shorewall\-perl)\&. If not specified, the SHOREWALL_COMPILER setting in\m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5) determines the compiler to use\&..RE.PP\fBlogdrop\fR.RS 4Causes traffic from the listed\fIaddress\fRes to be logged then discarded\&. Logging occurs at the log level specified by the BLACKLIST_LOGLEVEL setting in\m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5)\&..RE.PP\fBlogwatch\fR.RS 4Monitors the log file specified by the LOGFILE option in\m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5) and produces an audible alarm when new Shorewall messages are logged\&. The\fB\-m\fRoption causes the MAC address of each packet source to be displayed if that information is available\&. The\fIrefresh\-interval\fRspecifies the time in seconds between screen refreshes\&. You can enter a negative number by preceding the number with "\-\-" (e\&.g\&.,\fBshorewall logwatch \-\- \-30\fR)\&. In this case, when a packet count changes, you will be prompted to hit any key to resume screen refreshes\&..RE.PP\fBlogreject\fR.RS 4Causes traffic from the listed\fIaddress\fRes to be logged then rejected\&. Logging occurs at the log level specified by the BLACKLIST_LOGLEVEL setting in\m[blue]\fBshorewall\&.conf\fR\m[]\&\s-2\u[1]\d\s+2(5)\&..RE.PP\fBrefresh\fR.RS 4Shorewall\-shell: The rules involving the the black list, ECN control rules, and traffic shaping are recreated to reflect any changes made to your configuration files\&. Existing connections are untouched\&..spShorewall\-perl: All steps performed by\fBrestart\fRare performed by\fBrefresh\fRwith the exception that\fBrefresh\fRonly recreates the chains specified in the command while\fBrestart\fRrecreates the entire Netfilter ruleset\&. If no\fIchain\fRis given, the static blacklisting chain\fBblacklst\fRis assumed\&..sp\fBNote\fR: Specifying chains in the command requires Shorewall\-perl 4\&.0\&.3 or later\&. Earlier versions only refresh the blacklst chain.spThe listed chains are assumed to be in the filter table\&. You can refresh chains in other tables by prefixing the chain name with the table name followed by ":" (e\&.g\&., nat:net_dnat)\&. Chain names which follow are assumed to be in that table until the end of the list or until an entry in the list names another table\&. Built\-in chains such as FORWARD may not be refreshed\&..spExample:.sp.if n \{\.RS 4.\}.fam C.ps -1.nf.BB lightgray\fBshorewall refresh net2fw nat:net_dnat\fR #Refresh the \'net2loc\' chain in the filter table and the \'net_dnat\' chain in the nat table.EB lightgray.fi.fam.ps +1.if n \{\.RE.\}.spBeginning with Shorewall 4\&.1, the\fBrefresh\fRcommand has slightly different behavior\&. When no chain name is given to the\fBrefresh\fRcommand, the mangle table is refreshed along with the blacklist chain (if any)\&. This allows you to modify\FC/etc/shorewall/tcrules \F[]and install the changes using\fBrefresh\fR\&..RE.PP\fBreload\fR.RS 4If\fIdirectory\fRis omitted, the current working directory is assumed\&. Allows a non\-root user to compile a shorewall script and install it on a system (provided that the user has root access to the system via ssh)\&. The command is equivalent to:.sp.if n \{\.RS 4.\}.fam C.ps -1.nf.BB lightgray \fB/sbin/shorewall compile \-e\fR \fIdirectory\fR \fIdirectory\fR\fB/firewall &&\e\fR \fBscp\fR \fIdirectory\fR\fB/firewall\fR \fIdirectory\fR\fB/firewall\&.conf\fR \fBroot@\fR\fIsystem\fR\fB:/var/lib/shorewall\-lite/ &&\e\fR \fBssh root@\fR\fIsystem\fR \fB\'/sbin/shorewall\-lite restart\'\fR.EB lightgray.fi.fam.ps +1.if n \{\.RE.\}.spIn other words, the configuration in the specified (or defaulted) directory is compiled to a file called firewall in that directory\&. If compilation succeeds, then firewall is copied to\fIsystem\fRusing scp\&. If the copy succeeds, Shorewall Lite on\fIsystem\fRis restarted via ssh\&..spIf\fB\-s\fRis specified and the\fBrestart\fRcommand succeeds, then the remote Shorewall\-lite configuration is saved by executing\fBshorewall\-lite save\fRvia ssh\&.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -