-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added some filter examples for too many BGP Communities
- Loading branch information
1 parent
f7632f0
commit 55a15c7
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Number of BGP communities | ||
|
||
## Purpose | ||
|
||
BGP Communities can give a lot of information about a prefix, for example where your BGP peer learned the prefix. As BGP Communities also consume router memory it is suggested to delete the BGP communities if too many of them are attached to a prefix. | ||
|
||
## Configuration | ||
|
||
=== "Cisco IOS" | ||
In Cisco IOS it is not possible to only delete BGP Communities from a prefix when there are more than a specific number attached. You can filter prefixes with eg. >=100 BGP Communities, but then your router won't have a route to the filtered prefix if you do not have a default route. | ||
``` | ||
router bgp 64500 | ||
bgp maxcommunity-limit 99 | ||
bgp maxextcommunity-limit 99 | ||
``` | ||
|
||
If you do not want to loose any routes because of too many attached BGP Communities you could also remove all BGP Communities from the prefixes coming from your peer. | ||
``` | ||
ip community-list expanded ALL-COMMUNITIES permit .* | ||
! | ||
route-map BGP_FILTER_IN permit 100 | ||
set comm-list ALL-COMMUNITIES delete | ||
set extcomm-list ALL-COMMUNITIES delete | ||
! | ||
router bgp 64500 | ||
neighbor 198.51.100.1 route-map BGP_FILTER_IN in | ||
``` | ||
|
||
=== "Cisco IOS XR" | ||
In Cisco IOS XR it is not possible to only delete BGP Communities from a prefix when there are more than a specific number attached. You can filter prefixes with eg. >=100 BGP Communities, but then your router won't have a route to the filtered prefix if you do not have a default route. | ||
``` | ||
router bgp 64500 | ||
bgp maxcommunity-limit 99 | ||
bgp maxextcommunity-limit 99 | ||
``` | ||
|
||
If you do not want to loose any routes because of too many attached BGP Communities you could also remove all BGP Communities from the prefixes coming from your peer. | ||
``` | ||
ip community-list expanded ALL-COMMUNITIES permit .* | ||
! | ||
route-map BGP_FILTER_IN permit 100 | ||
set comm-list ALL-COMMUNITIES delete | ||
set extcomm-list ALL-COMMUNITIES delete | ||
! | ||
router bgp 64500 | ||
neighbor 198.51.100.1 route-map BGP_FILTER_IN in | ||
``` | ||
|
||
=== "Juniper JunOS" | ||
In this example all BGP Communities are removed from a prefix when >= 100 BGP Communities are attached. | ||
``` | ||
policy-options { | ||
community ALL-COMMUNITIES members [ *:* origin:*:* large:*:*:* ]; | ||
policy-statement BGP_FILTER_IN { | ||
term delete-too-many-communities { | ||
from community-count 100 orhigher; | ||
then { | ||
community delete ALL-COMMUNITIES; | ||
} | ||
} | ||
} | ||
``` | ||
|
||
=== "Arista EOS" | ||
In this example all BGP Communities are removed from a prefix when >= 100 BGP Communities are attached. | ||
``` | ||
route-map BGP_FILTER_IN permit 100 | ||
match community instances >= 100 | ||
set community none | ||
! | ||
``` | ||
|