X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/faa2a90a9faad75ac0b94af188fbc9b742fee47a..d51169137e4f79bbe3aba52be72071d11dd27127:/cookbooks/networking/templates/default/network.erb diff --git a/cookbooks/networking/templates/default/network.erb b/cookbooks/networking/templates/default/network.erb index e937964f6..431330e2c 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] @@ -31,10 +45,11 @@ Metric=<%= @interface[:metric] %> <% end -%> <% end -%> <% Hash(@interface.dig(:inet, :routes)).sort.each do |destination, details| -%> +<% unless details[:via] == @interface[:inet][:address] -%> [Route] -<% if details[:gateway] -%> -Gateway=<%= details[:gateway] %> +<% if details[:via] -%> +Gateway=<%= details[:via] %> <% end -%> Destination=<%= destination %> <% if details[:metric] -%> @@ -44,11 +59,13 @@ 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[:gateway] -%> -Gateway=<%= details[:gateway] %> +<% if details[:via] -%> +Gateway=<%= details[:via] %> <% end -%> Destination=<%= destination %> <% if details[:metric] -%> @@ -58,3 +75,4 @@ Metric=<%= details[:metric] %> Type=<%= details[:type] %> <% end -%> <% end -%> +<% end -%>