- A perl script to create an IPv4 netmask table...

Once upon a time, way back in the 1980s, I put an IPv4 netmask table together that took off and seems to be copied and published all over the net now. (Just google "pozar" and "netmasks".) Back then I hand built this table. A friend wanted an expanded table to any size netmask. Instead of hand coding this again, I wrote this perl script.

Just change the "$base_netmask_size" to what ever you want it to start out on and refernce as a the "base" netmask that is subnetting. For instance a /28 would look like...

Netmask /28 (11111111111111111111111111110000)
There are 1 subnets in a /28 to

Netmask /29 (11111111111111111111111111111000)
There are 2 subnets in a /28 to to

Netmask /30 (11111111111111111111111111111100)
There are 4 subnets in a /28 to to to to
Suggestions welcomed, flames devnulled.