Skip to content

Commit 3ad2cf7

Browse files
Add community to prefixes, which must be dropped.
1 parent 9f5209e commit 3ad2cf7

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

dockers/docker-fpm-quagga/bgpd.conf.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,14 @@ route-map FROM_PEER_V6 permit 10
150150
!
151151
{% if allow_list_enabled %}
152152
route-map ALLOW_LIST_V4 {{ allow_list_default_action }} 65535
153+
{% if allow_list_default_action.strip() == 'permit' %}
154+
set community {{ allow_list_drop_prefix }} additive
155+
{% endif %}
153156
!
154157
route-map ALLOW_LIST_V6 {{ allow_list_default_action }} 65535
158+
{% if allow_list_default_action.strip() == 'permit' %}
159+
set community {{ allow_list_drop_prefix }} additive
160+
{% endif %}
155161
!
156162
ip prefix-list ALLOW_ADDRESS_ALLOW_ALL_V4 seq 10 permit any
157163
!

files/image_config/asn/deployment_id_asn_map.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ deployment_id_asn_map:
33

44
allow_list_enabled: true
55
allow_list_default_action: permit # or deny
6+
allow_list_drop_prefix: 5060:12345 # value of the community to identify a prefix to drop. Make sense only with allow_list_default_action equal to 'permit'

src/sonic-config-engine/tests/sample_output/bgpd_quagga.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ route-map FROM_PEER_V6 permit 1
6565
route-map FROM_PEER_V6 permit 10
6666
!
6767
route-map ALLOW_LIST_V4 permit 65535
68+
set community 5060:12345 additive
6869
!
6970
route-map ALLOW_LIST_V6 permit 65535
71+
set community 5060:12345 additive
7072
!
7173
ip prefix-list ALLOW_ADDRESS_ALLOW_ALL_V4 seq 10 permit any
7274
!

0 commit comments

Comments
 (0)