From 8fef88bb56620b76cdb800b8cc26d4f47c13e952 Mon Sep 17 00:00:00 2001 From: Kyle Lexmond Date: Sat, 28 Dec 2024 21:13:39 +0000 Subject: [PATCH] Specify ipv6 for iptables and ufw rules --- tasks/firewall/iptables.yml | 2 ++ tasks/firewall/ufw.yml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tasks/firewall/iptables.yml b/tasks/firewall/iptables.yml index c1e56fd..accdbb9 100644 --- a/tasks/firewall/iptables.yml +++ b/tasks/firewall/iptables.yml @@ -75,6 +75,7 @@ jump: SNAT action: insert comment: "Perform NAT IPv6 readdressing" + ip_version: ipv6 when: openvpn_server_ipv6_network is defined - name: firewall | iptables | Perform NAT readdressing with MASQUERADE @@ -99,6 +100,7 @@ jump: MASQUERADE action: insert comment: "Perform NAT IPv6 readdressing" + ip_version: ipv6 when: openvpn_server_ipv6_network is defined - name: firewall | iptables | Save existing iptables rule before start iptables service diff --git a/tasks/firewall/ufw.yml b/tasks/firewall/ufw.yml index b3c6ffd..7c02e60 100644 --- a/tasks/firewall/ufw.yml +++ b/tasks/firewall/ufw.yml @@ -49,7 +49,7 @@ - name: firewall | ufw | Setup IPv6 SNAT rules ansible.builtin.blockinfile: - dest: /etc/ufw/before.rules + dest: /etc/ufw/before6.rules state: present insertbefore: \*filter block: | @@ -78,7 +78,7 @@ COMMIT - name: firewall | ufw | Setup IPv6 NAT with MASQUERADE ansible.builtin.blockinfile: - dest: /etc/ufw/before.rules + dest: /etc/ufw/before6.rules state: present insertbefore: \*filter block: |