This BGP AS path parser breaks an AS path into its segments and ASNs, counts the length the way best-path selection does, and flags prepending, loops and private or reserved ASNs. It runs entirely in your browser: nothing you type is sent to our server.
Loading the tool… It runs in your browser and needs JavaScript.
Table of Contents
How the length is counted
- Each ASN in an AS_SEQUENCE counts 1, including repeated (prepended) ASNs.
- An AS_SET { } counts 1 no matter how many ASNs it holds. RFC 9774 (2025) deprecates AS_SETs.
- Confederation segments ( ) count 0.
ASN ranges to watch
| Range | Meaning |
|---|---|
| 64512-65534, 4200000000-4294967294 | Private (RFC 6996): must not appear on the internet |
| 64496-64511, 65536-65551 | Documentation (RFC 5398) |
| 23456 | AS_TRANS: a 4-byte ASN seen by an old 2-byte speaker |
| 0, 65535, 4294967295 | Reserved |
as-path regular expressions
Cisco as-path regexes use _ for a delimiter (space, start, end, braces or comma). ^65001_ matches routes received from AS65001, _174$ routes originated by AS174, ^$ routes originated in your own AS. Test them here before using them in ip as-path access-list.
How we checked it
We tested the parser on 11-12 October 2026 with paths containing prepends, an AS_SET, a confederation segment, a loop and asdot ASNs, and checked the regex tester with start, end and middle-of-path patterns.
Frequently asked questions
How is AS path length calculated in BGP?
Each ASN in the sequence counts one, including prepends; an AS_SET counts one; confederation segments count zero.
What is AS path prepending?
Adding your own ASN several times to make a path look longer, so other networks prefer another path to you.
How do I convert asdot to asplain?
Multiply the part before the dot by 65,536 and add the part after it: 1.10 = 65,546.