Pcornel
Networking · Network & Protocols › BGP Protocol Reference

BGP AS_PATH & Community Field Reference

Cheat sheet · https://pcornel.dk/topic.php?topic=296

Back to the Topic

Answer

AS_PATH is encoded as segments (AS_SEQUENCE or AS_SET) of AS numbers. Communities are 32-bit tags written as AS:value, and large communities are 96-bit tags written as AS:value:value so they fit 4-byte AS numbers.

First checks

  • show bgp ipv4 unicast <prefix> — AS path and communities
  • show ip bgp regexp <regex> — match AS paths
  • show bgp ipv4 unicast community <comm> — match community

Commands

ip as-path access-list
show ip bgp
ip bgp-community new-format

Verify in this order

UPDATE → AS_PATH/COMMUNITY attributes → policy match → best path

Where it usually breaks

underlay/interface reachability → protocol adjacency/session → received/originated state → policy → best path/RIB → FIB/adjacency → traffic path

BGP AS_PATH & Community Field Reference packet-level operational reference

Wire boundaryKnown-good for BGP AS_PATH & Community Field ReferenceSuspicious signatureNext proof
Message identityCorrect peer/direction/type and coherent lengthsWrong sender, type, length or packet phasePacket sequence + peer state
Field semanticspath-attribute flags/type/length; AS_PATH segment type/count/ASN sequence; standard Community values; Large Community Global Administrator/Local Data parts where present match intended protocol stateAS_PATH prepends appear on the wrong neighbor or direction, four-octet ASN display/encoding is misread, community propagation is absent because send-community behavior is missing, a route-map matches the wrong community set, Large Community and standard-community namespaces are confused, or attributes arrive correctly but higher-priority best-path inputs dominateDecode exact fields on both sides
State consequencePacket produces expected protocol/route transitionWire looks healthy but local state disagreesFSM/LSDB/BGP table → RIB/FIB
ClosureOriginal workload succeeds for the explained reasonSession/adjacency recovered only transientlyRepeat capture + regression/failover test

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=296

Confirmation

Confirm action

Continue?