migrate edge routers (routeur-aurore.adm -> edge-{1,2}.rtr)

This commit is contained in:
jeltz 2023-03-26 17:06:34 +02:00
parent 67f0e4ccbc
commit eb8368b2e6
Signed by: jeltz
GPG key ID: 800882B66C0C3326
4 changed files with 149 additions and 115 deletions

View file

@ -190,19 +190,27 @@
- ff00::/8 - ff00::/8
bird__router_id: "{{ bird__router_ids[inventory_hostname] }}" bird__router_id: "{{ bird__router_ids[inventory_hostname] }}"
bird__bgp_addresses: bird__bgp_addresses:
edge:
edge-1.rtr.infra.auro.re: edge-1.rtr.infra.auro.re:
- 2a09:6840:203:1:1::1 - 2a09:6840:203:1:1::1
- 10.203.1.1 - 10.203.1.1
edge-2.rtr.infra.auro.re: edge-2.rtr.infra.auro.re:
- 2a09:6840:203:1:2::1 - 2a09:6840:203:1:2::1
- 10.203.1.2 - 10.203.1.2
legacy:
edge-1.rtr.infra.auro.re:
- 2a09:6840:129::10:2
- 10.129.10.2
edge-2.rtr.infra.auro.re:
- 2a09:6840:129::10:102
- 10.129.10.102
bird__bgp_sessions: bird__bgp_sessions:
- name: edge - name: edge
local: local:
address: "{{ bird__bgp_addresses[inventory_hostname] }}" address: "{{ bird__bgp_addresses.edge[inventory_hostname] }}"
as: "{{ bird__asn.aurore }}" as: "{{ bird__asn.aurore }}"
remote: remote:
address: "{{ bird__bgp_addresses address: "{{ bird__bgp_addresses.edge
| dict2items | dict2items
| selectattr('key', '!=', inventory_hostname) | selectattr('key', '!=', inventory_hostname)
| map(attribute='value') | map(attribute='value')
@ -211,79 +219,100 @@
import: import:
- accept: true - accept: true
export: export:
- accept: true - local_pref: 75
- name: infra1 accept: true
- name: legacy
next_hop_self: true
local: local:
address: "{{ bird__bgp_addresses[inventory_hostname] }}" address: "{{ bird__bgp_addresses.legacy[inventory_hostname] }}"
as: "{{ bird__asn.aurore }}" as: "{{ bird__asn.aurore }}"
remote: remote:
address: address:
- 2a09:6840:203:1:3::1 - 2a09:6840:129::240
- 10.203.1.3 - 10.129.0.240
as: "{{ bird__asn.aurore }}" as: "{{ bird__asn.aurore }}"
import: import:
- prefix: "{{ bird__orig_prefixes.aurore }}"
sub: true
accept: true
- accept: false - accept: false
export: export:
- bgp_proto: - bgp_proto:
- crans - crans
- viarezo
- zayo - zayo
accept: true accept: true
- accept: false # - name: infra1
- name: infra2 # local:
local: # address: "{{ bird__bgp_addresses[inventory_hostname] }}"
address: "{{ bird__bgp_addresses[inventory_hostname] }}" # as: "{{ bird__asn.aurore }}"
as: "{{ bird__asn.aurore }}" # remote:
remote: # address:
address: # - 2a09:6840:203:1:3::1
- 2a09:6840:203:1:4::1 # - 10.203.1.3
- 10.203.1.4 # as: "{{ bird__asn.aurore }}"
as: "{{ bird__asn.aurore }}" # import:
import: # - accept: false
- accept: false # export:
export: # - bgp_proto:
- bgp_proto: # - crans
- crans # - viarezo
- viarezo # - zayo
- zayo # accept: true
accept: true # - accept: false
- accept: false # - name: infra2
- name: isp1 # local:
local: # address: "{{ bird__bgp_addresses[inventory_hostname] }}"
address: "{{ bird__bgp_addresses[inventory_hostname] }}" # as: "{{ bird__asn.aurore }}"
as: "{{ bird__asn.aurore }}" # remote:
remote: # address:
address: # - 2a09:6840:203:1:4::1
- 2a09:6840:203:1:5::1 # - 10.203.1.4
- 10.203.1.5 # as: "{{ bird__asn.aurore }}"
as: "{{ bird__asn.aurore }}" # import:
import: # - accept: false
- accept: false # export:
export: # - bgp_proto:
- bgp_proto: # - crans
- crans # - viarezo
- viarezo # - zayo
- zayo # accept: true
accept: true # - accept: false
- accept: false # - name: isp1
- name: isp2 # local:
local: # address: "{{ bird__bgp_addresses[inventory_hostname] }}"
address: "{{ bird__bgp_addresses[inventory_hostname] }}" # as: "{{ bird__asn.aurore }}"
as: "{{ bird__asn.aurore }}" # remote:
remote: # address:
address: # - 2a09:6840:203:1:5::1
- 2a09:6840:203:1:6::1 # - 10.203.1.5
- 10.203.1.6 # as: "{{ bird__asn.aurore }}"
as: "{{ bird__asn.aurore }}" # import:
import: # - accept: false
- accept: false # export:
export: # - bgp_proto:
- bgp_proto: # - crans
- crans # - viarezo
- viarezo # - zayo
- zayo # accept: true
accept: true # - accept: false
- accept: false # - name: isp2
# local:
# address: "{{ bird__bgp_addresses[inventory_hostname] }}"
# as: "{{ bird__asn.aurore }}"
# remote:
# address:
# - 2a09:6840:203:1:6::1
# - 10.203.1.6
# as: "{{ bird__asn.aurore }}"
# import:
# - accept: false
# export:
# - bgp_proto:
# - crans
# - viarezo
# - zayo
# accept: true
# - accept: false
- name: zayo - name: zayo
local: local:
address: address:
@ -297,6 +326,7 @@
as: "{{ bird__asn.zayo }}" as: "{{ bird__asn.zayo }}"
import: import:
- prefix: "{{ bird__orig_prefixes.martians }}" - prefix: "{{ bird__orig_prefixes.martians }}"
sub: true
accept: false accept: false
- accept: true - accept: true
export: export:
@ -318,53 +348,51 @@
- 2a0c:700:28::1 - 2a0c:700:28::1
as: "{{ bird__asn.crans }}" as: "{{ bird__asn.crans }}"
import: import:
- prefix: "{{ bird__orig_prefixes.martians }}"
accept: false
- prefix: "{{ bird__orig_prefixes.crans }}" - prefix: "{{ bird__orig_prefixes.crans }}"
sub: true sub: true
accept: true accept: true
- accept: false - accept: false
export: export:
- bgp_proto: - bgp_proto:
- viarezo # - viarezo
- zayo
accept: true
- prefix: "{{ bird__orig_prefixes.aurore }}"
sub: true
accept: true
- accept: false
- name: viarezo
local:
address:
- 192.159.121.134
- 2a0c:b641:2ff::6
as: "{{ bird__asn.aurore }}"
remote:
address:
- 192.159.121.133
- 2a0c:b641:2ff::5
as: "{{ bird__asn.viarezo }}"
import:
- prefix: "{{ bird__orig_prefixes.martians }}"
accept: false
- prefix: "{{ bird__orig_prefixes.viarezo }}"
sub: true
negate: true
local_pref: 50
- accept: true
export:
- prefix: "{{ bird__orig_prefixes.aurore }}"
as_prepend:
asn: "{{ bird__asn.aurore }}"
size: 5
- bgp_proto:
- crans
- zayo - zayo
accept: true accept: true
- prefix: "{{ bird__orig_prefixes.aurore }}" - prefix: "{{ bird__orig_prefixes.aurore }}"
sub: true sub: true
accept: true accept: true
- accept: false - accept: false
# - name: viarezo
# local:
# address:
# - 192.159.121.134
# - 2a0c:b641:2ff::6
# as: "{{ bird__asn.aurore }}"
# remote:
# address:
# - 192.159.121.133
# - 2a0c:b641:2ff::5
# as: "{{ bird__asn.viarezo }}"
# import:
# - prefix: "{{ bird__orig_prefixes.martians }}"
# accept: false
# - prefix: "{{ bird__orig_prefixes.viarezo }}"
# sub: true
# negate: true
# local_pref: 50
# - accept: true
# export:
# - prefix: "{{ bird__orig_prefixes.aurore }}"
# as_prepend:
# asn: "{{ bird__asn.aurore }}"
# size: 5
# - bgp_proto:
# - crans
# - zayo
# accept: true
# - prefix: "{{ bird__orig_prefixes.aurore }}"
# sub: true
# accept: true
# - accept: false
bird__ospf_broadcast_interfaces: bird__ospf_broadcast_interfaces:
ens22: null ens22: null
bird__ospf_stub_interfaces: bird__ospf_stub_interfaces:

View file

@ -17,7 +17,6 @@
addresses: addresses:
- 2a09:6840:128::10:2/56 - 2a09:6840:128::10:2/56
- 10.128.10.2/16 - 10.128.10.2/16
gateways: "{{ ifupdown2__gateways.adm }}"
ens19: ens19:
ipv6_addrgen: false ipv6_addrgen: false
forward: true forward: true
@ -32,18 +31,22 @@
- 2a09:6840:203:1:1::1/56 - 2a09:6840:203:1:1::1/56
- 10.203.1.1/16 - 10.203.1.1/16
forward: true forward: true
ens23: null ens23:
ipv6_addrgen: false
forward: true
enp2s1: enp2s1:
addresses: addresses:
- 2a09:6840:129::10:2/56 - 2a09:6840:129::10:2/56
- 10.129.10.2/16 - 10.129.10.2/16
forward: true forward: true
enp2s2:
ipv6_addrgen: false
forward: true
edge-2.rtr.infra.auro.re: edge-2.rtr.infra.auro.re:
ens18: ens18:
addresses: addresses:
- 2a09:6840:128::10:102/56 - 2a09:6840:128::10:102/56
- 10.128.10.102/16 - 10.128.10.102/16
gateways: "{{ ifupdown2__gateways.adm }}"
ens19: ens19:
ipv6_addrgen: false ipv6_addrgen: false
forward: true forward: true
@ -58,12 +61,17 @@
- 2a09:6840:203:1:2::1/56 - 2a09:6840:203:1:2::1/56
- 10.203.1.2/16 - 10.203.1.2/16
forward: true forward: true
ens23: null ens23:
ipv6_addrgen: false
forward: true
enp2s1: enp2s1:
addresses: addresses:
- 2a09:6840:129::10:102/56 - 2a09:6840:129::10:102/56
- 10.129.10.102/16 - 10.129.10.102/16
forward: true forward: true
enp2s2:
ipv6_addrgen: false
forward: true
dns-1.int.infra.auro.re: dns-1.int.infra.auro.re:
ens18: ens18:
addresses: addresses:

View file

@ -43,14 +43,9 @@
- 2a0c:700:28::2/64 - 2a0c:700:28::2/64
- fe80::1/10 - fe80::1/10
ens20: ens20:
# - 192.159.121.134/30
# - 2a0c:b641:2ff::6/126
- fe80::1/10
- 2001:1b48:2:103::d7:2/126 - 2001:1b48:2:103::d7:2/126
# ens21: - 83.167.52.69/31
# - 83.167.52.69/31 - fe80::1/10
# - 2001:1b48:2:103::d7:2/126
# - fe80::1/10
keepalived__main: "{{ inventory_hostname_short == 'edge-1' }}" keepalived__main: "{{ inventory_hostname_short == 'edge-1' }}"
roles: roles:
- keepalived - keepalived

View file

@ -180,6 +180,9 @@ protocol bgp bgp{{ version }}_{{ session.name }} {
{{ "ipv4" if version == 4 else "ipv6" }} { {{ "ipv4" if version == 4 else "ipv6" }} {
{% if session.next_hop_self | default(False) %} {% if session.next_hop_self | default(False) %}
next hop self; next hop self;
{% endif %}
{% if session.direct | default(False) %}
direct;
{% endif %} {% endif %}
import filter bgp{{ version }}_import_{{ session.name }}; import filter bgp{{ version }}_import_{{ session.name }};
export filter bgp{{ version }}_export_{{ session.name }}; export filter bgp{{ version }}_export_{{ session.name }};