Last active
November 26, 2019 14:21
-
-
Save dusekdan/ebee9d0368ac5ce7663f2ee2479fa65b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ips_in_net(ip='192.168.1.8', subnet='255.255.255.0'): | |
from ipaddress import ip_address, ip_network | |
hosts = list(ip_network(f"{ip}/{subnet}", strict=False).hosts()) | |
return [f"{host}" for host in hosts] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment