[bgp] Enable BGP Graceful Restart based on device role (#9486)

What I did:
Updated Jinja Template to enable BGP Graceful Restart based on device role. By default it will be enable only if the device role type is TorRouter.

Why I did:-
By default FRR is configured in Graceful Helper mode. Graceful Restart is needed on T0/TorRouter only since the device can go for warm-reboot. For T1/LeafRouter it need to be in Helper mode only
This commit is contained in:
abdosi 2021-12-13 10:14:50 -08:00 committed by Abhishek Dosi
parent db5b9ee834
commit 9138423b3e
8 changed files with 9 additions and 13 deletions

View File

@ -52,7 +52,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
bgp bestpath as-path multipath-relax bgp bestpath as-path multipath-relax
{% endif %} {% endif %}
! !
{% if constants.bgp.graceful_restart.enabled is defined and constants.bgp.graceful_restart.enabled %} {% if constants.bgp.graceful_restart.enabled is defined and constants.bgp.graceful_restart.enabled and DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %}
bgp graceful-restart restart-time {{ constants.bgp.graceful_restart.restart_time | default(240) }} bgp graceful-restart restart-time {{ constants.bgp.graceful_restart.restart_time | default(240) }}
bgp graceful-restart bgp graceful-restart
bgp graceful-restart preserve-fw-state bgp graceful-restart preserve-fw-state

View File

@ -3,7 +3,8 @@
"localhost": { "localhost": {
"hostname": "new_hostname", "hostname": "new_hostname",
"bgp_asn": "55555", "bgp_asn": "55555",
"sub_role": "FrontEnd" "sub_role": "FrontEnd",
"type": "ToRRouter"
} }
}, },
"LOOPBACK_INTERFACE": { "LOOPBACK_INTERFACE": {

View File

@ -2,7 +2,8 @@
"DEVICE_METADATA": { "DEVICE_METADATA": {
"localhost": { "localhost": {
"bgp_asn": "55555", "bgp_asn": "55555",
"sub_role": "FrontEnd" "sub_role": "FrontEnd",
"type": "ToRRouter"
} }
}, },
"LOOPBACK_INTERFACE": { "LOOPBACK_INTERFACE": {

View File

@ -2,7 +2,8 @@
"DEVICE_METADATA": { "DEVICE_METADATA": {
"localhost": { "localhost": {
"bgp_asn": "55555", "bgp_asn": "55555",
"sub_role": "FrontEnd" "sub_role": "FrontEnd",
"type": "ToRRouter"
} }
}, },
"LOOPBACK_INTERFACE": { "LOOPBACK_INTERFACE": {

View File

@ -3,7 +3,8 @@
"localhost": { "localhost": {
"bgp_asn": "55555", "bgp_asn": "55555",
"hostname": "test_hostname", "hostname": "test_hostname",
"sub_role": "FrontEnd" "sub_role": "FrontEnd",
"type": "ToRRouter"
} }
}, },
"INTERFACE": { "INTERFACE": {

View File

@ -45,9 +45,6 @@ router bgp 65100
! !
bgp bestpath as-path multipath-relax bgp bestpath as-path multipath-relax
! !
bgp graceful-restart restart-time 240
bgp graceful-restart
bgp graceful-restart preserve-fw-state
! !
bgp router-id 8.0.0.5 bgp router-id 8.0.0.5
! !

View File

@ -45,9 +45,6 @@ router bgp 65100
! !
bgp bestpath as-path multipath-relax bgp bestpath as-path multipath-relax
! !
bgp graceful-restart restart-time 240
bgp graceful-restart
bgp graceful-restart preserve-fw-state
! !
bgp router-id 10.1.0.32 bgp router-id 10.1.0.32
! !

View File

@ -26,8 +26,6 @@ router bgp 4000 vrf VnetFE
bgp log-neighbor-changes bgp log-neighbor-changes
bgp bestpath as-path multipath-relax bgp bestpath as-path multipath-relax
no bgp default ipv4-unicast no bgp default ipv4-unicast
bgp graceful-restart restart-time 240
bgp graceful-restart
bgp router-id 4.0.0.0 bgp router-id 4.0.0.0
neighbor 192.168.0.1 remote-as 3000 neighbor 192.168.0.1 remote-as 3000
neighbor 192.168.0.1 description Leaf01 neighbor 192.168.0.1 description Leaf01