⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shorewall-masq.5

📁 sharewall is very good
💻 5
📖 第 1 页 / 共 2 页
字号:
.if n \{\.RS 4.\}.fam C.ps -1.nf.BB lightgray        192\&.0\&.2\&.4:5000\-6000        :4000\-5000.EB lightgray.fi.fam.ps +1.if n \{\.RE.\}.spYou can invoke the SAME target rather than the SNAT target by prefixing the column contents with\fBSAME:\fR\&..spSAME works like SNAT with the exception that the same local IP address is assigned to each connection from a local address to a given remote address\&..spIf the\fBnodst:\fRoption is included, then the same source address is used for a given internal system regardless of which remote system is involved\&..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\fBWarning\fR.ps -1.brSupport for the SAME target is scheduled for removal from the Linux kernel in 2008\&..sp .5v.EM yellow.RE.spIf you simply place\fBNONAT\fRin this column, no rewriting of the source IP address or port number will be performed\&. This is useful if you want particular traffic to be exempt from the entries that follow in the file\&..spIf you want to leave this column empty but you need to specify the next column then place a hyphen ("\-") here\&..RE.PP\fBPROTO\fR (Optional) \- {\fB\-\fR|[!]\fIprotocol\-name\fR|[!]\fIprotocol\-number\fR}.RS 4If you wish to restrict this entry to a particular protocol then enter the protocol name (from protocols(5)) or number here\&..RE.PP\fBPORT(S)\fR (Optional) \- [[!]\fIport\-name\-or\-number\fR[,\fIport\-name\-or\-number\fR]\&.\&.\&.].RS 4If the PROTO column specifies TCP (protocol 6) or UDP (protocol 17) then you may list one or more port numbers (or names from services(5)) separated by commas or you may list a single port range (\fIlowport\fR:\fIhighport\fR)\&..spWhere a comma\-separated list is given, your kernel and iptables must have multiport match support and a maximum of 15 ports may be listed\&..RE.PP\fBIPSEC\fR (Optional) \- [\fIoption\fR[\fB,\fR\fIoption\fR]\&.\&.\&.].RS 4If you specify a value other than "\-" in this column, you must be running kernel 2\&.6 and your kernel and iptables must include policy match support\&..spComma\-separated list of options from the following\&. Only packets that will be encrypted via an SA that matches these options will have their source address changed\&..PP\fBreqid=\fR\fInumber\fR.RS 4where\fInumber\fRis specified using setkey(8) using the \'unique:\fInumber\fRoption for the SPD level\&..RE.PP\fBspi=\fR<number>.RS 4where\fInumber\fRis the SPI of the SA used to encrypt/decrypt packets\&..RE.PP\fBproto=\fR\fBah\fR|\fBesp\fR|\fBipcomp\fR.RS 4IPSEC Encapsulation Protocol.RE.PP\fBmss=\fR\fInumber\fR.RS 4sets the MSS field in TCP packets.RE.PP\fBmode=\fR\fBtransport\fR|\fBtunnel\fR.RS 4IPSEC mode.RE.PP\fBtunnel\-src=\fR\fIaddress\fR[/\fImask\fR].RS 4only available with mode=tunnel.RE.PP\fBtunnel\-dst=\fR\fIaddress\fR[/\fImask\fR].RS 4only available with mode=tunnel.RE.PP\fBstrict\fR.RS 4Means that packets must match all rules\&..RE.PP\fBnext\fR.RS 4Separates rules; can only be used with strict.RE.RE.PP\fBMARK\fR \- [\fB!\fR]\fIvalue\fR[/\fImask\fR][\fB:C\fR].RS 4Defines a test on the existing packet or connection mark\&. The rule will match only if the test returns true\&..spIf you don\'t want to define a test but need to specify anything in the following columns, place a "\-" in this field\&..PP!.RS 4Inverts the test (not equal).RE.PP\fIvalue\fR.RS 4Value of the packet or connection mark\&..RE.PP\fImask\fR.RS 4A mask to be applied to the mark before testing\&..RE.PP\fB:C\fR.RS 4Designates a connection mark\&. If omitted, the packet mark\'s value is tested\&. This option is only supported by Shorewall\-perl\&..RE.RE.SH "Examples".PPExample 1:.RS 4You have a simple masquerading setup where eth0 connects to a DSL or cable modem and eth1 connects to your local network with subnet 192\&.168\&.0\&.0/24\&..spYour entry in the file can be either:.sp.if n \{\.RS 4.\}.fam C.ps -1.nf.BB lightgray        #INTERFACE   SOURCE        eth0         eth1.EB lightgray.fi.fam.ps +1.if n \{\.RE.\}.spor.sp.if n \{\.RS 4.\}.fam C.ps -1.nf.BB lightgray        #INTERFACE   SOURCE        eth0    192\&.168\&.0\&.0/24.EB lightgray.fi.fam.ps +1.if n \{\.RE.\}.RE.PPExample 2:.RS 4You add a router to your local network to connect subnet 192\&.168\&.1\&.0/24 which you also want to masquerade\&. You then add a second entry for eth0 to this file:.sp.if n \{\.RS 4.\}.fam C.ps -1.nf.BB lightgray        #INTERFACE   SOURCE        eth0         192\&.168\&.1\&.0/24.EB lightgray.fi.fam.ps +1.if n \{\.RE.\}.RE.PPExample 3:.RS 4You have an IPSEC tunnel through ipsec0 and you want to masquerade packets coming from 192\&.168\&.1\&.0/24 but only if these packets are destined for hosts in 10\&.1\&.1\&.0/24:.sp.if n \{\.RS 4.\}.fam C.ps -1.nf.BB lightgray        #INTERFACE              SOURCE        ipsec0:10\&.1\&.1\&.0/24      196\&.168\&.1\&.0/24.EB lightgray.fi.fam.ps +1.if n \{\.RE.\}.RE.PPExample 4:.RS 4You want all outgoing traffic from 192\&.168\&.1\&.0/24 through eth0 to use source address 206\&.124\&.146\&.176 which is NOT the primary address of eth0\&. You want 206\&.124\&.146\&.176 to be added to eth0 with name eth0:0\&..sp.if n \{\.RS 4.\}.fam C.ps -1.nf.BB lightgray        #INTERFACE              SOURCE          ADDRESS        eth0:0                  192\&.168\&.1\&.0/24  206\&.124\&.146\&.176.EB lightgray.fi.fam.ps +1.if n \{\.RE.\}.RE.PPExample 5:.RS 4You want all outgoing SMTP traffic entering the firewall on eth1 to be sent from eth0 with source IP address 206\&.124\&.146\&.177\&. You want all other outgoing traffic from eth1 to be sent from eth0 with source IP address 206\&.124\&.146\&.176\&..sp.if n \{\.RS 4.\}.fam C.ps -1.nf.BB lightgray        #INTERFACE   SOURCE  ADDRESS         PROTO   PORT(S)        eth0         eth1    206\&.124\&.146\&.177 tcp     smtp        eth0         eth1    206\&.124\&.146\&.176.EB lightgray.fi.fam.ps +1.if n \{\.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\fBWarning\fR.ps -1.brThe order of the above two rules is significant!.sp .5v.EM yellow.RE.RE.SH "FILES".PP/etc/shorewall/masq.SH "See ALSO".PPshorewall(8), shorewall\-accounting(5), shorewall\-actions(5), shorewall\-blacklist(5), shorewall\-exclusion(5), shorewall\-hosts(5), shorewall\-interfaces(5), shorewall\-ipsec(5), shorewall\-maclist(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-tcrules.RS 4\%http://www.shorewall.net/manpages/shorewall-tcrules.html.RE.IP " 2." 4shorewall.conf.RS 4\%http://www.shorewall.net/manpages/shorewall.conf.html.RE.IP " 3." 4shorewall-interfaces.RS 4\%http://www.shorewall.net/manpages/shorewall-interfaces.html.RE.IP " 4." 4shorewall-exclusion.RS 4\%http://www.shorewall.net/manpages/shorewall-exclusion.html.RE.IP " 5." 4shorewall-nat.RS 4\%http://www.shorewall.net/manpages/shorewall-nat.html.RE

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -