Skip to content

Commit

Permalink
[BGP]Introduce bgp update delay to control how long bgp stays in read…
Browse files Browse the repository at this point in the history
… only mode during init
  • Loading branch information
dgsudharsan committed Dec 11, 2024
1 parent c715dff commit b1cb18d
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ route-map HIDE_INTERNAL permit 20
!
{% endif %}
!
{% if constants.bgp.update_delay is defined %}
bgp update-delay {{ constants.bgp.update_delay }}
{% endif %}
!
{% if (DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('bgp_asn' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['bgp_asn'].lower() != 'none') and (DEVICE_METADATA['localhost']['bgp_asn'].lower() != 'null') %}
router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
!
Expand Down
1 change: 1 addition & 0 deletions files/image_config/constants/constants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ constants:
enabled: true
ipv4: 514
ipv6: 514
update_delay: 20
allow_list:
enabled: true
default_action: "permit" # or "deny"
Expand Down
2 changes: 2 additions & 0 deletions src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27
!
!
!
bgp update-delay 20
!
router bgp 65100
!
bgp log-neighbor-changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ route-map HIDE_INTERNAL permit 10
set community no-export
!
!
bgp update-delay 20
!
router bgp 65100
!
bgp log-neighbor-changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27
!
!
!
bgp update-delay 20
!
router bgp 65100
!
bgp log-neighbor-changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27
!
!
!
bgp update-delay 20
!
router bgp 65100
!
bgp log-neighbor-changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ route-map HIDE_INTERNAL permit 10
set community no-export
!
!
bgp update-delay 20
!
router bgp 65100
!
bgp log-neighbor-changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ route-map FROM_BGP_SPEAKER_V4 permit 10
!
route-map TO_BGP_SPEAKER_V4 deny 10
!
bgp update-delay 20
!
router bgp 65100
bgp log-neighbor-changes
bgp bestpath as-path multipath-relax
Expand Down
2 changes: 2 additions & 0 deletions src/sonic-config-engine/tests/sample_output/py2/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27
!
!
!
bgp update-delay 20
!
router bgp 65100
!
bgp log-neighbor-changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ ip prefix-list PL_LoopbackV4 permit 4.0.0.0/32
!
!
!
bgp update-delay 20
!
router bgp 4000
!
bgp log-neighbor-changes
Expand Down
2 changes: 2 additions & 0 deletions src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27
!
!
!
bgp update-delay 20
!
router bgp 65100
!
bgp log-neighbor-changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ route-map HIDE_INTERNAL permit 10
set community no-export
!
!
bgp update-delay 20
!
router bgp 65100
!
bgp log-neighbor-changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27
!
!
!
bgp update-delay 20
!
router bgp 65100
!
bgp log-neighbor-changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27
!
!
!
bgp update-delay 20
!
router bgp 65100
!
bgp log-neighbor-changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ route-map HIDE_INTERNAL permit 10
set community no-export
!
!
bgp update-delay 20
!
router bgp 65100
!
bgp log-neighbor-changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ route-map FROM_BGP_SPEAKER_V4 permit 10
!
route-map TO_BGP_SPEAKER_V4 deny 10
!
bgp update-delay 20
!
router bgp 65100
bgp log-neighbor-changes
bgp bestpath as-path multipath-relax
Expand Down
2 changes: 2 additions & 0 deletions src/sonic-config-engine/tests/sample_output/py3/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27
!
!
!
bgp update-delay 20
!
router bgp 65100
!
bgp log-neighbor-changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ ip prefix-list PL_LoopbackV4 permit 4.0.0.0/32
!
!
!
bgp update-delay 20
!
router bgp 4000
!
bgp log-neighbor-changes
Expand Down

0 comments on commit b1cb18d

Please sign in to comment.