From bd68c437e35f2d31744cca10a8575f8adfe4bda1 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Tue, 14 Apr 2020 20:48:54 +0000 Subject: [PATCH] docker: Add ipv6 nat --- roles/docker/files/daemon.json | 2 ++ roles/docker/tasks/config.yml | 3 +++ roles/docker/tasks/packages.yml | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/roles/docker/files/daemon.json b/roles/docker/files/daemon.json index 9faa846..c8165fa 100644 --- a/roles/docker/files/daemon.json +++ b/roles/docker/files/daemon.json @@ -1,4 +1,6 @@ { + "ipv6": true, + "fixed-cidr-v6": "fd00:d0ce:d0ce:d0ce::/64", "dns": [ "46.182.19.48", "74.82.42.42" diff --git a/roles/docker/tasks/config.yml b/roles/docker/tasks/config.yml index bc8fddc..a402aca 100644 --- a/roles/docker/tasks/config.yml +++ b/roles/docker/tasks/config.yml @@ -1,4 +1,7 @@ --- +- name: Add IPv6 NAT iptables rules + shell: ip6tables -t nat -A POSTROUTING -s fd00:d0ce:d0ce:d0ce::/64 -j MASQUERADE && ip6tables-save > /etc/iptables/rules.v6 + - name: add docker configuration copy: dest: /etc/docker/daemon.json diff --git a/roles/docker/tasks/packages.yml b/roles/docker/tasks/packages.yml index b6ffdb6..67956e4 100644 --- a/roles/docker/tasks/packages.yml +++ b/roles/docker/tasks/packages.yml @@ -19,3 +19,8 @@ name: "docker-ce" update_cache: yes state: present + +- name: install iptables-persistent + apt: + name: iptables-persistent + state: present