X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/318c337ccc883d77d9bed297c01f29a40280e927..58616268564ac6eb6ff6ecaa232c6f7f9dce819d:/cookbooks/networking/templates/default/network.erb diff --git a/cookbooks/networking/templates/default/network.erb b/cookbooks/networking/templates/default/network.erb index 431330e2c..796bf67d6 100644 --- a/cookbooks/networking/templates/default/network.erb +++ b/cookbooks/networking/templates/default/network.erb @@ -34,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] -%> @@ -43,6 +57,20 @@ 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] -%>