IP to authoritative CIDR webservices

Hi,

Does anyone know of a webservice that converts a given IP into the
public CIDR range that belongs to? I am developing a tool where IP to
CIDR conversion based on RIR whois data would be useful for implementing
filtersets.

William

WHOIS?

Alternatively, use the Team Cymru tool to find the AS, then the CIDR Report
portal to determine all perfixes originated by the AS in question:

http://asn.cymru.com/
http://www.cidr-report.org/

Apologies if you are seeking other magic...

- - ferg

Hi,

Hi,

You might could modify the CyberAbuse Whois (zcw) client[1] to also
output CIDR information. It already outputs range information, so
shouldn't be hard to add CIDR support to what it displays. I'll contact
the author to see if he could add that, as it would be a useful feature
for all.

~reed

[1] http://www.cyberabuse.org/whois/

This is very easy to parse, though not a "web service":

ftp://ftp.ripe.net/pub/stats/ripencc/RIR-Statistics-Exchange-Format.txt

james

For the record, the prefix you find here will be the prefix our BGP view
(from peers around the globe) sees that IP announced as, which is not
necessarily the same as the RIR allocated prefix. And you can find full
details of all of the access methods for this service here:

http://www.team-cymru.org/Services/ip-to-asn.html

Please make note of the notice at the top of the page regarding use in
software, applications, and devices - if we have advance notice we can
make sure we're not going to accidentally block you or your users, but
only if you get in touch with us first. :slight_smile:

Thanks,
Tim Wilde

- --
Tim Wilde, Senior Software Engineer, Team Cymru, Inc.
twilde@cymru.com | +1-630-230-5433 | http://www.team-cymru.org/

Hi William,

.-- My secret spy satellite informs me that at Mon, 14 Dec 2009, William Pitcock wrote:

Does anyone know of a webservice that converts a given IP into the
public CIDR range that belongs to? I am developing a tool where IP to
CIDR conversion based on RIR whois data would be useful for implementing
filtersets.

Earlier this week, BGPmon.net made their webservices API (using SOAP) available
for everyone. There are several functions that you might find useful.

One of the functions available is getIpInfo(), which will return the best match
prefix for an IPv4 or IPv6 address/prefix. This is based on BGP data (so not
IRR data). It will also provide the OriginAS, AS description and country code
for the prefix.

There's also a whois interface that implements this getIpInfo() webservice.
It's similar to rishwois and the Team Cymru IP to AS whois interface.

$ whois -h whois.bgpmon.net 142.231.1.1
Prefix: 142.231.1.0/24
Country code: CA
Origin AS: 271
Origin AS Name: BCNET-AS - BCnet

Or for easy parsing :
$ whois -h whois.bgpmon.net " -m 2001::dead:beef"
BGP Prefix|CC|Origin AS| Origin AS Name
2001::/32|unknown|12637|SEEWEB Seeweb Srl
2001::/32|unknown|25525|REASONNET-AS Reasonnet IP Networks B.V. number
2001::/32|unknown|6939|HURRICANE - Hurricane Electric, Inc.
2001::/32|unknown|12859|NL-BIT BIT BV
2001::/32|unknown|21155|ASN-PROSERVE ProServe B.V. Networks
2001::/32|unknown|1257|TELE2
2001::/32|unknown|1741|FUNETAS FUNET autonomous system
2001::/32|unknown|29259|DE-IABG-TELEPORT IABG Teleport, DE
2001::/32|unknown|29432|TREX-AS TREX Tampere Region Exchange Oy

For more information please see:
http://bgpmon.net/blog/?p=213
http://bgpmon.net/bgpmonapi.php

Cheers,
Andree

there's also the lightish weight routeviews DNS zone data:
$ host -W 6 -R 10 -t txt 50.35.2.128.asn.routeviews.org
50.35.2.128.asn.routeviews.org descriptive text "9" "128.2.0.0" "16"

128.2.35.50 lives in 128.2.0.0/16 from ASN9

-chris
(thanks to joe/joel/dmm and capitan kemp)