Skip to content
Open
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
4 changes: 4 additions & 0 deletions playbooks/bgp/prepare-bgp-spines-leaves.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,8 @@
become: true
vars:
downlink_interfaces: "{{ downlink_ifs_rack3 if (rack_id | int) == 3 else leaf_downlink_ifs }}"
downlink_remote_as: "{{ 'external' if (rack_id | int) in (ebgp_racks | default([]) | map('int') | list) else 'internal' }}"
leaf_asn: "{{ ebgp_leaf_asn | default(64999) if (rack_id | int) in (ebgp_racks | default([]) | map('int') | list) else 64999 }}"
_router_id: ''
ansible.builtin.template:
src: templates/leaf-frr.conf.j2
Expand Down Expand Up @@ -599,6 +601,8 @@
- name: Configure FRR
become: true
vars:
downlink_remote_as: "{{ 'external' if (rack_id | int) in (ebgp_racks | default([]) | map('int') | list) else 'internal' }}"
leaf_asn: "{{ ebgp_leaf_asn | default(64999) if (rack_id | int) in (ebgp_racks | default([]) | map('int') | list) else 64999 }}"
_router_id: "{{ '1.1.1.20' + ansible_hostname.split('-')[-1] }}"
ansible.builtin.template:
src: templates/leaf-frr.conf.j2
Expand Down
15 changes: 11 additions & 4 deletions playbooks/bgp/templates/leaf-frr.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ debug bgp neighbor-events
debug bgp updates
debug bgp update-groups

router bgp 64999
{% set _downlink_as_mode = downlink_remote_as | default('internal') %}
router bgp {{ leaf_asn | default(64999) }}
{% if _router_id %}
bgp router-id {{_router_id}}
{% endif %}
Expand All @@ -27,7 +28,7 @@ router bgp 64999
! bgp long-lived-graceful-restart stale-time 15

neighbor downlink peer-group
neighbor downlink remote-as internal
neighbor downlink remote-as {{ _downlink_as_mode }}
neighbor downlink bfd
neighbor downlink bfd profile tripleo
{# TODO: remove the next if when RHEL-63205 is fixed #}
Expand All @@ -53,9 +54,11 @@ router bgp 64999

address-family ipv4 unicast
redistribute connected
neighbor downlink route-reflector-client
neighbor downlink default-originate
neighbor downlink next-hop-self
{% if _downlink_as_mode == 'internal' %}
neighbor downlink route-reflector-client
{% endif %}
neighbor downlink prefix-list only-host-prefixes out
neighbor uplink allowas-in origin
neighbor uplink prefix-list only-default-host-prefixes in
Expand All @@ -64,9 +67,11 @@ router bgp 64999
address-family ipv6 unicast
redistribute connected
neighbor downlink activate
neighbor downlink route-reflector-client
neighbor downlink default-originate
neighbor downlink next-hop-self
{% if _downlink_as_mode == 'internal' %}
neighbor downlink route-reflector-client
{% endif %}
neighbor uplink activate
neighbor uplink allowas-in origin
neighbor uplink prefix-list only-default-host-prefixes in
Expand All @@ -76,7 +81,9 @@ router bgp 64999
neighbor uplink activate
neighbor uplink allowas-in origin
neighbor downlink activate
{% if _downlink_as_mode == 'internal' %}
neighbor downlink route-reflector-client
{% endif %}
exit-address-family

ip prefix-list only-default-host-prefixes permit 0.0.0.0/0
Expand Down
Loading