SnatTarget¶
- class SnatTarget(*, addr: Optional[IPv4Address] = None, port: Optional[int] = None, last_port: Optional[int] = None, is_random=False, is_persistent=False)[source]¶
This class provides access to the
SNATtarget- 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