Mar-06-2023, 01:23 AM
By "subnet base", do you meant the CIDR size or the subnet mask or something else?
Can do it with the netaddr module.
Can do it with the netaddr module.
>>> from netaddr import IPNetwork >>> n = IPNetwork("192.0.0.255/24") >>> n.network IPAddress('192.0.0.0')