• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1This target is only valid in the
2.B nat
3table, in the
4.B PREROUTING
5and
6.B OUTPUT
7chains, and user-defined chains which are only called from those
8chains.  It specifies that the destination address of the packet
9should be modified (and all future packets in this connection will
10also be mangled), and rules should cease being examined.  It takes the
11following options:
12.TP
13\fB\-\-to\-destination\fP [\fIipaddr\fP[\fB\-\fP\fIipaddr\fP]][\fB:\fP\fIport\fP[\fB\-\fP\fIport\fP]]
14which can specify a single new destination IP address, an inclusive
15range of IP addresses. Optionally a port range,
16if the rule also specifies one of the following protocols:
17\fBtcp\fP, \fBudp\fP, \fBdccp\fP or \fBsctp\fP.
18If no port range is specified, then the destination port will never be
19modified. If no IP address is specified then only the destination port
20will be modified.
21In Kernels up to 2.6.10 you can add several \-\-to\-destination options. For
22those kernels, if you specify more than one destination address, either via an
23address range or multiple \-\-to\-destination options, a simple round-robin (one
24after another in cycle) load balancing takes place between these addresses.
25Later Kernels (>= 2.6.11-rc1) don't have the ability to NAT to multiple ranges
26anymore.
27.TP
28\fB\-\-random\fP
29If option
30\fB\-\-random\fP
31is used then port mapping will be randomized (kernel >= 2.6.22).
32.TP
33\fB\-\-persistent\fP
34Gives a client the same source-/destination-address for each connection.
35This supersedes the SAME target. Support for persistent mappings is available
36from 2.6.29-rc2.
37.TP
38IPv6 support available since Linux kernels >= 3.7.
39