Wadah Belajar Linux, Debian, Mikrotik, Networking, Routing, dan Ilmu Pendukungnya

< Browse > Home / Linux, Networking, script / Blog article: About IPCALC

| Mobile | RSS

About IPCALC

October 23rd, 2008 | No Comments | Posted in Linux, Networking, script

- To see the ipcalc version available:
#apt-cache policy ipcalc
ipcalc:
Installed: (none)
Candidate: 0.41-1
Version table:
0.41-1 0
500 ftp://kambing.ui.edu stable/main Packages

- To install ipcalc
#apt-get install ipcalc

- To see the ipcalc dependencies:
ipcalc
Depends: perl

- USAGE
Let’s say that you’ve been assigned the 192.168.0.0 address to work with. Your first subnet will only have 125 active hosts. To find out what your subnet configuration would be, invoke ipcalc with the -s option switch.

#ipcalc -s 125 192.168.0.0
Address: 192.168.0.0 11000000.10101000.00000000. 00000000
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

1. Requested size: 125 hosts
Netmask: 255.255.255.128 = 25 11111111.11111111.11111111.1 0000000
Network: 192.168.0.0/25 11000000.10101000.00000000.0 0000000
HostMin: 192.168.0.1 11000000.10101000.00000000.0 0000001
HostMax: 192.168.0.126 11000000.10101000.00000000.0 1111110
Broadcast: 192.168.0.127 11000000.10101000.00000000.0 1111111
Hosts/Net: 126 Class C, Private Internet

Needed size: 128 addresses.
Used network: 192.168.0.0/25
Unused:
192.168.0.128/25

You now have all of the information you need to set up your subnet, including the range of available IP addresses for your hosts, subnet mask, broadcast address, etc.
If you want to set up more than one subnet, enter the number of hosts you want on each subnet after a single -s switch.

#ipcalc -s 125 125 125 192.168.1.0
Address: 192.168.1.0 11000000.10101000.00000001. 00000000
Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000
Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111
=>
Network: 192.168.1.0/24 11000000.10101000.00000001. 00000000
HostMin: 192.168.1.1 11000000.10101000.00000001. 00000001
HostMax: 192.168.1.254 11000000.10101000.00000001. 11111110
Broadcast: 192.168.1.255 11000000.10101000.00000001. 11111111
Hosts/Net: 254 Class C, Private Internet

1. Requested size: 125 hosts
Netmask: 255.255.255.128 = 25 11111111.11111111.11111111.1 0000000
Network: 192.168.1.0/25 11000000.10101000.00000001.0 0000000
HostMin: 192.168.1.1 11000000.10101000.00000001.0 0000001
HostMax: 192.168.1.126 11000000.10101000.00000001.0 1111110
Broadcast: 192.168.1.127 11000000.10101000.00000001.0 1111111
Hosts/Net: 126 Class C, Private Internet

2. Requested size: 125 hosts
Netmask: 255.255.255.128 = 25 11111111.11111111.11111111.1 0000000
Network: 192.168.1.128/25 11000000.10101000.00000001.1 0000000
HostMin: 192.168.1.129 11000000.10101000.00000001.1 0000001
HostMax: 192.168.1.254 11000000.10101000.00000001.1 1111110
Broadcast: 192.168.1.255 11000000.10101000.00000001.1 1111111
Hosts/Net: 126 Class C, Private Internet

3. Requested size: 125 hosts
Netmask: 255.255.255.128 = 25 11111111.11111111.11111111.1 0000000
Network: 192.168.2.0/25 11000000.10101000.00000010.0 0000000
HostMin: 192.168.2.1 11000000.10101000.00000010.0 0000001
HostMax: 192.168.2.126 11000000.10101000.00000010.0 1111110
Broadcast: 192.168.2.127 11000000.10101000.00000010.0 1111111
Hosts/Net: 126 Class C, Private Internet

Network is too small
Needed size: 384 addresses.
Used network: 192.168.1.0/23
Unused:

