Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgp: vrf: support originating a default-route #587

Merged
merged 4 commits into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ router bgp 65101
route-target import evpn 11:11
route-target export evpn 11:11
router-id 192.168.255.3
network 10.0.0.0/8
network 100.64.0.0/10
neighbor 10.255.251.1 peer group MLAG-IPv4-UNDERLAY-PEER
redistribute connected
!
Expand All @@ -471,6 +473,7 @@ router bgp 65101
neighbor 10.255.251.3 next-hop-self
neighbor 10.255.251.3 timers 1 3
neighbor 10.255.251.3 send-community link-bandwidth aggregate 2
neighbor 10.255.251.3 default-originate always
redistribute connected
redistribute static route-map RM-CONN-2-BGP
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ router bgp 65101
route-target import evpn 11:11
route-target export evpn 11:11
router-id 192.168.255.3
network 10.0.0.0/8
network 100.64.0.0/10
neighbor 10.255.251.1 peer group MLAG-IPv4-UNDERLAY-PEER
redistribute connected
!
Expand All @@ -100,6 +102,7 @@ router bgp 65101
neighbor 10.255.251.3 next-hop-self
neighbor 10.255.251.3 timers 1 3
neighbor 10.255.251.3 send-community link-bandwidth aggregate 2
neighbor 10.255.251.3 default-originate always
redistribute connected
redistribute static route-map RM-CONN-2-BGP
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ router_bgp:
## Tenant_A ##
TENANT_A_PROJECT01:
rd: "192.168.255.3:11"
description: TENANT_A_PROJECT01
route_targets:
both:
- "11:11"
Expand Down Expand Up @@ -95,6 +96,9 @@ router_bgp:
TENANT_A_PROJECT01:
router_id: 192.168.255.3
rd: "192.168.255.3:11"
networks:
10.0.0.0/8:
100.64.0.0/10:
route_targets:
import:
evpn:
Expand Down Expand Up @@ -137,6 +141,8 @@ router_bgp:
next_hop_self: true
timers: 1 3
send_community: link-bandwidth aggregate 2
default_originate:
always: true
redistribute_routes:
connected:
static:
Expand Down
34 changes: 20 additions & 14 deletions ansible_collections/arista/avd/roles/eos_cli_config_gen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1413,20 +1413,26 @@ router_bgp:
< address_family >:
- "< route_target >"
- "< route_target >"
timers: < keepalive_hold_timer_values >
neighbors:
< neighbor_ip_address >:
remote_as: < asn >
description: < description >
next_hop_self: < true | false >
timers: < keepalive_hold_timer_values >
send_community: < string | leave empty for all communities >
< neighbor_ip_address >:
remote_as: < asn >
description: < description >
next_hop_self: < true | false >
timers: < keepalive_hold_timer_values >
send_community: < string | leave empty for all communities >
timers: < keepalive_hold_timer_values >
networks:
< prefix_ipv4 >:
route_map: < route_map_name >
neighbors:
< neighbor_ip_address >:
remote_as: < asn >
description: < description >
next_hop_self: < true | false >
timers: < keepalive_hold_timer_values >
send_community: < string | leave empty for all communities >
default_originate:
always: < true | false >
route_map: < route_map_name >
< neighbor_ip_address >:
remote_as: < asn >
description: < description >
next_hop_self: < true | false >
timers: < keepalive_hold_timer_values >
send_community: < string | leave empty for all communities >
redistribute_routes:
< route_type >:
route_map: < route_map_name >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,15 @@ router bgp {{ router_bgp.as }}
{% if router_bgp.vrfs[vrf].timers is defined %}
timers bgp {{ router_bgp.vrfs[vrf].timers }}
{% endif %}
{% if router_bgp.vrfs[vrf].networks is defined and router_bgp.vrfs[vrf].networks is not none %}
{% for network in router_bgp.vrfs[vrf].networks | arista.avd.natural_sort %}
{% if router_bgp.vrfs[vrf].networks[network].route_map is defined and router_bgp.vrfs[vrf].networks[network].route_map is not none %}
network {{ network }} route-map {{ router_bgp.vrfs[vrf].networks[network].route_map }}
{% else %}
network {{ network }}
{% endif %}
{% endfor %}
{% endif %}
{% if router_bgp.vrfs[vrf].neighbors is defined and router_bgp.vrfs[vrf].neighbors is not none %}
{% for neighbor in router_bgp.vrfs[vrf].neighbors %}
{% if router_bgp.vrfs[vrf].neighbors[neighbor].remote_as is defined and router_bgp.vrfs[vrf].neighbors[neighbor].remote_as is not none %}
Expand All @@ -392,6 +401,10 @@ router bgp {{ router_bgp.as }}
{% if router_bgp.vrfs[vrf].neighbors[neighbor].send_community is defined %}
neighbor {{ neighbor }} send-community {{ router_bgp.vrfs[vrf].neighbors[neighbor].send_community }}
{% endif %}
{% if router_bgp.vrfs[vrf].neighbors[neighbor].default_originate is defined %}
neighbor {{ neighbor }} default-originate{%if router_bgp.vrfs[vrf].neighbors[neighbor].default_originate.route_map is defined and router_bgp.vrfs[vrf].neighbors[neighbor].default_originate.route_map is not none %} route-map {{ router_bgp.vrfs[vrf].neighbors[neighbor].default_originate.route_map }}{% endif %}{%if router_bgp.vrfs[vrf].neighbors[neighbor].default_originate.always is defined and router_bgp.vrfs[vrf].neighbors[neighbor].default_originate.always == true %} always{% endif %}

{% endif %}
{% endfor %}
{% endif %}
{% if router_bgp.vrfs[vrf].redistribute_routes is defined and router_bgp.vrfs[vrf].redistribute_routes is not none %}
Expand Down