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 POSTROUTING |
| 5 | chain. It should only be used with dynamically assigned IP (dialup) |
| 6 | connections: if you have a static IP address, you should use the SNAT |
| 7 | target. Masquerading is equivalent to specifying a mapping to the IP |
| 8 | address of the interface the packet is going out, but also has the |
| 9 | effect that connections are |
| 10 | .I forgotten |
| 11 | when the interface goes down. This is the correct behavior when the |
| 12 | next dialup is unlikely to have the same interface address (and hence |
| 13 | any established connections are lost anyway). It takes one option: |
| 14 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 15 | \fB\-\-to\-ports\fP \fIport\fP[\fB\-\fP\fIport\fP] |
Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 16 | This specifies a range of source ports to use, overriding the default |
| 17 | .B SNAT |
| 18 | source port-selection heuristics (see above). This is only valid |
| 19 | if the rule also specifies |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 20 | \fB\-p tcp\fP |
Henrik Nordstrom | c279413 | 2004-01-22 15:04:24 +0000 | [diff] [blame] | 21 | or |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 22 | \fB\-p udp\fP. |
Patrick McHardy | ef399a3 | 2007-05-29 11:24:45 +0000 | [diff] [blame] | 23 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 24 | \fB\-\-random\fP |
Patrick McHardy | ef399a3 | 2007-05-29 11:24:45 +0000 | [diff] [blame] | 25 | Randomize source port mapping |
Eric Leblond | ae4b0b3 | 2007-02-24 15:11:33 +0000 | [diff] [blame] | 26 | If option |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 27 | \fB\-\-random\fP |
Patrick McHardy | ef399a3 | 2007-05-29 11:24:45 +0000 | [diff] [blame] | 28 | is used then port mapping will be randomized (kernel >= 2.6.21). |
| 29 | .RS |
| 30 | .PP |