Pages

Tuesday, June 28, 2011

Calculating Subnets in Linux

Here are some Linux tools that can calculate subnets

 ipcalc
~$ ipcalc 192.168.2.1/28
Address:   192.168.2.1          11000000.10101000.00000010.0000 0001
Netmask:   255.255.255.240 = 28 11111111.11111111.11111111.1111 0000
Wildcard:  0.0.0.15             00000000.00000000.00000000.0000 1111
=>
Network:   192.168.2.0/28       11000000.10101000.00000010.0000 0000
HostMin:   192.168.2.1          11000000.10101000.00000010.0000 0001
HostMax:   192.168.2.14         11000000.10101000.00000010.0000 1110
Broadcast: 192.168.2.15         11000000.10101000.00000010.0000 1111
Hosts/Net: 14                    Class C, Private Internet


sipcalc
~$ sipcalc 192.168.2.1/28
-[ipv4 : 192.168.2.1/28] - 0

[CIDR]
Host address        - 192.168.2.1
Host address (decimal)    - 3232236033
Host address (hex)    - C0A80201
Network address        - 192.168.2.0
Network mask        - 255.255.255.240
Network mask (bits)    - 28
Network mask (hex)    - FFFFFFF0
Broadcast address    - 192.168.2.15
Cisco wildcard        - 0.0.0.15
Addresses in network    - 16
Network range        - 192.168.2.0 - 192.168.2.15
Usable range        - 192.168.2.1 - 192.168.2.14


-

No comments: