Browse Source

Reorder bird config includes

Markus Lindenberg 9 years ago
parent
commit
9543beaa96

+ 1 - 9
roles/internal/ffdo.bird/templates/bird.conf.j2

@@ -5,8 +5,6 @@
 log syslog all;
 router id {{routerid}};
 
-include "/etc/bird.d/*.cfg";
-
 protocol direct {
         interface "*";
 };
@@ -22,10 +20,4 @@ protocol device {
         scan time 8;
 };
 
-template bgp ibgp {
-        local as {{as}};
-        import all;
-        export all;
-        next hop self;
-        multihop 64;
-};
+include "/etc/bird.d/*.cfg";

+ 2 - 11
roles/internal/ffdo.bird/templates/bird6.conf.j2

@@ -5,8 +5,6 @@
 log syslog all;
 router id {{routerid}};
 
-include "/etc/bird6.d/*.cfg";
-
 protocol static uplink_hostroute {
    import all;
    export all;
@@ -29,12 +27,5 @@ protocol device {
         scan time 10;
 }
 
-template bgp ibgp {
-        local as {{as}};
-        source address {{mesh_ipv6|ipaddr('address')}};
-        import all;
-        export all;
-        next hop self;
-        direct;
-        gateway direct;
-}
+
+include "/etc/bird6.d/*.cfg";

+ 9 - 1
roles/internal/ffdo.mesh-interfaces/templates/bird.conf.j2

@@ -2,6 +2,14 @@
 # This file is managed by ansible. Do not edit by hand!
 #
 
+template bgp ibgp {
+        local as {{as}};
+        import all;
+        export all;
+        next hop self;
+        multihop 64;
+};
+
 {% for host in groups['all'] %}
 {% if hostvars[host]["inventory_hostname"] != inventory_hostname %}
 protocol bgp {{hostvars[host]['inventory_hostname_short']}} from ibgp {
@@ -10,4 +18,4 @@ protocol bgp {{hostvars[host]['inventory_hostname_short']}} from ibgp {
         default bgp_med 4;
 };
 {% endif %}
-{% endfor %}
+{% endfor %}

+ 10 - 0
roles/internal/ffdo.mesh-interfaces/templates/bird6.conf.j2

@@ -2,6 +2,16 @@
 # This file is managed by ansible. Do not edit by hand!
 #
 
+template bgp ibgp {
+        local as {{as}};
+        source address {{mesh_ipv6|ipaddr('address')}};
+        import all;
+        export all;
+        next hop self;
+        direct;
+        gateway direct;
+}
+
 {% for host in groups['all'] %}
 {% if hostvars[host]['inventory_hostname'] != inventory_hostname %}
 protocol bgp {{hostvars[host]['inventory_hostname_short']}} from ibgp {

+ 10 - 2
roles/internal/ffdo.peering/templates/bird.conf.j2

@@ -2,13 +2,21 @@
 # This file is managed by ansible. Do not edit by hand!
 #
 
+template bgp uplink {
+        local as {{as}};
+        import all;
+        export all;
+        next hop self;
+        multihop 64;
+};
+
 {% if peers is defined %}
 {% for peer in peers %}
-protocol bgp {{peer.name}} from ibgp {
+protocol bgp {{peer.name}} from uplink {
         source address {{peer.source_ip4}};
         neighbor {{peer.peer_ip4}} as {{peer.as}};
         default bgp_med 2;
 };
 
 {% endfor %}
-{% endif %}
+{% endif %}

+ 3 - 3
roles/internal/ffdo.peering/templates/peering_interfaces.j2

@@ -1,8 +1,8 @@
 {% if peers is defined %}
 {% for peer in peers %}
 {% if peer.gre is defined %}
-auto gre-{{peer.name}}
-iface gre-{{peer.name}} inet tunnel
+auto peer-{{peer.name}}
+iface peer-{{peer.name}} inet tunnel
     mode gre
     address {{peer.gre.ip|ipaddr('address')}}
     dstaddr {{peer.peer_ip4}}
@@ -12,7 +12,7 @@ iface gre-{{peer.name}} inet tunnel
     mtu 1400
     ttl 64
 
-iface gre-{{peer.name}} inet6 static
+iface peer-{{peer.name}} inet6 static
     address {{peer.gre.ip6}}
 
 {% endif %}