Oops, it looks like we made a slight error on this one. We tried to set up three 125-host subnets from our 192.168.0.0 network. That doesn’t work, since there are only enough host IP addresses to create two subnets.

#ipcalc -s 125 125 192.168.0.0
Address: 192.168.0.0 11000000.10101000.00000000. 00000000
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

1. Requested size: 125 hosts
Netmask: 255.255.255.128 = 25 11111111.11111111.11111111.1 0000000
Network: 192.168.0.0/25 11000000.10101000.00000000.0 0000000
HostMin: 192.168.0.1 11000000.10101000.00000000.0 0000001
HostMax: 192.168.0.126 11000000.10101000.00000000.0 1111110
Broadcast: 192.168.0.127 11000000.10101000.00000000.0 1111111
Hosts/Net: 126 Class C, Private Internet

2. Requested size: 125 hosts
Netmask: 255.255.255.128 = 25 11111111.11111111.11111111.1 0000000
Network: 192.168.0.128/25 11000000.10101000.00000000.1 0000000
HostMin: 192.168.0.129 11000000.10101000.00000000.1 0000001
HostMax: 192.168.0.254 11000000.10101000.00000000.1 1111110
Broadcast: 192.168.0.255 11000000.10101000.00000000.1 1111111
Hosts/Net: 126 Class C, Private Internet

Needed size: 256 addresses.
Used network: 192.168.0.0/24
Unused:

For our next example, we’ve been assigned the 10.0.0.0 network, and we need one subnet with two hosts, one with 45 hosts, and one with 125 hosts.

#ipcalc -s 2 45 125 10.0.0.0
Address: 10.0.0.0 00001010.00000000.00000000. 00000000
Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000
Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111
=>
Network: 10.0.0.0/24 00001010.00000000.00000000. 00000000
HostMin: 10.0.0.1 00001010.00000000.00000000. 00000001
HostMax: 10.0.0.254 00001010.00000000.00000000. 11111110
Broadcast: 10.0.0.255 00001010.00000000.00000000. 11111111
Hosts/Net: 254 Class A, Private Internet

1. Requested size: 2 hosts
Netmask: 255.255.255.252 = 30 11111111.11111111.11111111.111111 00
Network: 10.0.0.192/30 00001010.00000000.00000000.110000 00
HostMin: 10.0.0.193 00001010.00000000.00000000.110000 01
HostMax: 10.0.0.194 00001010.00000000.00000000.110000 10
Broadcast: 10.0.0.195 00001010.00000000.00000000.110000 11
Hosts/Net: 2 Class A, Private Internet

2. Requested size: 45 hosts
Netmask: 255.255.255.192 = 26 11111111.11111111.11111111.11 000000
Network: 10.0.0.128/26 00001010.00000000.00000000.10 000000
HostMin: 10.0.0.129 00001010.00000000.00000000.10 000001
HostMax: 10.0.0.190 00001010.00000000.00000000.10 111110
Broadcast: 10.0.0.191 00001010.00000000.00000000.10 111111
Hosts/Net: 62 Class A, Private Internet

3. Requested size: 125 hosts
Netmask: 255.255.255.128 = 25 11111111.11111111.11111111.1 0000000
Network: 10.0.0.0/25 00001010.00000000.00000000.0 0000000
HostMin: 10.0.0.1 00001010.00000000.00000000.0 0000001
HostMax: 10.0.0.126 00001010.00000000.00000000.0 1111110
Broadcast: 10.0.0.127 00001010.00000000.00000000.0 1111111
Hosts/Net: 126 Class A, Private Internet

Needed size: 196 addresses.
Used network: 10.0.0.0/24
Unused:
10.0.0.196/30
10.0.0.200/29
10.0.0.208/28
10.0.0.224/27

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogosphere News
  • Live
  • MisterWong
  • MySpace
  • Ping.fm
  • Slashdot
  • StumbleUpon
  • Technorati
  • Print
  • email
Leave a Reply 1579 views, 3 so far today |

Related Posts

Leave a Reply




View My Stats