diff --git a/host_vars/routeur-daniel.adm.crans.org/bird.yml b/host_vars/routeur-daniel.adm.crans.org/bird.yml new file mode 100644 index 00000000..e4cce20e --- /dev/null +++ b/host_vars/routeur-daniel.adm.crans.org/bird.yml @@ -0,0 +1,28 @@ +--- +loc_bird: + ipv4: + id: 185.230.79.253 + binds: + - 185.230.79.253 + statics: + - 185.230.78.0/23 + bgps: + - name: aurore + allow_local_as: 1 + local_as: 204515 + remote: + as: 43619 + address: 185.230.79.254 + ipv6: + id: 185.230.79.253 + binds: + - 2a0c:700:28::1 + statics: + - 2a0c:700::/36 + bgps: + - name: aurore + allow_local_as: 1 + local_as: 204515 + 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 ad65b913..4242bade 100644 --- a/host_vars/routeur-gulp.cachan-adm.crans.org/bird.yml +++ b/host_vars/routeur-gulp.cachan-adm.crans.org/bird.yml @@ -1,20 +1,28 @@ --- loc_bird: - bgp: - as: 204515 - remote_as: 8218 - ipv4: - router_id: 158.255.113.73 - bind_address: 158.255.113.73 - network: - - 185.230.76.0/24 - - 185.230.78.0/23 - neighbor: 158.255.113.72 - ipv6: - router_id: 185.230.79.62 - bind_address: 2001:1b48:2:103::bb:2 - network: - - 2a0c:700::/36 - - 2a0c:700:3000::/36 - neighbor: 2001:1b48:2:103::bb:1 - + ipv4: + id: 158.255.113.73 + binds: + - 158.255.113.73 + statics: + - 185.230.76.0/24 + bgps: + - name: zayo + allow_local_as: 1 + local_as: 204515 + remote: + as: 8218 + address: 158.255.113.72 + ipv6: + id: 185.230.79.62 + binds: + - 2001:1b48:2:103::bb:2 + statics: + - 2a0c:700:3000::/36 + bgps: + - name: zayo + allow_local_as: 1 + local_as: 204515 + remote: + as: 8218 + address: 2001:1b48:2:103::bb:1 diff --git a/hosts b/hosts index 45574da4..51dc22d1 100644 --- a/hosts +++ b/hosts @@ -20,6 +20,9 @@ belenios.adm.crans.org [bird] routeur-gulp.cachan-adm.crans.org +[bird:children] +routeurs_vm + [blackbox] monitoring.adm.crans.org diff --git a/roles/bird/templates/bird/bird.conf.j2 b/roles/bird/templates/bird/bird.conf.j2 index 95c84884..8449e576 100644 --- a/roles/bird/templates/bird/bird.conf.j2 +++ b/roles/bird/templates/bird/bird.conf.j2 @@ -9,9 +9,12 @@ # Change this into your BIRD router ID. It's a world-wide unique identification # of your router, usually one of router's IPv4 addresses. -router id {{ bird.bgp.ipv4.router_id }}; +router id {{ bird.ipv4.id }}; + +{% for bind in bird.ipv4.binds %} +listen bgp address {{ bind }} port 179; +{% endfor %} -listen bgp address {{ bird.bgp.ipv4.bind_address }} port 179; # The Kernel protocol is not a real routing protocol. Instead of communicating # with other routers in the network, it performs synchronization of BIRD's @@ -20,10 +23,7 @@ protocol kernel { persist; scan time 60; import none; - export filter { - if ( net ~ [ {{ bird.bgp.ipv4.network | join(', ') }} ] ) then reject; - accept; - }; + export all; } # The Device protocol is not a real routing protocol. It doesn't generate any @@ -34,14 +34,19 @@ protocol device { } protocol static { -{% for ip in bird.bgp.ipv4.network %} - route {{ ip }} reject; +{% for static in bird.ipv4.statics %} + route {{ static }} reject; {% endfor %} } -protocol bgp zayo { - local as {{ bird.bgp.as }}; - neighbor {{ bird.bgp.ipv4.neighbor }} as {{ bird.bgp.remote_as }}; +{% for bgp in bird.ipv4.bgps %} +protocol bgp {{ bgp.name }} { + local as {{ bgp.local_as }}; +{% if bgp.allow_local_as is defined %} + allow local as {{ bgp.allow_local_as }}; +{% endif %} + neighbor {{ bgp.remote.address }} as {{ bgp.remote.as }}; import all; export all; } +{% endfor %} diff --git a/roles/bird/templates/bird/bird6.conf.j2 b/roles/bird/templates/bird/bird6.conf.j2 index 8acd7b82..dd5b5590 100644 --- a/roles/bird/templates/bird/bird6.conf.j2 +++ b/roles/bird/templates/bird/bird6.conf.j2 @@ -9,9 +9,11 @@ # Change this into your BIRD router ID. It's a world-wide unique identification # of your router, usually one of router's IPv6 addresses. -router id {{ bird.bgp.ipv6.router_id }}; +router id {{ bird.ipv6.id }}; -listen bgp address {{ bird.bgp.ipv6.bind_address }} port 179; +{% for bind in bird.ipv6.binds %} +listen bgp address {{ bind }} port 179; +{% endfor %} # The Kernel protocol is not a real routing protocol. Instead of communicating # with other routers in the network, it performs synchronization of BIRD's @@ -20,10 +22,7 @@ protocol kernel { persist; scan time 60; import none; - export filter { - if ( net ~ [ {{ bird.bgp.ipv6.network | join(', ') }} ] ) then reject; - accept; - }; + export all; } # The Device protocol is not a real routing protocol. It doesn't generate any @@ -34,14 +33,19 @@ protocol device { } protocol static { -{% for ip in bird.bgp.ipv6.network %} - route {{ ip }} reject; +{% for route in bird.ipv6.statics %} + route {{ route }} reject; {% endfor %} } +{%for bgp in bird.ipv6.bgps %} protocol bgp zayo { - local as {{ bird.bgp.as }}; - neighbor {{ bird.bgp.ipv6.neighbor }} as {{ bird.bgp.remote_as }}; + local as {{ bgp.local_as }}; +{% if bgp.allow_local_as is defined %} + allow local as {{ bgp.allow_local_as }}; +{% endif %} + neighbor {{ bgp.remote.address }} as {{ bgp.remote.as }}; import all; export all; } +{% endfor %}