From 534043ca66b46815b0338475a60ad0fac4a90323 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 5 Mar 2023 09:35:57 +0000 Subject: [PATCH] Limit NAT to IPv4 interfaces --- cookbooks/networking/templates/default/nftables.conf.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbooks/networking/templates/default/nftables.conf.erb b/cookbooks/networking/templates/default/nftables.conf.erb index 86ead58cf..a3dae7143 100644 --- a/cookbooks/networking/templates/default/nftables.conf.erb +++ b/cookbooks/networking/templates/default/nftables.conf.erb @@ -145,8 +145,8 @@ table ip nat { chain postrouting { type nat hook postrouting priority srcnat; -<%- node.interfaces(:role => :external).each do |external| %> -<%- node.interfaces(:role => :internal).each do |internal| %> +<%- node.interfaces(:role => :external, :family => :inet).each do |external| %> +<%- node.interfaces(:role => :internal, :family => :inet).each do |internal| %> oif { <%= external[:interface] %> } ip saddr { <%= internal[:network] %>/<%= internal[:prefix] %> } snat <%= external[:address] %> <%- end %> <%- end %> -- 2.39.5