Sunday, April 27, 2008

Calculating Subnets with ipcalc and sipcalc Utilities

Supported features include:

=> Multiple address and netmask input formats.
=> Retrieving of address information from interfaces.
=> Classfull and CIDR output.
=> Multiple address and netmask output formats (dotted quad, hex, number of bits).
=> Output of broadcast address, network class, Cisco wildcard, hosts/range, network range.
=> Output of multiple types of bitmaps.
=> Output of a user-defined number of extra networks.
=> Multiple networks input from commandline.
=> DNS resolutions of hostnames.
=> Compressed and expanded input addresses.
=> Compressed and expanded output.
=> Standard IPv6 network output.
=> v4 in v6 output.
=> Reverse dns address generation.
=> The ability to "split" a network based on a smaller netmask, also with recursive runs on the generated subnets.

[a] ipcalc takes an IP and netmask and calculates the resulting broadcast, network, Cisco wildcard mask, and host range. By giving a second netmask, you can design sub- and supernetworks. It is also intended to be a teaching tool and presents the results as easy to understand binary values.

[b] sipcalc is also an ip subnet calculator consisting of two parts. A plain text based console version, and web (cgi) based counterpart. Sipcalc, in it’s simplest form takes an IP and a subnet mask on the command line and outputs info about the subnet. It supports IP v4/v6 address.

$ ipcalc 192.168.0.1/24

Address:   192.168.0.1          11000000.10101000.00000000. 00000001
Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000
Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111
=>
Network: 192.168.0.0/24 11000000.10101000.00000000. 00000000
HostMin: 192.168.0.1 11000000.10101000.00000000. 00000001
HostMax: 192.168.0.254 11000000.10101000.00000000. 11111110
Broadcast: 192.168.0.255 11000000.10101000.00000000. 11111111
Hosts/Net: 254 Class C, Private Internet

$ sipcalc 192.168.0.1/24

-[ipv4 : 192.168.0.1/24] - 0

[CIDR]
Host address - 192.168.0.1
Host address (decimal) - 3232235521
Host address (hex) - C0A80001
Network address - 192.168.0.0
Network mask - 255.255.255.0
Network mask (bits) - 24
Network mask (hex) - FFFFFF00
Broadcast address - 192.168.0.255
Cisco wildcard - 0.0.0.255
Addresses in network - 256
Network range - 192.168.0.0 - 192.168.0.255
Usable range - 192.168.0.1 - 192.168.0.254

$ sipcalc 192.168.0.1 255.255.128.0 255.255.192.0

-[ipv4 : 192.168.0.1 255.255.128.0] - 0

[CIDR]
Host address - 192.168.0.1
Host address (decimal) - 3232235521
Host address (hex) - C0A80001
Network address - 192.168.0.0
Network mask - 255.255.128.0
Network mask (bits) - 17
Network mask (hex) - FFFF8000
Broadcast address - 192.168.127.255
Cisco wildcard - 0.0.127.255
Addresses in network - 32768
Network range - 192.168.0.0 - 192.168.127.255
Usable range - 192.168.0.1 - 192.168.127.254

-
-[ipv4 : 255.255.192.0] - 0

[CIDR]
Host address - 255.255.192.0
Host address (decimal) - 4294950912
Host address (hex) - FFFFC000
Network address - 255.255.192.0
Network mask - 255.255.255.255
Network mask (bits) - 32
Network mask (hex) - FFFFFFFF
Broadcast address - 255.255.192.0
Cisco wildcard - 0.0.0.0
Addresses in network - 1
Network range - 255.255.192.0 - 255.255.192.0

#Display results as HTML

$ ipcalc -h 192.168.0.1/255.255.128.0

$ man ipcalc
$ man sipcalc

No comments: