I am BGP peering with a Juniper OS router. When starting the connection, my system advertises 4-byte ASN capability, which is accepted by the Juniper router:
Jul 28 00:33:00.664202 BGP RECV 4 Byte AS-Path capability (65), as_num 55002
Jul 28 00:33:00.664217 bgp_parse_4byte_aspath_cap():273 AS4-Peer (RECV): 4 byte AS capability received, AS 55002
Jul 28 00:33:00.664296 bgp_4byte_aspath_add_cap():199 AS4-Peer 10.17.206.131 (Internal AS 55002)(SEND): 4 byte AS capability added, AS 55002
The Juniper router sends back that 4-byte ASN capability:
Jul 28 00:33:00.664405 BGP SEND 4 Byte AS-Path capability (65), as_num 55002
So I think it is safe to say that the two peers have established 4-byte ASN support.
Later on, we try to send a BGP UPDATE message, which includes the mp_reach_nlri attribute. If we send the BGP UPDATE message with a 2-octet AS/4-octet AN Extended Community attribute (ie, type 0x00, Transitive 2-Octet AS-Specific), Juniper router happily accepts. If we send the BGP UPDATE message with a 4-octet AS/2-octet AN Extended Community attribute (ie, type 0x00, Transitive 4-octet AS-Specific), Juniper router complains and rejects it due to "rejected due to the lack of a valid target community".
bgp_rcv_nlri: 64999:0:22.214.171.124/96 rejected due to the lack of a valid target community
Take a look at the two pcap screenshots below. The ONLY difference in communication between the two peers is this single issue: 4-byte AS in the mp_reach_nlri packet, vs 2-byte AS in the mp_reach_nlri packet. The first image is working, the second is not.
Any clues why this is? How can we successfully send a mp_reach_nlri path attribute with a 4-byte AS as the target community?
Junos version information:
JUNOS OS Kernel 64-bit [20180310.ba55661_builder_stable_10]
My router: proprietary; trying to craft our own packets for this BGP peering session
Junos show bgp neighbor:
Peer: 10.17.206.131+37333 AS 55002 Local: 10.17.205.45+179 AS 55002
Type: Internal State: Established Flags: <Sync RSync>
Peer supports 4 byte AS extension (peer-as 55002)