Home | History | Annotate | Download | only in extensions
      1 This target is only valid in the
      2 .B nat
      3 table, in the
      4 .B POSTROUTING
      5 and
      6 .B INPUT
      7 chains, and user-defined chains which are only called from those
      8 chains.  It specifies that the source address of the packet should be
      9 modified (and all future packets in this connection will also be
     10 mangled), and rules should cease being examined.  It takes the
     11 following options:
     12 .TP
     13 \fB\-\-to\-source\fP [\fIipaddr\fP[\fB\-\fP\fIipaddr\fP]][\fB:\fP\fIport\fP[\fB\-\fP\fIport\fP]]
     14 which can specify a single new source IP address, an inclusive range
     15 of IP addresses. Optionally a port range,
     16 if the rule also specifies one of the following protocols:
     17 \fBtcp\fP, \fBudp\fP, \fBdccp\fP or \fBsctp\fP.
     18 If no port range is specified, then source ports below 512 will be
     19 mapped to other ports below 512: those between 512 and 1023 inclusive
     20 will be mapped to ports below 1024, and other ports will be mapped to
     21 1024 or above. Where possible, no port alteration will occur.
     22 In Kernels up to 2.6.10, you can add several \-\-to\-source options. For those
     23 kernels, if you specify more than one source address, either via an address
     24 range or multiple \-\-to\-source options, a simple round-robin (one after another
     25 in cycle) takes place between these addresses.
     26 Later Kernels (>= 2.6.11-rc1) don't have the ability to NAT to multiple ranges
     27 anymore.
     28 .TP
     29 \fB\-\-random\fP
     30 If option
     31 \fB\-\-random\fP
     32 is used then port mapping will be randomized through a hash-based algorithm (kernel >= 2.6.21).
     33 .TP
     34 \fB\-\-random-fully\fP
     35 If option
     36 \fB\-\-random-fully\fP
     37 is used then port mapping will be fully randomized through a PRNG (kernel >= 3.14).
     38 .TP
     39 \fB\-\-persistent\fP
     40 Gives a client the same source-/destination-address for each connection.
     41 This supersedes the SAME target. Support for persistent mappings is available
     42 from 2.6.29-rc2.
     43 .PP
     44 Kernels prior to 2.6.36-rc1 don't have the ability to
     45 .B SNAT
     46 in the
     47 .B INPUT
     48 chain.
     49 .TP
     50 IPv6 support available since Linux kernels >= 3.7.
     51