X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/89142473eefb6cc4409dbbd0da6f004b38e8dd8f..d51169137e4f79bbe3aba52be72071d11dd27127:/cookbooks/networking/templates/default/nftables.conf.erb diff --git a/cookbooks/networking/templates/default/nftables.conf.erb b/cookbooks/networking/templates/default/nftables.conf.erb index 74d104fad..7273cff5e 100644 --- a/cookbooks/networking/templates/default/nftables.conf.erb +++ b/cookbooks/networking/templates/default/nftables.conf.erb @@ -12,15 +12,15 @@ define ip6-multicast-addresses = { ff00::/8 } table inet chef-filter { set ip-osm-addresses { type ipv4_addr -<% unless Array(@hosts["inet"]).empty? -%> - elements = { <%= Array(@hosts["inet"]).sort.join(", ") %> } +<% unless Array(@hosts[:inet]).empty? -%> + elements = { <%= Array(@hosts[:inet]).sort.join(", ") %> } <% end -%> } set ip6-osm-addresses { type ipv6_addr -<% unless Array(@hosts["inet"]).empty? -%> - elements = { <%= Array(@hosts["inet6"]).sort.join(", ") %> } +<% unless Array(@hosts[:inet6]).empty? -%> + elements = { <%= Array(@hosts[:inet6]).sort.join(", ") %> } <% end -%> } @@ -164,9 +164,9 @@ table ip chef-nat { chain postrouting { type nat hook postrouting priority srcnat; -<% node.interfaces(:role => :external, :family => :inet).each do |external| -%> -<% node.interfaces(:role => :internal, :family => :inet).each do |internal| -%> - oifname { <%= external[:interface] %> } ip saddr { <%= internal[:network] %>/<%= internal[:prefix] %> } snat <%= external[:address] %> +<% node.interfaces(:role => :external).each do |external| -%> +<% node.ipaddresses(:role => :internal, :family => :inet).each do |internal| -%> + oifname { <%= external[:interface] %> } ip saddr { <%= internal.subnet %> } snat <%= external[:inet][:address] %> <% end -%> <% end -%> }