Add some further config variables

special repository for bird is used to get bird 1.4.x
This commit is contained in:
ohrensessel 2014-04-26 14:46:32 +02:00
parent 7cbf9a331a
commit 1e095dd4fb
4 changed files with 24 additions and 15 deletions

View file

@ -58,6 +58,14 @@ class { 'ff_gw':
}
},
# freifunk config
# the network assigned to the ff community
ff_net => '10.112.0.0/16',
# the network actually used in the mesh might be smaller than ff_net
ff_mesh_net => '10.112.0.0/18',
# as number for icvpn peering
ff_as => '65112',
# network config (example data for gw12)
mesh_mac => 'de:ad:be:ef:01:14',
gw_ipv4 => '10.112.30.1',

View file

@ -2,35 +2,27 @@ peerings_v4:
srv01:
template: bgp_ibgp
ip: 10.112.1.1
as: 65112
hamburg01:
template: bgp_ibgp
ip: 10.112.14.1
as: 65112
hamburg05:
template: bgp_ibgp
ip: 10.112.18.1
as: 65112
hamburg07:
template: bgp_ibgp
ip: 10.112.16.1
as: 65112
hamburg08:
template: bgp_ibgp
ip: 10.112.22.1
as: 65112
hamburg09:
template: bgp_ibgp
ip: 10.112.24.1
as: 65112
hamburg11:
template: bgp_ibgp
ip: 10.112.28.1
as: 65112
hamburg12:
template: bgp_ibgp
ip: 10.112.30.1
as: 65112
# TODO: add this as a second param for intercity gateways
ic_peerings_v4:

View file

@ -1,4 +1,4 @@
class ff_gw($mesh_mac, $gw_ipv4, $gw_ipv6, $secret_key, $dhcprange_start, $dhcprange_end, $gw_do_ic_peering = false) {
class ff_gw($ff_net, $ff_mesh_net, $ff_as, $mesh_mac, $gw_ipv4, $gw_ipv6, $secret_key, $dhcprange_start, $dhcprange_end, $gw_do_ic_peering = false) {
class { 'ff_gw::apt': }
->
class { 'ff_gw::software': }
@ -27,6 +27,9 @@ class ff_gw($mesh_mac, $gw_ipv4, $gw_ipv6, $secret_key, $dhcprange_start, $dhcpr
class { 'ff_gw::dnsmasq': }
->
class { 'ff_gw::bird':
ff_net => $ff_net,
ff_mesh_net => $ff_mesh_net,
ff_as => $ff_as,
own_ipv4 => $gw_ipv4,
own_ipv6 => $gw_ipv6,
gw_do_ic_peering => $gw_do_ic_peering,
@ -45,6 +48,12 @@ class ff_gw::apt() {
key => 'AB7A88C5B89033D8',
key_server => 'pgpkeys.mit.edu',
}
# bird repo
apt::source { 'bird-network':
location => 'http://bird.network.cz/debian/',
release => 'wheezy',
repos => 'main',
}
}
class ff_gw::software {
@ -424,7 +433,7 @@ exit 0';
}
}
class ff_gw::bird($own_ipv4, $own_ipv6, $gw_do_ic_peering, $version = 'present') {
class ff_gw::bird($ff_net, $ff_mesh_net, $ff_as, $own_ipv4, $own_ipv6, $gw_do_ic_peering, $version = 'present') {
# read peering data from data file
$module_path = get_module_path($module_name)
$peeringdata = loadyaml("${module_path}/data/peering.yaml")

View file

@ -2,7 +2,7 @@ table ibgp; # internal BGP peerings
table ebgp; # external (icvpn) BGP peerings
table freifunk; # kernel table 42 for routing from ff network
define ownas = 65112;
define ownas = <%= @ff_as %>;
router id <%= @own_ipv4 %>;
@ -10,7 +10,7 @@ router id <%= @own_ipv4 %>;
# own network
function is_self_net() {
return (net ~ [10.112.0.0/16+]);
return (net ~ [<%= @ff_net %>+]);
}
# freifunk ip ranges in general
@ -115,14 +115,14 @@ protocol static unreachable_default {
};
protocol static static_ffhh {
route 10.112.0.0/16 reject;
route <%= @ff_net %> reject;
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";
route <%= @ff_mesh_net %> via "br-ffhh";
table freifunk;
};
@ -155,7 +155,7 @@ template bgp peers {
<% @peerings_v4.each_pair do |key, hash| -%><% if hash["ip"] != @own_ipv4 -%>
protocol bgp <%= key %> from <%= hash["template"] %> {
neighbor <%= hash["ip"] %> as <%= hash["as"] %>;
neighbor <%= hash["ip"] %> as ownas;
};
<% end -%><% end -%>