Skip to content

Instantly share code, notes, and snippets.

@jplitza jplitza/bird.conf

Created Sep 2, 2014
Embed
What would you like to do?
table ebgp;
define ownas = 65196;
router id 10.196.0.2;
### functions ###
# own network
function is_self_net() {
return net ~ [
10.196.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{16,32}
];
};
# chaosvpn ranges
function is_chaos() {
return net ~ [
172.31.0.0/16+
];
};
### kernel ###
protocol kernel k_frei {
scan time 10;
kernel table 251;
import none;
export filter {
krt_prefsrc = 10.196.0.2;
accept;
};
};
# this pseudo-protocol watches all interface up/down events
protocol device {
scan time 10;
};
### pipes ###
protocol pipe p_maintbl {
peer table ebgp;
import all;
export none;
};
### static routes ###
# create a super route for own freifunk net in ebgp table
protocol static static_ffhb {
table ebgp;
route 10.196.0.0/16 reject;
};
# more specific routes in own freifunk net in master table
protocol static local_ffhb {
route 10.196.0.0/17 via "br-ffhb";
route 10.196.128.0/27 via 10.196.0.1;
};
### templates ###
template bgp icvpn {
local as ownas;
table ebgp;
import where ((is_freifunk() || is_dn42() || is_chaos()) && !is_self_net());
export where is_freifunk() || is_dn42() || is_chaos() || is_self_net();
};
### icvpn peerings ###
include "/etc/bird/bird_icvpn.conf";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.