xref: /aosp_15_r20/external/iptables/extensions/libxt_SNAT.man (revision a71a954618bbadd4a345637e5edcf36eec826889)
1This target is only valid in the
2.B nat
3table, in the
4.B POSTROUTING
5and
6.B INPUT
7chains, and user-defined chains which are only called from those
8chains.  It specifies that the source address of the packet should be
9modified (and all future packets in this connection will also be
10mangled), and rules should cease being examined.  It takes the
11following options:
12.TP
13\fB\-\-to\-source\fP [\fIipaddr\fP[\fB\-\fP\fIipaddr\fP]][\fB:\fP\fIport\fP[\fB\-\fP\fIport\fP]]
14which can specify a single new source IP address, an inclusive range
15of 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 source ports below 512 will be
19mapped to other ports below 512: those between 512 and 1023 inclusive
20will be mapped to ports below 1024, and other ports will be mapped to
211024 or above. Where possible, no port alteration will occur.
22.TP
23\fB\-\-random\fP
24Randomize source port mapping through a hash-based algorithm (kernel >= 2.6.21).
25.TP
26\fB\-\-random-fully\fP
27Fully randomize source port mapping through a PRNG (kernel >= 3.14).
28.TP
29\fB\-\-persistent\fP
30Gives a client the same source-/destination-address for each connection.
31This supersedes the SAME target. Support for persistent mappings is available
32from 2.6.29-rc2.
33.PP
34Kernels prior to 2.6.36-rc1 don't have the ability to
35.B SNAT
36in the
37.B INPUT
38chain.
39.TP
40IPv6 support available since Linux kernels >= 3.7.
41