Skip to content

Instantly share code, notes, and snippets.

Last active November 26, 2019 14:21
What would you like to do?
def ips_in_net(ip='', subnet=''):
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