Sunday, July 17, 2011

IP Subnet Calculator In debian.

I'm talking about console based application that able to ip subnets calculator. You have to use following command to install it;

sudo apt-get install ipcalc


How to use;

ipcalc [ip address] [mask]

You can use both format for mask part. like this:

example 1;


ismail@ismail-laptop:~/Desktop/swap$ ipcalc 172.16.40.85/24
Address: 172.16.40.85 10101100.00010000.00101000. 01010101
Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000
Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111
=>
Network: 172.16.40.0/24 10101100.00010000.00101000. 00000000
HostMin: 172.16.40.1 10101100.00010000.00101000. 00000001
HostMax: 172.16.40.254 10101100.00010000.00101000. 11111110
Broadcast: 172.16.40.255 10101100.00010000.00101000. 11111111
Hosts/Net: 254 Class B, Private Internet



or



ismail@ismail-laptop:~/Desktop/swap$ ipcalc 172.16.40.85 255.255.255.0
Address: 172.16.40.85 10101100.00010000.00101000. 01010101
Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000
Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111
=>
Network: 172.16.40.0/24 10101100.00010000.00101000. 00000000
HostMin: 172.16.40.1 10101100.00010000.00101000. 00000001
HostMax: 172.16.40.254 10101100.00010000.00101000. 11111110
Broadcast: 172.16.40.255 10101100.00010000.00101000. 11111111
Hosts/Net: 254 Class B, Private Internet



If you have a C class network address and you want to create 4 subNet, actually your mask is 24.

2 exp. 2 = 4

So 24-2 = 22 is your new subnet..



ismail@ismail-laptop:~/Desktop/swap$ ipcalc 172.16.40.85/22
Address: 172.16.40.85 10101100.00010000.001010 00.01010101
Netmask: 255.255.252.0 = 22 11111111.11111111.111111 00.00000000
Wildcard: 0.0.3.255 00000000.00000000.000000 11.11111111
=>
Network: 172.16.40.0/22 10101100.00010000.001010 00.00000000
HostMin: 172.16.40.1 10101100.00010000.001010 00.00000001
HostMax: 172.16.43.254 10101100.00010000.001010 11.11111110
Broadcast: 172.16.43.255 10101100.00010000.001010 11.11111111
Hosts/Net: 1022 Class B,Class B, Private Internet

No comments:

Post a Comment

Thanks