Posts with the tag IP Networks

Using the ipaddress module that comes with Python3.3+

from ipaddress import IPv4Network, IPv6Network

a = IPv4Network('192.168.0.0/24')
b = IPv4Network('192.168.1.0/24')
c = IPv4Network('127.0.0.1')

x = IPv6Network('2000::/64')
y = IPv6Network<span...

Read on

Determining Local IPv4 and IPv6 Addresses On Mac OS X Via The Command Line

Getting IPv4 and IPv6 addresses of your local machine on Mac OS X 10.8 Mountain Lion is quite easy. Here is how it works:

IF='en0' # ← restrict to wired connection or do  IF=""  to get all
# Get local IPv4 addresses (without...

Read on

IP Address Analysis Using Python

Find out more about IP addresses (IPv4 and IPv6) using the Python module IPy:

#!/usr/bin/env python

from IPy import IP

ip_s = raw_input('Please enter an IP address or range: ')
try:
    i =...

Read on