4cc03970ca17b84559f9ba7c4c850e4958c8ac6b
[iptables.git] / extensions / libipt_SNAT.man
1 This target is only valid in the
2 .B nat
3 table, in the
4 .B POSTROUTING
5 chain.  It specifies that the source address of the packet should be
6 modified (and all future packets in this connection will also be
7 mangled), and rules should cease being examined.  It takes one type
8 of option:
9 .TP
10 .BR "--to-source  " "\fIipaddr\fP[-\fIipaddr\fP][:\fIport\fP-\fIport\fP]"
11 which can specify a single new source IP address, an inclusive range
12 of IP addresses, and optionally, a port range (which is only valid if
13 the rule also specifies
14 .B "-p tcp"
15 or
16 .BR "-p udp" ).
17 If no port range is specified, then source ports below 512 will be
18 mapped to other ports below 512: those between 512 and 1023 inclusive
19 will be mapped to ports below 1024, and other ports will be mapped to
20 1024 or above. Where possible, no port alteration will occur.
21 .RS
22 .PP
23 You can add several --to-source options.  If you specify more
24 than one source address, either via an address range or multiple
25 --to-source options, a simple round-robin (one after another in
26 cycle) takes place between these adresses.