New: Post-Quantum Cryptography tools — is your domain quantum-safe? Check now

BGP Looking Glass

Query global BGP routing sessions by CIDR prefix. See route announcements, AS paths, communities and peer locations worldwide.

IPv4 or IPv6 CIDR notation (e.g. 8.8.8.0/24)

About BGP Looking Glass

What is a BGP Looking Glass?

A BGP (Border Gateway Protocol) Looking Glass is a diagnostic tool that allows network engineers and security researchers to observe live BGP routing sessions from multiple vantage points around the world. BGP is the protocol that governs how packets are routed across the internet between autonomous systems (AS), making it fundamental to internet infrastructure.

How to Use This Tool

Enter a CIDR prefix (e.g., 8.8.8.0/24 for Google's DNS servers) to see all BGP routing sessions announcing that prefix. You can optionally filter by ASN to see only sessions from or excluding a specific autonomous system. Results include the AS path, origin type, BGP communities, and the geographic location of each route collector.

Key Concepts

  • CIDR Prefix: A network address with subnet mask in slash notation (e.g., 192.168.0.0/16).
  • ASN (Autonomous System Number): A unique identifier assigned to each network that participates in BGP routing.
  • AS Path: The list of ASNs a route traverses to reach its destination — shorter paths are generally preferred.
  • BGP Communities: Tags attached to routes to control routing policy, often used for traffic engineering.
  • Origin types: IGP (internal), EGP (external legacy), or Incomplete (redistributed from another protocol).

Use Cases

  • Verify that a new IP prefix is being announced and propagated globally after a network change.
  • Investigate BGP route hijacking incidents by identifying unexpected ASNs announcing your prefix.
  • Debug BGP peering issues and verify route advertisement from specific autonomous systems.
  • Research internet topology and understand how traffic flows between global networks.

BGP Looking Glass: Understanding Border Gateway Protocol Routing

Border Gateway Protocol (BGP, RFC 4271) is the inter-domain routing protocol that forms the backbone of the internet, connecting thousands of Autonomous Systems (AS) and enabling IP routing between them. A BGP Looking Glass server is a publicly accessible router that allows network engineers and researchers to query BGP routing tables from the perspective of a specific network location — without direct access to that router. Looking glass queries let you see which AS paths are advertised for a prefix, verify route propagation, and troubleshoot routing anomalies.

Each internet-connected organization is assigned an Autonomous System Number (ASN) by a Regional Internet Registry (RIR) such as ARIN, RIPE NCC, APNIC, LACNIC, or AFRINIC. BGP routers exchange routing information in the form of BGP UPDATE messages containing prefixes (IP address ranges) and path attributes. The AS_PATH attribute lists the sequence of ASNs a route has traversed — this is what allows BGP to detect routing loops and select optimal paths. Other important attributes include NEXT_HOP (the next-hop router IP), LOCAL_PREF (preference within an AS), MED (metric for external BGP), and COMMUNITY (policy tags for route filtering and traffic engineering).

BGP route selection follows a complex decision process (best-path algorithm): routes are evaluated by weight, local preference, AS path length, origin type (IGP > EGP > Incomplete), MED, eBGP vs iBGP preference, IGP metric to next-hop, and router-ID as a tiebreaker. Route leaks (accidentally advertising routes outside their intended scope) and BGP hijacks (maliciously or accidentally announcing another AS's prefixes) are major security concerns. Route Origin Authorizations (ROAs) and RPKI (Resource Public Key Infrastructure) are the modern solution for verifying that an ASN is authorized to announce a given prefix.

Looking glass servers support commands like "show bgp ipv4 unicast <prefix>", "show ip route <address>", and "show bgp summary". These are invaluable for verifying that your AS is announcing the correct prefixes, checking if a route is visible from remote locations, and diagnosing BGP convergence issues after a network change.

CLI BGP Analysis

macOS / Linux

# Trace BGP AS path using traceroute
traceroute -A 8.8.8.8

# Use whois to find ASN for an IP
whois -h whois.cymru.com " -v 8.8.8.8"

# Query BGP data via RIPE STAT API
curl "https://stat.ripe.net/data/bgp-state/data.json?resource=AS15169"

# Check prefix announcements
curl "https://stat.ripe.net/data/announced-prefixes/data.json?resource=AS15169"

Windows PowerShell

# Query BGP data from RIPE STAT
Invoke-RestMethod "https://stat.ripe.net/data/bgp-state/data.json?resource=AS15169" | ConvertTo-Json

# Traceroute with ASN resolution (requires tracert)
tracert 8.8.8.8