Skip to content

Instantly share code, notes, and snippets.

@jayers99
Last active February 13, 2019 20:39
Show Gist options
  • Save jayers99/b87941d8b9e31fa5fcd57300f34a0b82 to your computer and use it in GitHub Desktop.
Save jayers99/b87941d8b9e31fa5fcd57300f34a0b82 to your computer and use it in GitHub Desktop.
python network calculator fun
# Is this network contained in this other network
import ipaddress
rule = ipaddress.IPv4Network('10.19.252.0/24')
net = ipaddress.IPv4Network('10.19.252.16/29')
rule.overlaps(net)
net = ipaddress.IPv4Network('10.19.253.16/29')
rule.overlaps(net)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment