From 076927ec9a81f8e01bf1b07d97730afb837156f2 Mon Sep 17 00:00:00 2001 From: Leo Krueger Date: Sat, 26 Apr 2014 14:06:52 +0200 Subject: [PATCH] Add some comments --- bird.conf | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/bird.conf b/bird.conf index 0b57b48..f24a74c 100644 --- a/bird.conf +++ b/bird.conf @@ -8,16 +8,19 @@ router id 10.112.1.1; # REPLACE ### functions ### +# own network function is_self_net() { return (net ~ [10.112.0.0/16+]); } +# freifunk ip ranges in general function is_freifunk() { return net ~ [ 10.0.0.0/8+, 104.0.0.0/8+ ]; } +# dn42 ip ranges function is_dn42() { return net ~ [ 172.22.0.0/15+, 195.160.168.0/23+, @@ -46,7 +49,9 @@ function is_dn42() { ### kernel ### -protocol kernel kernel_master { +# synchronize from bird to main kernel routing table +# nothing in the other direction +protocol kernel k_mast { scan time 10; import none; export filter { @@ -55,7 +60,9 @@ protocol kernel kernel_master { }; }; -protocol kernel kernel_ff { +# synchronize from birds freifunk table to kernel routing table 42 +# nothing in the other direction +protocol kernel k_frei { scan time 10; table freifunk; kernel table 42; @@ -66,18 +73,23 @@ protocol kernel kernel_ff { }; }; +# this pseudo-protocol watches all interface up/down events protocol device { scan time 10; }; ### pipes ### +# sync nothing from main routing table to ebgp +# sync routes (not own network) from ebgp to main routing table protocol pipe p_maintbl { peer table ebgp; import where !is_self_net(); export none; }; +# sync routes (not own network) from ebgp to ibgp +# sync routes (all) from ibgp to ebgp protocol pipe p_ibgptbl { table ebgp; peer table ibgp; @@ -85,6 +97,8 @@ protocol pipe p_ibgptbl { export where !is_self_net(); }; +# sync routes (freifunk and dn42) from ibgp to freifunk +# sync nothing from freifunk to ibgp protocol pipe p_freitbl { table ibgp; peer table freifunk; @@ -94,6 +108,7 @@ protocol pipe p_freitbl { ### static routes ### +# if no openvpn is running, reject everything we do not have a route for protocol static unreachable_default { route 0.0.0.0/0 reject; table freifunk; @@ -104,6 +119,8 @@ protocol static static_ffhh { table ebgp; }; +# in hamburg we use a /18 from our /16 in the mesh +# create a route for that in freifunk table protocol static local_ffhh { route 10.112.0.0/18 via "br-ffhh"; # REPLACE if interface name is not br-ffhh table freifunk; @@ -111,6 +128,7 @@ protocol static local_ffhh { ### templates ### +# template for same city freifunk gateways template bgp locals { table ibgp; local as ownas; @@ -123,16 +141,18 @@ template bgp locals { next hop self; }; +# template for icvpn gateways of other cities template bgp peers { - local as ownas; table ebgp; + local as ownas; + # ignore routes for our own network import where ((is_freifunk() || is_dn42()) && !is_self_net()); - export where (is_freifunk() || is_dn42()); + export where (is_freifunk() || is_dn42()); route limit 10000; }; ### local gateways ### -# remove entry of this specific gateway +# remove entry of gateway where this config is used protocol bgp srv01 from locals { neighbor 10.112.1.1 as ownas;