Mapping IP addresses to AS numbers and countries

When network engineers analyze log files, collect packets or observe traceroute data, they sometimes want to know the AS that announces a given IP address. This information can be extracted from BGP routing tables to by using services such as RIPE RIS or RouteViews. There is now an interesting alternative with the website that provides both files containing the mappings between IP addresses and AS numbers and an API to retrieve this mapping.

The API is easy to use on the command line and returns a JSON object which can easily be parsed.

{"announced":true,"as_country_code":"US","as_description":"QUAD9-AS-1 - Quad9","as_number":19281,"first_ip":"","ip":"","last_ip":""}

This blog post was written to inform the readers of Computer Networking: Principles, Protocols and Practice about the evolution of the field. You can subscribe to the Atom feed for this blog. These notes are also posted on the e-book Facebook page

Written on September 26, 2019