When a BGP speaker receives a L3VPN prefix which target community is mismatch with local configured, then the prefixes are rejected due to lack of a valid target community and the route is not installed.
Topology:
CE1<---->PE1<---->P<---->PE2<---->CE2
PE1 target is configured as 4-byte AS format.
#set routing-instances vpn1 vrf-target target:65001L:101
PE2 target is configured as normal format(2-bytes).
#set routing-instances vpn1 vrf-target target:65001:101
About BGP community explanation refre below link:
https://www.juniper.net/documentation/us/en/software/junos/routing-policy/topics/concept/policy-defining-bgp-communities-and-extended-communities-in-routing-policy-match-conditions.html
On PE check receive route from peer device, there is no any output.
user@PE1>show route receive-protocol bgp 192.168.1.1 table vpn1.inet.0 vpn1.inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
Enable bgp traceoption and clear bgp neighbor:
#set protocols bgp traceoptions file bgp-trace #set protocols bgp traceoptions file size 100m #set protocols bgp traceoptions flag all user@PE1>clear bgp neighbor 192.168.1.1 Cleared 1 connections
The L3VPN prefix is received but does not get installed in the RIB and the reason of reject is "lack of a valid target community".
user@PE1>show log jw-bgp | match communit Jun 25 09:31:20.042913 BGP SEND flags 0xc0 code Extended Communities(16): 202:65001L:101 Jun 25 09:31:20.246931 BGP RECV flags 0xc0 code Extended Communities(16): 2:65001:101 Jun 25 09:31:20.247140 bgp_rcv_nlri: 192.168.0.2:101:10.101.0.0/80 rejected due to the lack of a valid target community Jun 25 09:31:20.247150 bgp_rcv_nlri: 192.168.0.2:101:10.101.0.0/88 rejected due to the lack of a valid target community
Check target community configuration on all PE devices and make sure they are same.