From 7e97d7e0e1ef36ce2bbf33481c0c10881b1a1250 Mon Sep 17 00:00:00 2001 From: ace Date: Mon, 25 Oct 2021 14:35:28 +0300 Subject: [PATCH] update config --- templates/bird.conf.j2 | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/templates/bird.conf.j2 b/templates/bird.conf.j2 index 7921464..d49ce0d 100644 --- a/templates/bird.conf.j2 +++ b/templates/bird.conf.j2 @@ -9,8 +9,8 @@ protocol direct { ipv6; # ... and to default IPv6 table } protocol kernel KERNEL4 { - ipv4 { # Connect protocol to IPv4 table by channel - export all; # Export to protocol. default is export none + ipv4 { # Connect protocol to IPv4 table by channel + export all; # Export to protocol. default is export none }; } protocol kernel KERNEL6 { @@ -18,29 +18,29 @@ protocol kernel KERNEL6 { } {% for protocol_static in bird.bgp.static %} protocol static {{ protocol_static.name }} { - ipv4; # Again, IPv4 channel with default options + ipv4; # Again, IPv4 channel with default options {% for network in protocol_static['networks'][inventory_hostname] %} - route {{ network.ip }}/{{ network.mask_dash }} via "lo" { bgp_local_pref = {{ network.bgp_local_pref }}; }; + route {{ network.ip }}/{{ network.mask_dash }} via "lo" { bgp_local_pref = {{ network.bgp_local_pref }}; }; {% endfor %} } {% endfor %} {% for protocol_bgp in bird.bgp.bgp %} protocol bgp {{ protocol_bgp.name }} { - {% if protocol_bgp.confederation is defined %} - confederation {{ protocol_bgp.confederation }}; - confederation member yes; - {% endif %} - local as {{ protocol_bgp.local_asnum }}; - neighbor {{ protocol_bgp.remote_addr }} as {{ protocol_bgp.remote_asnum }}; - hold time 30; - ipv4 { - export filter { + {% if protocol_bgp.confederation is defined %} + confederation {{ protocol_bgp.confederation }}; + confederation member yes; + {% endif %} + local as {{ protocol_bgp.local_asnum }}; + neighbor {{ protocol_bgp.remote_addr }} as {{ protocol_bgp.remote_asnum }}; + hold time 30; + ipv4 { + export filter { {% for proto in protocol_bgp.export %} - if proto = "{{ proto }}" then accept; + if proto = "{{ proto }}" then accept; {% endfor %} - else reject; - }; - }; + else reject; + }; + }; } {% endfor %}