From: Tom Hughes Date: Wed, 8 Jan 2020 14:19:10 +0000 (+0000) Subject: Blackhole unreachable Google IPv6 blocks on equinix machines X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/c1083e2809342f470c7d11b4ecb2858d48230ce8?hp=b20d06e56890ecf6f60df75ee1e20098f6a2e79f Blackhole unreachable Google IPv6 blocks on equinix machines --- diff --git a/cookbooks/networking/recipes/default.rb b/cookbooks/networking/recipes/default.rb index dfa73f196..afdbd7163 100644 --- a/cookbooks/networking/recipes/default.rb +++ b/cookbooks/networking/recipes/default.rb @@ -39,6 +39,7 @@ node[:networking][:interfaces].each do |name, interface| if role[interface[:family]] node.normal[:networking][:interfaces][name][:prefix] = role[interface[:family]][:prefix] node.normal[:networking][:interfaces][name][:gateway] = role[interface[:family]][:gateway] + node.normal[:networking][:interfaces][name][:routes] = role[interface[:family]][:routes] end node.normal[:networking][:interfaces][name][:metric] = role[:metric] @@ -124,6 +125,20 @@ node[:networking][:interfaces].each do |name, interface| ) end end + + if interface[:routes] + interface[:routes].each do |to, parameters| + route = { + "to" => to + } + + route["type"] = parameters[:type] if parameters[:type] + route["via"] = parameters[:via] if parameters[:via] + route["metric"] = parameters[:metric] if parameters[:metric] + + deviceplan["routes"].push(route) + end + end else node.rm(:networking, :interfaces, name) end diff --git a/roles/equinix.rb b/roles/equinix.rb index a35b4775c..7b58f7af7 100644 --- a/roles/equinix.rb +++ b/roles/equinix.rb @@ -19,7 +19,12 @@ default_attributes( }, :inet6 => { :prefix => "64", - :gateway => "2001:978:2:2C::172:1" + :gateway => "2001:978:2:2C::172:1", + :routes => { + "2001:978:2:2c::/64" => { :type => "unreachable" }, + "2001:4860::/32" => { :type => "unreachable" }, + "2a00:1450:4000::/37" => { :type => "unreachable" } + } } } }