Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 1 | This target is only valid in the |
| 2 | .B nat |
| 3 | table, in the |
| 4 | .B PREROUTING |
| 5 | and |
| 6 | .B OUTPUT |
| 7 | chains, and user-defined chains which are only called from those |
Jonas Berlin | 8b7cc8a | 2005-03-15 19:20:14 +0000 | [diff] [blame] | 8 | chains. It redirects the packet to the machine itself by changing the |
| 9 | destination IP to the primary address of the incoming interface |
Max Kellermann | 5ae6f20 | 2008-01-29 13:40:11 +0000 | [diff] [blame] | 10 | (locally-generated packets are mapped to the 127.0.0.1 address). |
Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 11 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 12 | \fB\-\-to\-ports\fP \fIport\fP[\fB\-\fP\fIport\fP] |
Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 13 | This specifies a destination port or range of ports to use: without |
| 14 | this, the destination port is never altered. This is only valid |
| 15 | if the rule also specifies |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 16 | \fB\-p tcp\fP |
Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 17 | or |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 18 | \fB\-p udp\fP. |
Patrick McHardy | ef399a3 | 2007-05-29 11:24:45 +0000 | [diff] [blame] | 19 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 20 | \fB\-\-random\fP |
Patrick McHardy | ef399a3 | 2007-05-29 11:24:45 +0000 | [diff] [blame] | 21 | If option |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 22 | \fB\-\-random\fP |
Patrick McHardy | ef399a3 | 2007-05-29 11:24:45 +0000 | [diff] [blame] | 23 | is used then port mapping will be randomized (kernel >= 2.6.22). |
| 24 | .RS |
| 25 | .PP |