2 Name=<%= @interface[:interface] %>
5 <% if @interface.dig(:inet6, :dhcp) -%>
8 <% if @interface[:inet] -%>
9 Address=<%= @interface[:inet][:address] %>/<%== @interface[:inet][:prefix] %>
11 <% if @interface[:inet6] -%>
12 Address=<%= @interface[:inet6][:address] %>/<%== @interface[:inet6][:prefix] %>
15 <% Array(@interface[:vlans]).sort.uniq.each do |vlan| -%>
16 VLAN=<%= @interface[:interface] %>.<%= vlan %>
18 <% if @interface[:interface] =~ /^bond\d+$/ && node[:packages][:systemd][:version].to_i < 254 -%>
21 RequiredFamilyForOnline=ipv4
22 RequiredForOnline=degraded-carrier
24 <% if @interface.dig(:inet6, :dhcp) -%>
27 <% if @interface[:inet6][:dhcp][:duidtype] -%>
28 DUIDType=<%= @interface[:inet6][:dhcp][:duidtype] %>
30 <% if @interface[:inet6][:dhcp][:duidrawdata] -%>
31 DUIDRawData=<%= @interface[:inet6][:dhcp][:duidrawdata] %>
35 <% if @interface.dig(:inet, :gateway) && @interface[:inet][:gateway] != @interface[:inet][:address] -%>
38 Gateway=<%= @interface[:inet][:gateway] %>
40 <% if @interface[:metric] -%>
41 Metric=<%= @interface[:metric] %>
43 <% if @interface[:source_route_table] -%>
46 Gateway=<%= @interface[:inet][:gateway] %>
48 <% if @interface[:metric] -%>
49 Metric=<%= @interface[:metric] %>
51 Table=<%= @interface[:source_route_table] %>
54 From=<%= @interface[:inet][:address] %>
55 Table=<%= @interface[:source_route_table] %>
58 <% if @interface.dig(:inet6, :gateway) && @interface[:inet6][:gateway] != @interface[:inet6][:address] -%>
61 Gateway=<%= @interface[:inet6][:gateway] %>
63 <% if @interface[:metric] -%>
64 Metric=<%= @interface[:metric] %>
66 <% if @interface[:source_route_table] -%>
69 Gateway=<%= @interface[:inet6][:gateway] %>
71 <% if @interface[:metric] -%>
72 Metric=<%= @interface[:metric] %>
74 Table=<%= @interface[:source_route_table] %>
77 From=<%= @interface[:inet6][:address] %>
78 Table=<%= @interface[:source_route_table] %>
81 <% Hash(@interface.dig(:inet, :routes)).sort.each do |destination, details| -%>
82 <% unless details[:via] == @interface[:inet][:address] -%>
85 <% if details[:via] -%>
86 Gateway=<%= details[:via] %>
88 Destination=<%= destination %>
89 <% if details[:metric] -%>
90 Metric=<%= details[:metric] %>
92 <% if details[:type] -%>
93 Type=<%= details[:type] %>
97 <% Hash(@interface.dig(:inet6, :routes)).sort.each do |destination, details| -%>
98 <% unless details[:via] == @interface[:inet6][:address] -%>
101 <% if details[:via] -%>
102 Gateway=<%= details[:via] %>
104 Destination=<%= destination %>
105 <% if details[:metric] -%>
106 Metric=<%= details[:metric] %>
108 <% if details[:type] -%>
109 Type=<%= details[:type] %>