1.3.2

Rating:        Based on 3 ratings
Reviewed:  3 reviews
Downloads: 2483
Change Set: 88551
Released: Apr 22, 2014
Updated: Apr 22, 2014 by LukeSkywalker
Dev status: Stable Help Icon

Recommended Download

Application IPNetwork-1.3.2.zip
application, 130K, uploaded Apr 22, 2014 - 2483 downloads

Release Notes

IPNetwork utility command line

IPNetwork utility command line take care of complex network, ip, netmask,
subnet, cidr calculation for command line. It works with IPv4,
it is written in C# and has a light and clean API and is fully unit tested.

Console application usage

Usage: ipnetwork [-inmcbflu] [-d cidr|-D] [-h|-s cidr|-S|-w|-W|-x|-C network|-o network] networks ...

Print options
        -i : network
        -n : network address
        -m : netmask
        -c : cidr
        -b : broadcast
        -f : first usable ip address
        -l : last usable ip address
        -u : number of usable ip addresses
        -t : number of ip addresses

Parse options
        -d cidr : use cidr if not provided (default /32)
        -D      : use default cidr (ClassA/8, ClassB/16, ClassC/24)

Actions
        -h         : help message
        -s cidr    : split network into cidr subnets
        -w         : supernet networks into smallest possible subnets
        -W         : supernet networks into one single subnet
        -x         : list all ipadresses in networks
        -C network : network contain networks
        -o network : network overlap networks

networks  : one or more network addresses
            (1.2.3.4 10.0.0.0/8 10.0.0.0/255.0.0.0 ...)


Example 1

Display ipnetwork informations :

c:\> ipnetwork 10.0.0.0/8

IPNetwork   : 10.0.0.0/8
Network     : 10.0.0.0
Netmask     : 255.0.0.0
Cidr        : 8
Broadcast   : 10.255.255.255
FirstUsable : 10.0.0.1
LastUsable  : 10.255.255.254
Usable      : 16777214
Total       : 16777216


Example 2

Split network into cidr

c:\> ipnetwork -s 9 10.0.0.0/8

IPNetwork   : 10.0.0.0/9
Network     : 10.0.0.0
Netmask     : 255.128.0.0
Cidr        : 9
Broadcast   : 10.127.255.255
FirstUsable : 10.0.0.1
LastUsable  : 10.127.255.254
Usable      : 8388606
Total       : 8388608
--
IPNetwork   : 10.128.0.0/9
Network     : 10.128.0.0
Netmask     : 255.128.0.0
Cidr        : 9
Broadcast   : 10.255.255.255
FirstUsable : 10.128.0.1
LastUsable  : 10.255.255.254
Usable      : 8388606
Total       : 8388608


Example 3

supernet networks into smallest possible subnets

C:\>ipnetwork -w 192.168.0.0/24 192.168.1.0/24

IPNetwork   : 192.168.0.0/23
Network     : 192.168.0.0
Netmask     : 255.255.254.0
Cidr        : 23
Broadcast   : 192.168.1.255
FirstUsable : 192.168.0.1
LastUsable  : 192.168.1.254
Usable      : 510
Total       : 512


Example 4

supernet networks into smallest possible subnets

c:\> ipnetwork -w 192.168.0.0/24 192.168.2.0/24 

IPNetwork   : 192.168.0.0/24
Network     : 192.168.0.0
Netmask     : 255.255.255.0
Cidr        : 24
Broadcast   : 192.168.0.255
FirstUsable : 192.168.0.1
LastUsable  : 192.168.0.254
Usable      : 254
Total       : 256
--
IPNetwork   : 192.168.2.0/24
Network     : 192.168.2.0
Netmask     : 255.255.255.0
Cidr        : 24
Broadcast   : 192.168.2.255
FirstUsable : 192.168.2.1
LastUsable  : 192.168.2.254
Usable      : 254
Total       : 256


Example 5

supernet networks into smallest possible subnets

C:\>ipnetwork -W 192.168.0.0/24 192.168.129.0/24
IPNetwork   : 192.168.0.0/16
Network     : 192.168.0.0
Netmask     : 255.255.0.0
Cidr        : 16
Broadcast   : 192.168.255.255
FirstUsable : 192.168.0.1
LastUsable  : 192.168.255.254
Usable      : 65534
Total       : 65536


Example 6

Split network into cidr, display full network only

C:\>ipnetwork -i -s 12 10.0.0.0/8 | grep -v \-\-

IPNetwork   : 10.0.0.0/12
IPNetwork   : 10.16.0.0/12
IPNetwork   : 10.32.0.0/12
IPNetwork   : 10.48.0.0/12
IPNetwork   : 10.64.0.0/12
IPNetwork   : 10.80.0.0/12
IPNetwork   : 10.96.0.0/12
IPNetwork   : 10.112.0.0/12
IPNetwork   : 10.128.0.0/12
IPNetwork   : 10.144.0.0/12
IPNetwork   : 10.160.0.0/12
IPNetwork   : 10.176.0.0/12
IPNetwork   : 10.192.0.0/12
IPNetwork   : 10.208.0.0/12
IPNetwork   : 10.224.0.0/12
IPNetwork   : 10.240.0.0/12

Reviews for this release

     
Excellent library. Well coded. Everything I need to do network calculations. Thanks
by houdelou on Mar 27, 2015 at 5:47 PM
     
Great utility! Such a timesaver!. I am using in a MSSQL CLR and am it's working great!
by dbirchak on Jun 1, 2014 at 4:18 AM
     
Does everything you could possibly want! Problem is, I can't get it to work in a VB.NET project... :)
by BogusException on May 13, 2014 at 3:24 AM