Is there an easy way to map this IP address to the corresponding ASN? For example:
ping to find the IP address:
$ ping www.switch.ch PING aslan.switch.ch (130.59.108.36) 56(84) bytes of data.
whois is looking for an ASN number:
$ whois -h whois.cymru.com -v 130.59.108.36 Warning: RIPE flags used with a traditional server. AS | IP | BGP Prefix | CC | Registry | Allocated | AS Name 559 | 130.59.108.36 | 130.59.0.0/16 | CH | ripencc | 1993-09-22 | SWITCH SWITCH, Swiss Education and Research Network
Thus, the mapping in this case will be 130.59.108.36 (IP) β 559 (ASN). Easy. But what if I would like to create my own local mapping service with publicly available information from regional Internet registries? So, for the above example, this will be this list, right?
ftp://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-latest
And finding a matching entrie is also not a problem:
ripencc|CH|ipv4|130.59.0.0|65536|19930922|assigned
But how do I get the ASN number from the line above? How are these two information related?
ripencc|EU|asn|559|1|19930901|allocated
Thanks in advance for your reply!
bgp
Stephan berger
source share