routing: enable ipv4 networking and bind ip's to ifaces

This commit is contained in:
Johanna Dorothea Reichmann 2020-03-05 15:39:58 +01:00
parent 7e69ae99d1
commit 6b9686d689
Signed by: transcaffeine
GPG Key ID: 03624C433676E465

View File

@ -0,0 +1,16 @@
---
- name: enable ipv4 forwarding
shell: echo 1 > /proc/sys/net/ipv4/ip_forward
- name: ensure ipv4 forwarding is always enabled (enabled in permanent config)
lineinfile:
path: /etc/sysctl.conf
regexp: '^net\.ipv4\.ip_forward'
line: net.ipv4.ip_forward=1
- name: bind ip addresses of each subnet to interface
shell: ip addr add {{ item.ip }}/{{ item.subnet }} dev {{ item.iface }}
with_items: "{{ subnets }}"