All ArticlesDevOps2026-11-20T16:24:09+08:00

Is Your Prefix Safe from BGP Hijacks? Verify RPKI ROA Status Step by Step

Network operators often assume their IP prefixes are protected from hijacks and leaks without confirming that valid ROAs exist and that upstream providers drop RPKI-invalid routes. After reading, you will be able to check your ROA coverage, max-length settings, and route validation state yourself using public validators and looking glasses.

You announced your prefix, created a ROA months ago, and moved on. Traffic flows, no alerts fire, everything looks fine. Then one day a portion of your users can't reach you, or worse, traffic silently routes through an AS that has no business touching your prefix. You check and discover your ROA was never valid, or it existed but your upstream doesn't enforce RPKI validation at all. The protection you assumed was there never actually worked.

This walkthrough traces through the diagnostic steps: confirming a ROA exists, checking whether it covers the right prefix length, and verifying that the networks between you and your users actually drop RPKI-invalid routes.

What RPKI and ROAs actually protect against

RPKI (Resource Public Key Infrastructure) lets the holder of an IP prefix cryptographically authorize specific Autonomous Systems (ASes) to originate that prefix in BGP. The authorization object is called a ROA — Route Origin Authorization. When a network performs ROV (Route Origin Validation), it checks incoming BGP announcements against published ROAs. If someone else announces your prefix and no ROA authorizes their AS, the route is marked "RPKI Invalid." Networks that enforce ROV then prefer valid routes and drop invalid ones.

Critical distinction: a ROA existing does not mean anyone enforces it. ROAs are published in RPKI repositories. Enforcement happens at the router level of every network that chooses to do ROV. Your ROA is half the equation. Upstream enforcement is the other half.

Step 1: Check whether a ROA exists for your prefix

Start with a public validator. Several are available; two widely used ones:

  • Cloudflare's RPKI toolkit at rpki.cloudflare.com — enter your prefix and origin AS.
  • RIPE's RPKI Validator / RIPEstat — search for your prefix at stat.ripe.net and look at the "RPKI" or "Routing Status" widget.

What you're looking for: a result that says your prefix + your origin AS = Valid. Not "Unknown" (no ROA found), not "Invalid" (ROA exists but doesn't match your announcement).

# If you run routinator locally (NLnet Labs RPKI relying party software):
routinator vrps --filter-prefix 203.0.113.0/24

Sample output format:

ASN,IP Prefix,Max Length,Trust Anchor
AS64500,203.0.113.0/24,24,apnic

If this returns nothing, no ROA covers your prefix. You are unprotected. Any AS can originate your prefix and no ROV-enforcing network will reject it on RPKI grounds — because there's nothing to validate against.

Step 2: Verify the max-length setting

This is where many operators get burned. A ROA doesn't just say "AS64500 can announce 203.0.113.0/24." It also specifies a max-length — the longest prefix length that AS is authorized to announce from within that block.

If your ROA for 203.0.113.0/24 has max-length set to /24, then only a /24 announcement from your AS is valid. If you later deaggregate and announce 203.0.113.0/25 and 203.0.113.128/25 (two /25s), those more-specific announcements become RPKI Invalid because /25 exceeds the max-length of /24. Networks doing ROV will drop them.

The reverse problem is also dangerous. Setting max-length to /32 (for IPv4) means your ROA authorizes your AS to announce any specificity down to a single host route. That's technically valid, but it also means a hijacker who announces a more-specific like 203.0.113.128/25 from your AS number (via a leak or misconfiguration) would also be considered valid. Overly permissive max-length weakens protection.

Rule of thumb: set max-length to exactly the prefix lengths you actually announce. If you announce a /24 and nothing more specific, max-length should be /24. If you also announce two /25s, set it to /25. Many security-focused recommendations (including guidance from NIST and various NOG communities) advise against setting max-length longer than what you operationally need.

Check your current max-length in the routinator output or in the RIPEstat RPKI widget. Compare it against what you actually announce in BGP.

Step 3: Confirm your BGP announcement matches the ROA

