node.default_unless[:networking][:interfaces][name][:inet][:prefix] = role[:inet][:prefix]
node.default_unless[:networking][:interfaces][name][:inet][:gateway] = role[:inet][:gateway]
node.default_unless[:networking][:interfaces][name][:inet][:routes] = role[:inet][:routes]
+ node.default_unless[:networking][:interfaces][name][:inet][:rules] = role[:inet][:rules]
end
if interface[:inet6] && role[:inet6]
node.default_unless[:networking][:interfaces][name][:inet6][:prefix] = role[:inet6][:prefix]
node.default_unless[:networking][:interfaces][name][:inet6][:gateway] = role[:inet6][:gateway]
node.default_unless[:networking][:interfaces][name][:inet6][:routes] = role[:inet6][:routes]
+ node.default_unless[:networking][:interfaces][name][:inet6][:rules] = role[:inet6][:rules]
end
node.default_unless[:networking][:interfaces][name][:metric] = role[:metric]
[RoutingPolicyRule]
From=<%= @interface[:inet][:address] %>
Table=<%= @interface[:source_route_table] %>
+Priority=1000
<% end -%>
<% end -%>
<% if @interface.dig(:inet6, :gateway) && @interface[:inet6][:gateway] != @interface[:inet6][:address] -%>
[RoutingPolicyRule]
From=<%= @interface[:inet6][:address] %>
Table=<%= @interface[:source_route_table] %>
+Priority=1000
<% end -%>
<% end -%>
<% Hash(@interface.dig(:inet, :routes)).sort.each do |destination, details| -%>
<% end -%>
<% end -%>
<% end -%>
+<% Array(@interface.dig(:inet, :rules)).each do |rule| -%>
+
+[RoutingPolicyRule]
+<% if rule[:from] -%>
+From=<%= rule[:from] %>
+<% end -%>
+<% if rule[:to] -%>
+To=<%= rule[:to] %>
+<% end -%>
+<% if rule[:table] -%>
+Table=<%= rule[:table] %>
+<% end -%>
+<% if rule[:priority] -%>
+Priority=<%= rule[:priority] %>
+<% end -%>
+<% end -%>
+<% Array(@interface.dig(:inet6, :rules)).each do |rule| -%>
+
+[RoutingPolicyRule]
+<% if rule[:from] -%>
+From=<%= rule[:from] %>
+<% end -%>
+<% if rule[:to] -%>
+To=<%= rule[:to] %>
+<% end -%>
+<% if rule[:table] -%>
+Table=<%= rule[:table] %>
+<% end -%>
+<% if rule[:priority] -%>
+Priority=<%= rule[:priority] %>
+<% end -%>
+<% end -%>
:external => {
:zone => "dub",
:inet6 => {
- :routes => {
- "2600:9000::/28" => { :type => "unreachable" }
- }
+ :rules => [
+ { :to => "2600:9000::/28", :table => 150, :priority => 100 }
+ ]
}
}
}