BGP Route Lookup - origin AS, AS paths and RPKI check
BGP Route Lookup & Looking Glass
Find the BGP route covering any IPv4/IPv6 address or prefix, its origin AS, AS paths seen by RIPE RIS route collectors, upstream ASNs and RPKI (ROA) validity. Look up the prefixes announced by an AS, or validate a prefix/origin pair against RPKI.
Data: RIPEstat Data API / RIPE NCC Routing Information Service (RIS); GeoIP: MaxMind GeoLite via RIPEstat. Queries go directly from your browser to stat.ripe.net. The data is not real-time: looking-glass paths are typically minutes old, routing status, visibility and announced prefixes come from RIS dumps taken every 8 hours, and RPKI results reflect RIPEstat’s validator cache. Results are cached in this page for the session; please do not hammer the API.
What this BGP lookup tool does
When a packet leaves your network for an address such as 8.8.8.8, every router along the way picks a next hop based on the routes it learned through the Border Gateway Protocol (BGP). This tool lets you see the same picture from the outside: which prefix on the Internet covers an address, which Autonomous System (AS) originates it, how the route propagates (AS paths) to dozens of independent networks peering with the RIPE NCC route collectors, and whether the announcement is cryptographically authorised by RPKI. It is a browser-only looking glass in the spirit of bgpstuff.net, built on top of the public RIPEstat Data API – nothing is installed and nothing about your query is stored by this blog.
How a BGP route lookup works
1. Longest-prefix match
Routers forward traffic using the most specific (longest) prefix that contains the destination. The tool therefore first asks RIPEstat for the most specific prefix seen in the global table that covers your address. If you type a prefix, the covering announced prefix is returned – that may be the same prefix, or a shorter aggregate if your block is not announced on its own. Private (RFC 1918), CGNAT, documentation and other special-purpose ranges are recognised locally and never appear in the global table.
2. Origin AS and AS path
The AS_PATH attribute lists the autonomous systems a route has crossed; the right-most AS is the origin, the AS that injected the prefix into BGP. Reading a path such as 3356 15169 from left to right tells you that a RIS peer learned the route from AS3356 (Lumen), which learned it from the origin AS15169 (Google). Repeated ASNs, like 64500 64500 64500, are AS-path prepending, a traffic-engineering trick to make a path look longer and less preferred; the tool shows them as ×N. The AS immediately left of the origin is its adjacent (upstream or peer) AS on that path – counting those across many vantage points gives a quick view of how a network connects to the Internet.
3. Route collectors and visibility
The RIPE NCC Routing Information Service runs route collectors (RRC00, RRC01 … RRC26) at Internet exchange points and as multihop collectors. Hundreds of networks feed them full or partial BGP tables. Visibility is the share of RIS full-table peers that carry a route: a healthy, well-connected prefix is seen by nearly 100 % of them; low visibility may mean filtering (for example RPKI-invalid drops), a too-specific prefix, or a route that is only partially propagated.
4. RPKI and Route Origin Validation
The Resource Public Key Infrastructure (RFC 6480) lets the holder of an address block publish signed Route Origin Authorizations (ROAs): “prefix P up to length maxLength may be originated by AS X”. RFC 6811 defines how a router validates a route against those ROAs:
- Valid – at least one ROA covers the prefix, its ASN equals the route’s origin AS, and the prefix length is ≤ maxLength.
- Invalid – ROAs cover the prefix but none matches: either the origin AS is wrong (invalid ASN, typical of a hijack or misconfiguration) or the announcement is more specific than maxLength allows (invalid length, typical of a leaked more-specific or a forgotten ROA update).
- NotFound / unknown – no ROA covers the prefix at all. The route is treated normally by most networks.
Many large transit and access networks now drop RPKI-invalid routes, so an invalid status usually means reduced reachability.
Worked examples
Example 1: 8.8.8.8 (Google Public DNS)
Looking up 8.8.8.8 returns the covering route 8.8.8.0/24 originated by AS15169 GOOGLE - Google LLC. RPKI status is valid: a ROA authorises AS15169 for 8.8.8.0/24 with maxLength 24. At the time of writing every IPv4 RIS full-table peer saw the prefix, and the paths are very short (often just <peer> 15169) because Google peers directly with many networks. The routing status also shows less-specific covering routes such as 8.0.0.0/9 originated by AS3356, which would carry traffic if the /24 disappeared. Validating 8.8.8.0/25 with origin AS15169 in the RPKI tab returns invalid (length), because the ROA’s maxLength is 24.
Query 8.8.8.8 Prefix 8.8.8.0/24 Origin AS15169 GOOGLE - Google LLC RPKI valid (ROA 8.8.8.0/24, maxLength 24, AS15169) AS path e.g. 3356 15169 (Lumen -> Google)
Example 2: 1.1.1.1 (Cloudflare DNS)
1.1.1.1 resolves to 1.1.1.0/24, origin AS13335 CLOUDFLARENET, RPKI valid (ROA maxLength 24). Try the RPKI tab with 1.1.1.0/24 and origin AS64500 (a documentation ASN): the result is invalid (ASN) – exactly what a router doing Route Origin Validation would see if someone tried to hijack the prefix.
Example 3: 2606:4700:4700::1111 (IPv6)
For the IPv6 address 2606:4700:4700::1111 the covering route is 2606:4700:4700::/48, again originated by AS13335 and RPKI valid with a /48 ROA. Note that /48 is the longest IPv6 prefix most networks accept from the global table, just as /24 is for IPv4 – so you will rarely find more specific announcements than these.
Frequently asked questions
- Is this a real-time BGP looking glass?
- Not exactly. AS paths come from RIPEstat’s looking-glass data call, built from the RIS route collectors’ current state, usually only minutes old. Visibility, routing history and the list of announced prefixes are based on RIS table dumps taken every eight hours. For second-by-second updates use RIS Live or a router-based looking glass.
- What does “origin AS” mean?
- It is the last AS in the AS_PATH – the network that originated the BGP announcement for the prefix. A prefix seen with more than one origin (MOAS) can be legitimate (anycast, DDoS scrubbing) or a sign of a hijack; the tool lists all origins and validates each with RPKI.
- Why do I get no route for 10.1.2.3 or 192.168.1.1?
- Those are private-use addresses (RFC 1918) and are never routed on the public Internet, so no route collector carries them. The tool detects private, CGNAT, loopback, link-local, documentation and multicast ranges before sending any query.
- What is the difference between RPKI “invalid” and “unknown”?
- “Invalid” means a ROA exists for the address space but does not authorise this origin AS or this prefix length, and many networks will drop the route. “Unknown” (NotFound in RFC 6811) simply means no ROA covers the prefix; such routes are accepted normally.
- Are the “upstream ASNs” really transit providers?
- They are the ASNs observed directly in front of the origin in AS paths seen by RIS peers. That includes transit providers but also settlement-free peers, because a RIS peer that peers with the origin passes on the route too. Use the ASN tab’s neighbour counts for a longer-term view.
- Can I share a result?
- Yes. The address bar is updated with the query, for example
#ip=8.8.8.8,#asn=15169or#prefix=8.8.8.0/24&origin=15169; open that link and the lookup runs automatically.
Comments
Post a Comment