A ROA can be perfectly configured but your actual BGP announcement might not match. Common mismatches:

  • Wrong origin AS. You created the ROA for AS64500 but your router announces the prefix with AS64501 (maybe after a merger, renumbering, or misconfigured route-map). Result: RPKI Invalid.
  • Announcing a prefix length not covered. ROA covers 203.0.113.0/24 with max-length /24, but your router announces 203.0.113.0/23 (a less-specific aggregate). The /23 is not covered by a ROA for /24. Result: Unknown (not Invalid, but not Valid either — no protection).
  • Stale ROA after IP transfer. You acquired a prefix block from another organization. The old ROA still points to their AS. Your announcement from your AS is now Invalid.

To see what you're actually announcing, check a route collector. RIPE RIS Looking Glass (stat.ripe.net, "BGP Looking Glass" or "Routing Status") shows the origin AS and prefix length as seen by their collectors worldwide. Compare that against your ROA.

Step 4: Check whether your upstream actually enforces ROV

This is the part most people skip. Your ROA can be perfect, but if your transit provider and the networks your traffic crosses don't perform ROV, an RPKI-invalid hijack announcement still propagates and steals traffic.

There's no single authoritative list of which networks enforce ROV, because operators enable and disable it on their own schedules. However, you can test it:

  1. Cloudflare's "Is BGP Safe Yet?" page (isbgpsafeyet.com) tests whether your current ISP or transit drops known RPKI-invalid test prefixes. It works by checking reachability to prefixes that are deliberately announced with invalid RPKI status. If you can reach them, your path to those prefixes does not enforce ROV.

  2. Ask your transit provider directly. In your next NOC call or contract review, ask whether they perform ROV and whether they drop RPKI-invalid routes or merely deprioritize them. "Deprioritize" (lower local-pref) is weaker than "drop" — a deprioritized invalid route can still win if no valid alternative exists.

  3. Check looking glasses of major transit networks. Many large networks publish looking glasses where you can query a prefix and see the validation state. If a looking glass shows your prefix as "Valid," that network's validators see your ROA. If it shows "Unknown," they either don't have your ROA cached or aren't running validation.

If your upstream doesn't enforce ROV, your ROA still has value — other networks that do enforce ROV will reject hijack attempts from their perspective. But the protection is partial. The more networks along the path that enforce ROV, the harder a hijack becomes.

Step 5: Watch for ROA expiration and repository issues

ROAs have validity periods. If your ROA expires and you don't renew it, your prefix status drops from Valid to Unknown. Depending on how you created the ROA (through your RIR's hosted RPKI service or a delegated CA), renewal may or may not be automatic.

Check your RIR portal periodically. APNIC, RIPE, ARIN, AFRINIC, and LACNIC each have their own RPKI management interface. Log in and verify:

  • ROA is listed and not expired.
  • The prefix, origin AS, and max-length still match your operational reality.
  • No stale ROAs exist for prefixes you no longer hold or ASes you no longer use.

RPKI repository outages can also temporarily affect validation. If the repository your ROA is published in becomes unreachable, some validators may treat your prefix as Unknown until the repository recovers. This is a known operational concern discussed in IETF's RFC 7115 ("Origin Validation Operation Based on the Resource Public Key Infrastructure") and subsequent operational guidance.

When the symptom is traffic loss, not a hijack alert

A common pattern in support: a network operator deaggregates a prefix for traffic engineering, forgets to update the ROA max-length, and suddenly a chunk of users can't reach them. No hijack occurred. The operator hijacked themselves — their own more-specific announcement became RPKI Invalid, and ROV-enforcing networks dropped it. The /25s vanish from those networks' routing tables while the covering /24 (if still announced) continues to work, causing partial reachability loss that's maddening to debug without checking RPKI status first.

If you see partial reachability issues — some users fine, others can't connect — and you recently changed your BGP announcements, check RPKI validation status before digging into MTU, firewall, or DNS. It might be your own ROA rejecting your own routes.

For related diagnostic approaches when BGP issues affect traffic, see Suspect a BGP Route Leak Hit Your IPv6 Traffic? Verify With RIPE RIS and traceroute6 for tracing route leak symptoms using public collectors.

Practical takeaway

ROA creation is not a set-and-forget task. Verify three things regularly: the ROA exists and hasn't expired, the max-length matches exactly what you announce (no wider), and at least your direct upstream performs ROV and drops invalid routes. Public tools like RIPEstat, Cloudflare's RPKI portal, and isbgpsafeyet.com make all three checks possible without special access. Run them after any change to your BGP announcements, after IP transfers, and on a periodic schedule. The five minutes it takes to verify beats the hours spent debugging mysterious partial reachability loss caused by your own stale ROA.