X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/7ef879d12f2d2b0424d3d35cd96b604cb70e312c..58616268564ac6eb6ff6ecaa232c6f7f9dce819d:/cookbooks/networking/templates/default/network.erb diff --git a/cookbooks/networking/templates/default/network.erb b/cookbooks/networking/templates/default/network.erb index ea414bd37..796bf67d6 100644 --- a/cookbooks/networking/templates/default/network.erb +++ b/cookbooks/networking/templates/default/network.erb @@ -2,6 +2,9 @@ Name=<%= @interface[:interface] %> [Network] +<% if @interface.dig(:inet6, :dhcp) -%> +DHCP=ipv6 +<% end -%> <% if @interface[:inet] -%> Address=<%= @interface[:inet][:address] %>/<%== @interface[:inet][:prefix] %> <% end -%> @@ -12,6 +15,17 @@ IPv6AcceptRA=no <% Array(@interface[:vlans]).sort.uniq.each do |vlan| -%> VLAN=<%= @interface[:interface] %>.<%= vlan %> <% end -%> +<% if @interface.dig(:inet6, :dhcp) -%> + +[DHCPv6] +<% if @interface[:inet6][:dhcp][:duidtype] -%> +DUIDType=<%= @interface[:inet6][:dhcp][:duidtype] %> +<% end -%> +<% if @interface[:inet6][:dhcp][:duidrawdata] -%> +DUIDRawData=<%= @interface[:inet6][:dhcp][:duidrawdata] %> +<% end -%> +WithoutRA=solicit +<% end -%> <% if @interface.dig(:inet, :gateway) && @interface[:inet][:gateway] != @interface[:inet][:address] -%> [Route] @@ -20,6 +34,20 @@ GatewayOnLink=true <% if @interface[:metric] -%> Metric=<%= @interface[:metric] %> <% end -%> +<% if @interface[:source_route_table] -%> + +[Route] +Gateway=<%= @interface[:inet][:gateway] %> +GatewayOnLink=true +<% if @interface[:metric] -%> +Metric=<%= @interface[:metric] %> +<% end -%> +Table=<%= @interface[:source_route_table] %> + +[RoutingPolicyRule] +From=<%= @interface[:inet][:address] %> +Table=<%= @interface[:source_route_table] %> +<% end -%> <% end -%> <% if @interface.dig(:inet6, :gateway) && @interface[:inet6][:gateway] != @interface[:inet6][:address] -%> @@ -29,8 +57,23 @@ GatewayOnLink=true <% if @interface[:metric] -%> Metric=<%= @interface[:metric] %> <% end -%> +<% if @interface[:source_route_table] -%> + +[Route] +Gateway=<%= @interface[:inet6][:gateway] %> +GatewayOnLink=true +<% if @interface[:metric] -%> +Metric=<%= @interface[:metric] %> +<% end -%> +Table=<%= @interface[:source_route_table] %> + +[RoutingPolicyRule] +From=<%= @interface[:inet6][:address] %> +Table=<%= @interface[:source_route_table] %> +<% end -%> <% end -%> <% Hash(@interface.dig(:inet, :routes)).sort.each do |destination, details| -%> +<% unless details[:via] == @interface[:inet][:address] -%> [Route] <% if details[:via] -%> @@ -44,7 +87,9 @@ Metric=<%= details[:metric] %> Type=<%= details[:type] %> <% end -%> <% end -%> +<% end -%> <% Hash(@interface.dig(:inet6, :routes)).sort.each do |destination, details| -%> +<% unless details[:via] == @interface[:inet6][:address] -%> [Route] <% if details[:via] -%> @@ -58,3 +103,4 @@ Metric=<%= details[:metric] %> Type=<%= details[:type] %> <% end -%> <% end -%> +<% end -%>