From 6fd416051ea6be2b4499fe728ecc27c29dcd37cf Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Tue, 23 Jan 2018 18:45:11 +0100 Subject: [PATCH] bird: IPv4 backbone L3 routing --- roles/bird/handlers/main.yml | 7 +++++++ roles/bird/tasks/main.yml | 14 ++++++++++++++ roles/bird/templates/bird.conf.j2 | 29 +++++++++++++++++++++++++++++ site.yml | 1 + 4 files changed, 51 insertions(+) create mode 100644 roles/bird/handlers/main.yml create mode 100644 roles/bird/tasks/main.yml create mode 100644 roles/bird/templates/bird.conf.j2 diff --git a/roles/bird/handlers/main.yml b/roles/bird/handlers/main.yml new file mode 100644 index 0000000..90c34d8 --- /dev/null +++ b/roles/bird/handlers/main.yml @@ -0,0 +1,7 @@ +--- + +- name: Restart bird + service: name=bird state=restarted + +- name: Restart bird6 + service: name=bird6 state=restarted diff --git a/roles/bird/tasks/main.yml b/roles/bird/tasks/main.yml new file mode 100644 index 0000000..c014448 --- /dev/null +++ b/roles/bird/tasks/main.yml @@ -0,0 +1,14 @@ +--- + +- name: Install bird + apt: package={{ item }} + with_items: + - bird + - bird6 + +- name: Configure bird + template: src=bird.conf.j2 dest=/etc/bird/bird.conf + notify: Restart bird + +- name: Enable bird + service: name=bird state=started enabled=yes diff --git a/roles/bird/templates/bird.conf.j2 b/roles/bird/templates/bird.conf.j2 new file mode 100644 index 0000000..3825cdd --- /dev/null +++ b/roles/bird/templates/bird.conf.j2 @@ -0,0 +1,29 @@ +# {{ ansible_managed }} + +log syslog all; + +router id {{ ansible_default_ipv4.address }}; + +timeformat protocol iso long; + +protocol device { + scan time 10; +} + +protocol kernel { + metric 64; # Use explicit kernel route metric to avoid collisions + # with non-BIRD routes in the kernel routing table + import none; + export all; # Actually insert routes into the kernel routing table +} + +protocol ospf bbmesh { + area 0 { + interface "br-*" { + stub yes; + }; + interface "tun-*" { + type ptp; + }; + }; +} diff --git a/site.yml b/site.yml index 784fc88..88c304d 100644 --- a/site.yml +++ b/site.yml @@ -11,6 +11,7 @@ hosts: [gw11.regensburg.freifunk.net, gw21.regensburg.freifunk.net, gw31.regensburg.freifunk.net] roles: - batman + - bird - fastd - mesh-interfaces - exit-ipv4