Skip to content

Commit

Permalink
Feat(eos_cli_config_gen): Add support for BGP default timers and send…
Browse files Browse the repository at this point in the history
…-community commands (#4607)
  • Loading branch information
Shivani-gslab authored Nov 15, 2024
1 parent b53e79a commit 40626f7
Show file tree
Hide file tree
Showing 22 changed files with 191 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ router bgp 65101
update wait-install
no bgp default ipv4-unicast
no bgp default ipv4-unicast transport ipv6
timers bgp 10 15
distance bgp 20 200 200
graceful-restart restart-time 555
graceful-restart stalepath-time 666
Expand All @@ -161,6 +162,7 @@ router bgp 65101
bgp listen range 12.10.10.0/24 peer-id include router-id peer-group my-peer-group3 remote-as 65444
bgp listen range 13.10.10.0/24 peer-group my-peer-group4 peer-filter my-peer-filter
bgp bestpath d-path
neighbor default send-community standard
neighbor TEST peer group
neighbor TEST ttl maximum-hops 42
neighbor test-link-bandwidth1 peer group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,13 @@ 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
graceful-restart
maximum-paths 2 ecmp 2
neighbor default send-community standard extended large
neighbor EVPN-OVERLAY-PEERS peer group
neighbor EVPN-OVERLAY-PEERS remote-as 65001
neighbor EVPN-OVERLAY-PEERS update-source Loopback0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,13 @@ 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
graceful-restart
maximum-paths 2 ecmp 2
neighbor default send-community
neighbor EVPN-OVERLAY-PEERS peer group
neighbor EVPN-OVERLAY-PEERS remote-as 65001
neighbor EVPN-OVERLAY-PEERS update-source Loopback0
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 @@ -75,6 +75,7 @@ ASN Notation: asplain
```eos
!
router bgp 65101
timers bgp 4 6 min-hold-time 5 send-failure hold-time 67
!
address-family ipv4 labeled-unicast
update wait-for-convergence
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,6 +10,7 @@ router bgp 65101
update wait-install
no bgp default ipv4-unicast
no bgp default ipv4-unicast transport ipv6
timers bgp 10 15
distance bgp 20 200 200
graceful-restart restart-time 555
graceful-restart stalepath-time 666
Expand All @@ -21,6 +22,7 @@ router bgp 65101
bgp listen range 12.10.10.0/24 peer-id include router-id peer-group my-peer-group3 remote-as 65444
bgp listen range 13.10.10.0/24 peer-group my-peer-group4 peer-filter my-peer-filter
bgp bestpath d-path
neighbor default send-community standard
neighbor TEST peer group
neighbor TEST ttl maximum-hops 42
neighbor test-link-bandwidth1 peer group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ 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
graceful-restart
maximum-paths 2 ecmp 2
neighbor default send-community standard extended large
neighbor EVPN-OVERLAY-PEERS peer group
neighbor EVPN-OVERLAY-PEERS remote-as 65001
neighbor EVPN-OVERLAY-PEERS update-source Loopback0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ 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
graceful-restart
maximum-paths 2 ecmp 2
neighbor default send-community
neighbor EVPN-OVERLAY-PEERS peer group
neighbor EVPN-OVERLAY-PEERS remote-as 65001
neighbor EVPN-OVERLAY-PEERS update-source Loopback0
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 @@ -5,6 +5,7 @@ interface Management1
ip address 10.73.255.122/24
!
router bgp 65101
timers bgp 4 6 min-hold-time 5 send-failure hold-time 67
!
address-family ipv4 labeled-unicast
update wait-for-convergence
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,6 +4,9 @@ router_bgp:
updates:
wait_for_convergence: true
wait_install: true
timers:
keepalive_time: 10
hold_time: 15
distance:
external_routes: 20
internal_routes: 200
Expand Down Expand Up @@ -47,6 +50,8 @@ router_bgp:
peer_group: my-peer-group4
peer_filter: my-peer-filter
remote_as: 65444
neighbor_default:
send_community: standard
peer_groups:
- name: test-link-bandwidth1
link_bandwidth:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
router_bgp:
as: 65101
router_id: 192.168.255.3
# 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
@@ -1,6 +1,12 @@
router_bgp:
as: 65101
router_id: 192.168.255.3
# test for send_community
neighbor_default:
send_community: all
timers:
keepalive_time: 0
hold_time: 0
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
@@ -1,5 +1,10 @@
router_bgp:
as: 65101
timers:
keepalive_time: 4
hold_time: 6
min_hold_time: 5
send_failure_hold_time: 67
address_family_ipv4_labeled_unicast:
update_wait_for_convergence: true
aigp_session:
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: 20 additions & 0 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,6 +29,21 @@ 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 %}
{% set timers_bgp_cli = "timers bgp" %}
{% if router_bgp.timers.keepalive_time is arista.avd.defined and router_bgp.timers.hold_time is arista.avd.defined %}
{% set timers_bgp_cli = timers_bgp_cli ~ " " ~ router_bgp.timers.keepalive_time ~ " " ~ router_bgp.timers.hold_time %}
{% endif %}
{% if router_bgp.timers.min_hold_time is arista.avd.defined or router_bgp.timers.send_failure_hold_time is arista.avd.defined %}
{% 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 %}
{% 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 %}
{% if router_bgp.distance.internal_routes is arista.avd.defined and router_bgp.distance.local_routes is arista.avd.defined %}
Expand Down Expand Up @@ -112,6 +127,11 @@ router bgp {{ router_bgp.as }}
{% if router_bgp.bgp.bestpath.d_path is arista.avd.defined(true) %}
bgp bestpath d-path
{% endif %}
{% if router_bgp.neighbor_default.send_community is arista.avd.defined('all') %}
neighbor default send-community
{% elif router_bgp.neighbor_default.send_community is arista.avd.defined %}
neighbor default send-community {{ router_bgp.neighbor_default.send_community }}
{% endif %}
{% for peer_group in router_bgp.peer_groups | arista.avd.natural_sort('name') %}
neighbor {{ peer_group.name }} peer group
{% if peer_group.remote_as is arista.avd.defined %}
Expand Down

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

Loading

0 comments on commit 40626f7

Please sign in to comment.