CIDR Ranges for Everything except RFC1918
Solution 1:
Let me show my working here...
You need a minimal number of CIDR blocks to cover:
0.0.0.0-9.255.255.255
11.0.0.0-172.15.255.255
172.32.0.0-192.167.255.255
192.169.0.0-223.255.255.255
To turn these ranges into minimal CIDR blocks, you can just use netmask
(the swiss army knife of addressing), like so:
$ netmask -c 0.0.0.0:9.255.255.255
0.0.0.0/5
8.0.0.0/7
$ netmask -c 11.0.0.0:172.15.255.255
11.0.0.0/8
12.0.0.0/6
16.0.0.0/4
32.0.0.0/3
64.0.0.0/2
128.0.0.0/3
160.0.0.0/5
168.0.0.0/6
172.0.0.0/12
$ netmask -c 172.32.0.0:192.167.255.255
172.32.0.0/11
172.64.0.0/10
172.128.0.0/9
173.0.0.0/8
174.0.0.0/7
176.0.0.0/4
192.0.0.0/9
192.128.0.0/11
192.160.0.0/13
$ netmask -c 192.169.0.0:223.255.255.255
192.169.0.0/16
192.170.0.0/15
192.172.0.0/14
192.176.0.0/12
192.192.0.0/10
193.0.0.0/8
194.0.0.0/7
196.0.0.0/6
200.0.0.0/5
208.0.0.0/4
Hey presto, Bob's your Auntie's live-in lover.
Solution 2:
Bogon space, and non-bogon space CIDR blocks are available in the bogon report:
http://www.cidr-report.org/bogons/
Solution 3:
I have no idea what you're planning on using this for, but here you go:
http://bgp.potaroo.net/as2.0/bgptable.txt
Just a total dump of the BGP routing table.
Solution 4:
Yes. You are looking for the IANA IPv4 Address Space Registry.
The IPv4 Address that are on the Internet are the ones who start of with one of the numbers what are Allocated in that table.