Skip to content

Commit

Permalink
Modified the data-model for timers
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivani-gslab committed Nov 11, 2024
1 parent e8569b7 commit 3e2a026
Show file tree
Hide file tree
Showing 19 changed files with 129 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ router bgp 65101
update wait-install
no bgp default ipv4-unicast
no bgp default ipv4-unicast transport ipv6
timers bgp 5 35
timers bgp 10 15
distance bgp 20 200 200
graceful-restart restart-time 555
graceful-restart stalepath-time 666
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ ASN Notation: asplain
!
router bgp 65101
router-id 192.168.255.3
timers bgp min-hold-time 5 send-failure hold-time 65
no bgp default ipv4-unicast
distance bgp 20 200 200
graceful-restart restart-time 300
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ ASN Notation: asplain
!
router bgp 65101
router-id 192.168.255.3
timers bgp 0 0
no bgp default ipv4-unicast
distance bgp 20 200 200
graceful-restart restart-time 300
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ router bgp 65101
router-id 192.168.255.3
bgp default ipv4-unicast
bgp default ipv4-unicast transport ipv6
timers bgp min-hold-time 5
distance bgp 20 200 200
graceful-restart restart-time 300
graceful-restart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ ASN Notation: asdot
router bgp 65101.0001
bgp asn notation asdot
router-id 192.168.255.3
timers bgp send-failure hold-time 65
neighbor PG-1 peer group
neighbor PG-1 remote-as 65001.0002
neighbor PG-2 peer group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ router bgp 65101
update wait-install
no bgp default ipv4-unicast
no bgp default ipv4-unicast transport ipv6
timers bgp 5 35
timers bgp 10 15
distance bgp 20 200 200
graceful-restart restart-time 555
graceful-restart stalepath-time 666
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ interface Management1
!
router bgp 65101
router-id 192.168.255.3
timers bgp min-hold-time 5 send-failure hold-time 65
no bgp default ipv4-unicast
distance bgp 20 200 200
graceful-restart restart-time 300
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ interface Management1
!
router bgp 65101
router-id 192.168.255.3
timers bgp 0 0
no bgp default ipv4-unicast
distance bgp 20 200 200
graceful-restart restart-time 300
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ router bgp 65101
router-id 192.168.255.3
bgp default ipv4-unicast
bgp default ipv4-unicast transport ipv6
timers bgp min-hold-time 5
distance bgp 20 200 200
graceful-restart restart-time 300
graceful-restart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interface Management1
router bgp 65101.0001
bgp asn notation asdot
router-id 192.168.255.3
timers bgp send-failure hold-time 65
neighbor PG-1 peer group
neighbor PG-1 remote-as 65001.0002
neighbor PG-2 peer group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ router_bgp:
updates:
wait_for_convergence: true
wait_install: true
timers: "5 35"
timers:
keepalive_time: 10
hold_time: 15
distance:
external_routes: 20
internal_routes: 200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ router_bgp:
# test for send_community
neighbor_default:
send_community: standard extended large
timers:
min_hold_time: 5
send_failure_hold_time: 65
bgp_defaults:
- no bgp default ipv4-unicast
- distance bgp 20 200 200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ router_bgp:
# test for send_community
neighbor_default:
send_community: all
timers:
keepalive_time: 0
hold_forever: true
bgp_defaults:
- no bgp default ipv4-unicast
- distance bgp 20 200 200
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
router_bgp:
as: 65101
router_id: 192.168.255.3
timers:
min_hold_time: 5
bgp_defaults:
- distance bgp 20 200 200
- graceful-restart restart-time 300
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ router_bgp:
as: "65101.0001"
as_notation: asdot
router_id: 192.168.255.3
timers:
send_failure_hold_time: 65
peer_groups:
- name: PG-1
remote_as: "65001.0002"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-bgp.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,24 @@ router bgp {{ router_bgp.as }}
{% elif router_bgp.bgp.default.ipv4_unicast_transport_ipv6 is arista.avd.defined(false) %}
no bgp default ipv4-unicast transport ipv6
{% endif %}
{% if router_bgp.timers is arista.avd.defined %}
timers bgp {{ router_bgp.timers }}
{% if router_bgp.timers.keepalive_time is arista.avd.defined and
(router_bgp.timers.hold_time is arista.avd.defined or router_bgp.timers.hold_forever is arista.avd.defined) %}
{% set timers_bgp_cli = "timers bgp " ~ router_bgp.timers.keepalive_time %}
{% if router_bgp.timers.hold_time is arista.avd.defined %}
{% set timers_bgp_cli = timers_bgp_cli ~ " " ~ router_bgp.timers.hold_time %}
{% else %}
{% set timers_bgp_cli = timers_bgp_cli ~ " 0" %}
{% endif %}
{{ timers_bgp_cli }}
{% elif router_bgp.timers.min_hold_time is arista.avd.defined or router_bgp.timers.send_failure_hold_time is arista.avd.defined %}
{% set timers_bgp_cli = "timers bgp" %}
{% if router_bgp.timers.min_hold_time is arista.avd.defined %}
{% set timers_bgp_cli = timers_bgp_cli ~ " min-hold-time " ~ router_bgp.timers.min_hold_time %}
{% endif %}
{% if router_bgp.timers.send_failure_hold_time is arista.avd.defined %}
{% set timers_bgp_cli = timers_bgp_cli ~ " send-failure hold-time " ~ router_bgp.timers.send_failure_hold_time %}
{% endif %}
{{ timers_bgp_cli }}
{% endif %}
{% if router_bgp.distance.external_routes is arista.avd.defined %}
{% set distance_cli = "distance bgp " ~ router_bgp.distance.external_routes %}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,39 @@ keys:
type: str
description: In IP address format A.B.C.D.
timers:
type: str
description: |-
BGP Keepalive and Hold Timer values in seconds as string "<0-3600> <0-3600>".
Example - "5 15".
type: dict
keys:
keepalive_time:
description: Time between BGP keepalive messages in seconds.
type: int
convert_types:
- str
min: 0
max: 3600
hold_time:
description: Hold time in seconds.
type: int
convert_types:
- str
min: 3
max: 7200
hold_forever:
type: bool
description: Don't send keep-alives. keepalive_time should be `0` with hold_forever `true`.
min_hold_time:
description: Neighbor's minimum hold time constraint in seconds.
type: int
convert_types:
- str
min: 3
max: 7200
send_failure_hold_time:
description: Send failure hold time in seconds.
type: int
convert_types:
- str
min: 60
max: 65335
distance:
type: dict
keys:
Expand Down

0 comments on commit 3e2a026

Please sign in to comment.