[plug] subnetworking help

Jason Nicholls jason at mindsocket.com.au
Fri Dec 21 06:12:02 WST 2001


On Thu, Dec 20, 2001 at 11:01:17AM +0800, BaRT wrote:
> I need to split a C class into some subnets a /25 /27 and a /29. How do I
> work out the netmasks Bcast, and how many hosts will be in each subnet. Iv
> had a look at the IP-subnetworking howto and I still dont understand.

Grab a copy of this perl script:

	http://jason.mindsocket.com.au/linux/misc/network.pl


Example output (these 2 runs produce the same output):

[jason at thinker jason] network.pl 192.168.1.10/24
       IP: 192.168.1.10
           11000000101010000000000100001010 

     MASK: 255.255.255.0 (24 bits)
           11111111111111111111111100000000 

  NETWORK: 192.168.1.0 (256 ip addresses)
           11000000101010000000000100000000 

BROADCAST: 192.168.1.255
           11000000101010000000000111111111 

[jason at thinker jason] network.pl 192.168.1.10/255.255.255.0
       IP: 192.168.1.10
           11000000101010000000000100001010 

     MASK: 255.255.255.0 (24 bits)
           11111111111111111111111100000000 

  NETWORK: 192.168.1.0 (256 ip addresses)
           11000000101010000000000100000000 

BROADCAST: 192.168.1.255
           11000000101010000000000111111111 


Later,

Jason Nicholls
--------------------------------------------------------------------
Jason Nicholls    icq: 11745841    email: <jason at mindsocket.com.au>
Proprietor                        mobile: 0417 410 811
Mind Socket [web services]          http://www.mindsocket.com.au/
--------------------------------------------------------------------



More information about the plug mailing list