Add some comments
This commit is contained in:
parent
2c090c74ee
commit
076927ec9a
30
bird.conf
30
bird.conf
|
@ -8,16 +8,19 @@ router id 10.112.1.1; # REPLACE
|
||||||
|
|
||||||
### functions ###
|
### functions ###
|
||||||
|
|
||||||
|
# own network
|
||||||
function is_self_net() {
|
function is_self_net() {
|
||||||
return (net ~ [10.112.0.0/16+]);
|
return (net ~ [10.112.0.0/16+]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# freifunk ip ranges in general
|
||||||
function is_freifunk() {
|
function is_freifunk() {
|
||||||
return net ~ [ 10.0.0.0/8+,
|
return net ~ [ 10.0.0.0/8+,
|
||||||
104.0.0.0/8+
|
104.0.0.0/8+
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# dn42 ip ranges
|
||||||
function is_dn42() {
|
function is_dn42() {
|
||||||
return net ~ [ 172.22.0.0/15+,
|
return net ~ [ 172.22.0.0/15+,
|
||||||
195.160.168.0/23+,
|
195.160.168.0/23+,
|
||||||
|
@ -46,7 +49,9 @@ function is_dn42() {
|
||||||
|
|
||||||
### kernel ###
|
### 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;
|
scan time 10;
|
||||||
import none;
|
import none;
|
||||||
export filter {
|
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;
|
scan time 10;
|
||||||
table freifunk;
|
table freifunk;
|
||||||
kernel table 42;
|
kernel table 42;
|
||||||
|
@ -66,18 +73,23 @@ protocol kernel kernel_ff {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# this pseudo-protocol watches all interface up/down events
|
||||||
protocol device {
|
protocol device {
|
||||||
scan time 10;
|
scan time 10;
|
||||||
};
|
};
|
||||||
|
|
||||||
### pipes ###
|
### pipes ###
|
||||||
|
|
||||||
|
# sync nothing from main routing table to ebgp
|
||||||
|
# sync routes (not own network) from ebgp to main routing table
|
||||||
protocol pipe p_maintbl {
|
protocol pipe p_maintbl {
|
||||||
peer table ebgp;
|
peer table ebgp;
|
||||||
import where !is_self_net();
|
import where !is_self_net();
|
||||||
export none;
|
export none;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# sync routes (not own network) from ebgp to ibgp
|
||||||
|
# sync routes (all) from ibgp to ebgp
|
||||||
protocol pipe p_ibgptbl {
|
protocol pipe p_ibgptbl {
|
||||||
table ebgp;
|
table ebgp;
|
||||||
peer table ibgp;
|
peer table ibgp;
|
||||||
|
@ -85,6 +97,8 @@ protocol pipe p_ibgptbl {
|
||||||
export where !is_self_net();
|
export where !is_self_net();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# sync routes (freifunk and dn42) from ibgp to freifunk
|
||||||
|
# sync nothing from freifunk to ibgp
|
||||||
protocol pipe p_freitbl {
|
protocol pipe p_freitbl {
|
||||||
table ibgp;
|
table ibgp;
|
||||||
peer table freifunk;
|
peer table freifunk;
|
||||||
|
@ -94,6 +108,7 @@ protocol pipe p_freitbl {
|
||||||
|
|
||||||
### static routes ###
|
### static routes ###
|
||||||
|
|
||||||
|
# if no openvpn is running, reject everything we do not have a route for
|
||||||
protocol static unreachable_default {
|
protocol static unreachable_default {
|
||||||
route 0.0.0.0/0 reject;
|
route 0.0.0.0/0 reject;
|
||||||
table freifunk;
|
table freifunk;
|
||||||
|
@ -104,6 +119,8 @@ protocol static static_ffhh {
|
||||||
table ebgp;
|
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 {
|
protocol static local_ffhh {
|
||||||
route 10.112.0.0/18 via "br-ffhh"; # REPLACE if interface name is not br-ffhh
|
route 10.112.0.0/18 via "br-ffhh"; # REPLACE if interface name is not br-ffhh
|
||||||
table freifunk;
|
table freifunk;
|
||||||
|
@ -111,6 +128,7 @@ protocol static local_ffhh {
|
||||||
|
|
||||||
### templates ###
|
### templates ###
|
||||||
|
|
||||||
|
# template for same city freifunk gateways
|
||||||
template bgp locals {
|
template bgp locals {
|
||||||
table ibgp;
|
table ibgp;
|
||||||
local as ownas;
|
local as ownas;
|
||||||
|
@ -123,16 +141,18 @@ template bgp locals {
|
||||||
next hop self;
|
next hop self;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# template for icvpn gateways of other cities
|
||||||
template bgp peers {
|
template bgp peers {
|
||||||
local as ownas;
|
|
||||||
table ebgp;
|
table ebgp;
|
||||||
|
local as ownas;
|
||||||
|
# ignore routes for our own network
|
||||||
import where ((is_freifunk() || is_dn42()) && !is_self_net());
|
import where ((is_freifunk() || is_dn42()) && !is_self_net());
|
||||||
export where (is_freifunk() || is_dn42());
|
export where (is_freifunk() || is_dn42());
|
||||||
route limit 10000;
|
route limit 10000;
|
||||||
};
|
};
|
||||||
|
|
||||||
### local gateways ###
|
### local gateways ###
|
||||||
# remove entry of this specific gateway
|
# remove entry of gateway where this config is used
|
||||||
|
|
||||||
protocol bgp srv01 from locals {
|
protocol bgp srv01 from locals {
|
||||||
neighbor 10.112.1.1 as ownas;
|
neighbor 10.112.1.1 as ownas;
|
||||||
|
|
Loading…
Reference in a new issue