From bf6d10d56844dd00b7605f299e742c888c7e1682 Mon Sep 17 00:00:00 2001 From: shirenn <shirenn@crans.org> Date: Mon, 19 Jul 2021 16:51:54 +0200 Subject: [PATCH] [bird] specify source address --- host_vars/routeur-daniel.adm.crans.org/bird.yml | 8 ++++++-- host_vars/routeur-gulp.cachan-adm.crans.org/bird.yml | 6 ++++-- host_vars/routeur-jack.adm.crans.org/bird.yml | 8 ++++++-- host_vars/routeur-sam.adm.crans.org/bird.yml | 8 ++++++-- roles/bird/templates/bird/bird.conf.j2 | 6 +++++- roles/bird/templates/bird/bird6.conf.j2 | 6 +++++- 6 files changed, 32 insertions(+), 10 deletions(-) diff --git a/host_vars/routeur-daniel.adm.crans.org/bird.yml b/host_vars/routeur-daniel.adm.crans.org/bird.yml index e4cce20e..588b8f23 100644 --- a/host_vars/routeur-daniel.adm.crans.org/bird.yml +++ b/host_vars/routeur-daniel.adm.crans.org/bird.yml @@ -9,7 +9,9 @@ loc_bird: bgps: - name: aurore allow_local_as: 1 - local_as: 204515 + local: + as: 204515 + address: 185.230.79.253 remote: as: 43619 address: 185.230.79.254 @@ -22,7 +24,9 @@ loc_bird: bgps: - name: aurore allow_local_as: 1 - local_as: 204515 + local: + as: 204515 + address: 2a0c:700:28::1 remote: as: 43619 address: 2a0c:700:28::2 diff --git a/host_vars/routeur-gulp.cachan-adm.crans.org/bird.yml b/host_vars/routeur-gulp.cachan-adm.crans.org/bird.yml index 4242bade..389a67a9 100644 --- a/host_vars/routeur-gulp.cachan-adm.crans.org/bird.yml +++ b/host_vars/routeur-gulp.cachan-adm.crans.org/bird.yml @@ -9,7 +9,8 @@ loc_bird: bgps: - name: zayo allow_local_as: 1 - local_as: 204515 + local: + as: 204515 remote: as: 8218 address: 158.255.113.72 @@ -22,7 +23,8 @@ loc_bird: bgps: - name: zayo allow_local_as: 1 - local_as: 204515 + local: + as: 204515 remote: as: 8218 address: 2001:1b48:2:103::bb:1 diff --git a/host_vars/routeur-jack.adm.crans.org/bird.yml b/host_vars/routeur-jack.adm.crans.org/bird.yml index e4cce20e..588b8f23 100644 --- a/host_vars/routeur-jack.adm.crans.org/bird.yml +++ b/host_vars/routeur-jack.adm.crans.org/bird.yml @@ -9,7 +9,9 @@ loc_bird: bgps: - name: aurore allow_local_as: 1 - local_as: 204515 + local: + as: 204515 + address: 185.230.79.253 remote: as: 43619 address: 185.230.79.254 @@ -22,7 +24,9 @@ loc_bird: bgps: - name: aurore allow_local_as: 1 - local_as: 204515 + local: + as: 204515 + address: 2a0c:700:28::1 remote: as: 43619 address: 2a0c:700:28::2 diff --git a/host_vars/routeur-sam.adm.crans.org/bird.yml b/host_vars/routeur-sam.adm.crans.org/bird.yml index e4cce20e..588b8f23 100644 --- a/host_vars/routeur-sam.adm.crans.org/bird.yml +++ b/host_vars/routeur-sam.adm.crans.org/bird.yml @@ -9,7 +9,9 @@ loc_bird: bgps: - name: aurore allow_local_as: 1 - local_as: 204515 + local: + as: 204515 + address: 185.230.79.253 remote: as: 43619 address: 185.230.79.254 @@ -22,7 +24,9 @@ loc_bird: bgps: - name: aurore allow_local_as: 1 - local_as: 204515 + local: + as: 204515 + address: 2a0c:700:28::1 remote: as: 43619 address: 2a0c:700:28::2 diff --git a/roles/bird/templates/bird/bird.conf.j2 b/roles/bird/templates/bird/bird.conf.j2 index 295cc21f..c046180f 100644 --- a/roles/bird/templates/bird/bird.conf.j2 +++ b/roles/bird/templates/bird/bird.conf.j2 @@ -41,7 +41,11 @@ protocol static { {% for bgp in bird.ipv4.bgps %} protocol bgp {{ bgp.name }} { - local as {{ bgp.local_as }}; +{% if bgp.local.address is defined %} + local {{ bgp.local.address }} as {{ bgp.local.as }}; +{% else %} + local as {{ bgp.local.as }}; +{% endif %} {% if bgp.allow_local_as is defined %} allow local as {{ bgp.allow_local_as }}; {% endif %} diff --git a/roles/bird/templates/bird/bird6.conf.j2 b/roles/bird/templates/bird/bird6.conf.j2 index 4d1cea0e..22e276d8 100644 --- a/roles/bird/templates/bird/bird6.conf.j2 +++ b/roles/bird/templates/bird/bird6.conf.j2 @@ -40,7 +40,11 @@ protocol static { {%for bgp in bird.ipv6.bgps %} protocol bgp {{ bgp.name }} { - local as {{ bgp.local_as }}; +{% if bgp.local.address is defined %} + local {{ bgp.local.address }} as {{ bgp.local.as }}; +{% else %} + local as {{ bgp.local.as }}; +{% endif %} {% if bgp.allow_local_as is defined %} allow local as {{ bgp.allow_local_as }}; {% endif %} -- GitLab