Given input is 192.168.3.78/27
Input can be any Class C ip address, The above ip is tried for example
expected output should display all the ips from 192.168.3.65
to 192.168.3.94
as below
192.168.3.65
192.168.3.66
192.168.3.67
...
...
192.168.3.94
>>> for x in ipaddress.ip_network('192.168.3.78/27'):
print(x)
Traceback (most recent call last):
File "<pyshell#31>", line 1, in <module>
for x in ipaddress.ip_network('192.168.3.78/27'):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\ipaddress.py", line 74, in ip_network
return IPv4Network(address, strict)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\ipaddress.py", line 1536, in __init__
raise ValueError('%s has host bits set' % self)
ValueError: 192.168.3.78/27 has host bits set