March 2019
Beginner
490 pages
12h 40m
English
In the ipaddress module, a convenient class is used to represent an interface's IP configuration in detail. The IPv6 interface class lets you extract the IPv6Address and IPv6Network objects from a single instance:
>>> eth0 = ipaddress.IPv6Interface('2001:db8::/48') >>> eth0.ip IPv6Address('2001:db8::') >>> eth0.with_prefixlen '2001:db8::/48' >>> eth0.with_netmask '2001:db8::/ffff:ffff:ffff::' >>> eth0.network IPv6Network('2001:db8::/48') >>> eth0.is_private True >>> eth0.is_reserved False >>> eth0.is_multicast False >>> eth0.is_link_local False >>> eth0.is_global False
As you can see, a network interface, eth0, with the IPv6Address class has been defined. It has some interesting properties, such as IP and network ...
Read now
Unlock full access