From 975746e7d77035bf8ea25d328ae042b9b117d9ea Mon Sep 17 00:00:00 2001 From: Ruakij Date: Wed, 2 Nov 2022 10:27:06 +0100 Subject: [PATCH] Add IPv6-network to common --- common/defaults/main.yml | 1 + common/tasks/main.yml | 2 ++ common/tasks/networking.yml | 22 ++++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 common/defaults/main.yml create mode 100644 common/tasks/networking.yml diff --git a/common/defaults/main.yml b/common/defaults/main.yml new file mode 100644 index 0000000..830b9b9 --- /dev/null +++ b/common/defaults/main.yml @@ -0,0 +1 @@ +ipv6_stable_secret: 1111:2222:3333:4444:5555:6666:7777:8888 diff --git a/common/tasks/main.yml b/common/tasks/main.yml index e12de46..4ecb976 100644 --- a/common/tasks/main.yml +++ b/common/tasks/main.yml @@ -5,3 +5,5 @@ - import_tasks: ./packages.yml - import_tasks: ./aliases.yml + +- import_tasks: ./networking.yml diff --git a/common/tasks/networking.yml b/common/tasks/networking.yml new file mode 100644 index 0000000..85fc639 --- /dev/null +++ b/common/tasks/networking.yml @@ -0,0 +1,22 @@ +- name: Set sysctl settings for ip-forwarding + copy: + dest: "/etc/sysctl.d/ip-forwarding.conf" + content: | + net.ipv4.ip_forward = 1 + net.ipv6.conf.all.forwarding = 1 + notify: reload_sysctl + +- name: Set sysctl settings for ipv6-address-generation + copy: + dest: "/etc/sysctl.d/ipv6-slaac-address-generation.conf" + content: | + net.ipv6.conf.default.addr_gen_mode = 2 + net.ipv6.conf.default.stable_secret = {{ ipv6_stable_secret }} + notify: reload_sysctl + +- name: Set sysctl settings to override ipv6-slaac with enabled forwarding + copy: + dest: "/etc/sysctl.d/ipv6-slaac-override.conf" + content: | + net.ipv6.conf.all.accept_ra = 2 + notify: reload_sysctl