bird: add flag $gw_do_ic_peering
This commit is contained in:
parent
fd78f0bdfc
commit
303d8fd785
|
@ -1,4 +1,4 @@
|
|||
class ff_gw($mesh_mac, $gw_ipv4, $gw_ipv6, $secret_key, $dhcprange_start, $dhcprange_end) {
|
||||
class ff_gw($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': }
|
||||
|
@ -29,6 +29,7 @@ class ff_gw($mesh_mac, $gw_ipv4, $gw_ipv6, $secret_key, $dhcprange_start, $dhcpr
|
|||
class { 'ff_gw::bird':
|
||||
own_ipv4 => $gw_ipv4,
|
||||
own_ipv6 => $gw_ipv6,
|
||||
gw_do_ic_peering => $gw_do_ic_peering,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -419,7 +420,7 @@ exit 0';
|
|||
}
|
||||
}
|
||||
|
||||
class ff_gw::bird($own_ipv4, $own_ipv6, $version = 'present') {
|
||||
class ff_gw::bird($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")
|
||||
|
|
|
@ -141,3 +141,11 @@ protocol bgp <%= key %> from <%= hash["template"] %> {
|
|||
neighbor <%= hash["ip"] %> as <%= hash["as"] %>;
|
||||
};
|
||||
<% end -%><% end -%>
|
||||
|
||||
<% if @gw_do_ic_peering -%>
|
||||
<% @ic_peerings_v4.each_pair do |key, hash| -%><% if hash["ip"] != @own_ipv4 -%>
|
||||
protocol bgp <%= key %> from <%= hash["template"] %> {
|
||||
neighbor <%= hash["ip"] %> as <%= hash["as"] %>;
|
||||
};
|
||||
<% end -%><% end -%>
|
||||
<% end -%>
|
||||
|
|
|
@ -77,3 +77,11 @@ protocol bgp <%= key %> from <%= hash["template"] %> {
|
|||
neighbor <%= hash["ip"] %> as <%= hash["as"] %>;
|
||||
};
|
||||
<% end -%><% end -%>
|
||||
|
||||
<% if @gw_do_ic_peering -%>
|
||||
<% @ic_peerings_v6.each_pair do |key, hash| -%><% if hash["ip"] != @own_ipv6 -%>
|
||||
protocol bgp <%= key %> from <%= hash["template"] %> {
|
||||
neighbor <%= hash["ip"] %> as <%= hash["as"] %>;
|
||||
};
|
||||
<% end -%><% end -%>
|
||||
<% end -%>
|
||||
|
|
Loading…
Reference in a new issue