DnatTarget¶
- class DnatTarget(*, addr=None, port=None, last_port=None, is_random=False, is_persistent=False)[source]¶
This class provides access to the
DNATtarget- Parameters:
addr – an
IPv4Addressobjectport – port number (integer)
last_port – port number (integer) used when defining a port range
is_random – if
True, use the iptables(8)--randomoptionis_persistent – if
True, use the iptables(8)--persistentoption
- get_address() Optional[IPv4Address]¶
Returns the address used for [SD]NAT
- to_iptables_args() List[str]¶
Returns a list of iptables(8) arguments