This target is only valid in the nat table, in the PREROUTING and OUTPUT chains, and user-defined chains which are only called from those chains. It specifies that the destination address of the packet should be modified (and all future packets in this connection will also be mangled), and rules should cease being examined. It takes the following options:

--to-destination [ipaddr[-ipaddr]][:port[-port[/baseport]]]
    which can specify a single new destination IP address, an inclusive range of IP addresses. Optionally a port range, if the rule also specifies one of the following protocols: tcp, udp, dccp or sctp. If no port range is specified, then the destination port will never be modified. If no IP address is specified then only the destination port will be modified. If baseport is given, the difference of the original destination port and its value is used as offset into the mapping port range. This allows one to create shifted portmap ranges and is available since kernel version 4.18. For a single port or baseport, a service name as listed in /etc/services may be used. If ipaddr is an IPv4 loopback address (i.e. 127.0.0.0/8) the "net.ipv4.conf.*.route_localnet" sysctl for the input interface needs to be set to 1. Otherwise packets will be dropped by the routing code as "martians".

--random
    Randomize source port mapping (kernel >= 2.6.22).

--persistent
    Gives a client the same source-/destination-address for each connection. This supersedes the SAME target. Support for persistent mappings is available from 2.6.29-rc2.

IPv6 support available since Linux kernels >= 3.7.