ipaddress.IPv4Network.is_reserved

is_reserved

ipaddress.IPv4Network.is_private

is_private

ipaddress.IPv4Network.is_multicast

is_multicast

ipaddress.IPv4Network.is_loopback

is_loopback

ipaddress.IPv4Network.is_link_local

is_link_local These attributes are true for the network as a whole if they are true for both the network address and the broadcast address

ipaddress.IPv4Network.hosts()

hosts() Returns an iterator over the usable hosts in the network. The usable hosts are all the IP addresses that belong to the network, except the network address itself and the network broadcast address. >>> list(ip_network('192.0.2.0/29').hosts()) [IPv4Address('192.0.2.1'), IPv4Address('192.0.2.2'), IPv4Address('192.0.2.3'), IPv4Address('192.0.2.4'), IPv4Address('192.0.2.5'), IPv4Address('192.0.2.6')]

ipaddress.IPv4Network.hostmask

hostmask The host mask, as a string.

ipaddress.IPv4Network.exploded

exploded A string representation of the network, with the mask in prefix notation. with_prefixlen and compressed are always the same as str(network). exploded uses the exploded form the network address.

ipaddress.IPv4Network.compressed

compressed

ipaddress.IPv4Network.compare_networks()

compare_networks(other) Compare this network to other. In this comparison only the network addresses are considered; host bits aren’t. Returns either -1, 0 or 1. >>> ip_network('192.0.2.1/32').compare_networks(ip_network('192.0.2.2/32')) -1 >>> ip_network('192.0.2.1/32').compare_networks(ip_network('192.0.2.0/32')) 1 >>> ip_network('192.0.2.1/32').compare_networks(ip_network('192.0.2.1/32')) 0