Quantcast
Channel: All Routing posts
Viewing all articles
Browse latest Browse all 8688

Re: how to delete regular communities

$
0
0

Hello,

This is pretty easy if You remember how JUNOS evaluates communities (hint-they are treated as strings):

 

Community regular expressions evaluate the string specified in term on a 
character-by-character basis

https://www.juniper.net/documentation/en_US/junos/topics/usage-guidelines/policy-defining-bgp-communities-and-extended-communities-for-use-in-routing-policy-match-conditions.html

 

So, if You recall that regular communities are essentially "1-to-5 decimal digits {colon} 1-to-5 decimal digits " strings, then You need to define Your regular community as

 

set policy-options community std members "^[0-9]{1,5}:[0-9]{1,5}"

Lab verification:

regress@VMX> show configuration routing-instances 
TEST {
    instance-type vrf;
    route-distinguisher 169.254.3.242:3;
    vrf-import remove-std;
    vrf-export vrf-export;
    vrf-table-label;
}

regress@VMX> show configuration policy-options policy-statement remove-std 
term 1 {
    from community [ std test ];
    then {
        community delete std;
        next term;
    }
}
term 2 {
    from community test;
    then accept;
}

regress@VMX> show configuration policy-options | grep members            
community std members "^[0-9]{1,5}:[0-9]{1,5}";
community test members target:65000:3;

And the route in question is 198.51.100.3/32.

regress@VMX> show route receive-protocol bgp 169.254.0.252 table bgp.l3vpn.0 extensive 198.51.100.3/32

bgp.l3vpn.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
* 169.254.3.231:3:198.51.100.3/32 (1 entry, 0 announced)
     Import Accepted
     Route Distinguisher: 169.254.3.231:3
     VPN Label: 16
     Nexthop: 169.254.3.231
     Localpref: 100
     AS path: I (Originator)
     Cluster list:  169.254.0.252
     Originator ID: 169.254.3.231
     Communities: 65000:65000 target:65000:3 bandwidth:65000:200

regress@VMX> show route table TEST.inet.0 198.51.100.3/32 detail | grep commun                       
                Communities: target:65000:3 bandwidth:65000:200 
^
|
+--- regular community 65000:65000 missing!

HTH

Thx
Alex

 

 


Viewing all articles
Browse latest Browse all 8688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>