Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am not much of a network person, but I understand that (IPv4) addresses can be written in a format like 127.0.0.1/16. I tried reading through Wikipedia's IPv4 subnetting reference, Subnetwork and CIDR_notation - but it's way too much detail than I need.

I, essentially, don't need to understand CIDR notation for now - all I want is a command line tool, where I can type something like 127.0.0.1/16, and see what addresses it matches.

Is there a command line tool I can use for the purpose?

share|improve this question
up vote 1 down vote accepted

Try out ipcal available on, and from this webpage: http://www.jodies.de/ipcalc

share|improve this answer
    
Many thanks for that, @Squeezy - ipcalc looks like a fine Perl script, latest version currently seems to be ipcalc-0.41; cheers! – sdaau Jan 30 '14 at 10:07
1  
Mate, where have you been the last 10 months? :D – Squeezy Feb 3 '14 at 20:13

Well, searching through the Net, I accidentally found this:

It is a Python script, so I simply renamed it when I downloaded it, and used it like so:

$ wget http://brandon.sternefamily.net/files/cidr.txt -O cidr.py
$ python cidr.py 127.0.0.1/30
127.0.0.0
127.0.0.1
127.0.0.2
127.0.0.3

Would love to hear if there's anything else in existence that works like this...

Well, hope this helps someone,
Cheers!


EDIT: original link seems to be gone, here is archive: http://web.archive.org/web/20100307140430/http://brandon.sternefamily.net/files/cidr.txt

share|improve this answer

you need prips:

$ prips 127.0.0.0/16

be careful it's going to print 65536 lines:

$ prips 127.0.0.0/16 | wc -l
65536

BTW: 127.0.0.1 is an incorrect input, as it is a host in a range, but you must specify a network. Use ipcalc to get a network:

$ ipcalc -b 127.0.0.1/16

Address: 127.0.0.1
Netmask: 255.255.0.0 = 16
Wildcard: 0.0.255.255
=> Network: 127.0.0.0/16
HostMin: 127.0.0.1
HostMax: 127.0.255.254
Broadcast: 127.0.255.255
Hosts/Net: 65534 Class A, Loopback

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .