On this page
ipaddress.IPv6Interface
Prev: ipaddress.IPv6Address | Up: ipaddress | Next: ipaddress.IPv6Network
Rel: ipaddress.AddressValueError, ipaddress.collapse_addresses, ipaddress.get_mixed_type_key, ipaddress.ip_address
Ref: docs.python.org — ipaddress.IPv6Interface
Tags: #public #python3 #stdlib #ipaddress
Import
import ipaddress
from ipaddress import IPv6Interface
Signature & Overview
ipaddress.IPv6Interface(address)
ipaddress.IPv6Interface class.
Methods & Attributes
IPv6Interface.compressed(...)— Return the shorthand version of the IP address as a string.IPv6Interface.exploded(...)— Return the longhand version of the IP address as a string.IPv6Interface.ip(...)—IPv6Interface.ipmethod/property.IPv6Interface.ipv4_mapped(...)— Return the IPv4 mapped address.IPv6Interface.is_global(...)—Trueif the address is defined as globally reachable by iana-ipv4-special-registry_ (for IPv4) or iana-ipv6-special-registry_ (for IPv6) with the following exception:IPv6Interface.is_link_local(...)— Test if the address is reserved for link-local.IPv6Interface.is_loopback(...)—IPv6Interface.is_loopbackmethod/property.IPv6Interface.is_multicast(...)— Test if the address is reserved for multicast use.IPv6Interface.is_private(...)—Trueif the address is defined as not globally reachable by iana-ipv4-special-registry_ (for IPv4) or iana-ipv6-special-registry_ (for IPv6) with the following exceptions:IPv6Interface.is_reserved(...)— Test if the address is otherwise IETF reserved.IPv6Interface.is_site_local(...)— Test if the address is reserved for site-local.IPv6Interface.is_unspecified(...)—IPv6Interface.is_unspecifiedmethod/property.IPv6Interface.packed(...)— The binary representation of this address.IPv6Interface.reverse_pointer(...)— The name of the reverse DNS pointer for the IP address, e.g.: >>> ipaddress.ip_address("127.0.0.1").reverse_pointer '1.0.0.127.in-addr.arpa'IPv6Interface.scope_id(...)— Identifier of a particular zone of the address's scope.IPv6Interface.sixtofour(...)— Return the IPv4 6to4 embedded address.IPv6Interface.teredo(...)— Tuple of embedded teredo IPs.IPv6Interface.with_hostmask(...)—IPv6Interface.with_hostmaskmethod/property.IPv6Interface.with_netmask(...)—IPv6Interface.with_netmaskmethod/property.IPv6Interface.with_prefixlen(...)—IPv6Interface.with_prefixlenmethod/property.
Usage
import ipaddress
iface = ipaddress.IPv6Interface("2001:db8::1/64")
assert str(iface.network) == "2001:db8::/64"
Gotchas
- Represents a host IPv6 address + prefix length.
REPL Inspect
from ipaddress import IPv6Interface
help(IPv6Interface)
Linked from
Related notes
- tuts/python3/stdlib_module/ipaddress/IPv6Address Linked here; links to this page; shared tags: #ipaddress, #stdlib
- tuts/python3/stdlib_module/ipaddress/IPv6Network Linked here; links to this page; shared tags: #ipaddress, #stdlib
- tuts/python3/stdlib_module/ipaddress Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/ipaddress/AddressValueError Linked here; shared tags: #ipaddress, #stdlib
- tuts/python3/stdlib_module/ipaddress/collapse_addresses Linked here; shared tags: #ipaddress, #stdlib
- tuts/python3/stdlib_module/ipaddress/get_mixed_type_key Linked here; shared tags: #ipaddress, #stdlib
- tuts/python3/stdlib_module/ipaddress/ip_address Linked here; shared tags: #ipaddress, #stdlib
- tuts/python3/stdlib_module/ipaddress/ip_interface shared tags: #ipaddress, #stdlib
- tuts/python3/stdlib_module/ipaddress/ip_network shared tags: #ipaddress, #stdlib
- tuts/python3/stdlib_module/ipaddress/IPv4Address shared tags: #ipaddress, #stdlib