add routing

This commit is contained in:
Jean-Marie Mineau 2021-04-22 23:39:58 +02:00
parent 5710b2bf89
commit 763911246e
5 changed files with 24 additions and 0 deletions

View file

@ -3,3 +3,4 @@
- hosts: vpn
roles:
- vpn
- networking

View file

@ -6,3 +6,6 @@ interfaces:
wg0:
ipv4: "172.20.1.2"
netmaskv4: 16
ipv4_forwarding: false
ipv6_forwarding: false

View file

@ -6,3 +6,6 @@ interfaces:
wg0:
ipv4: "172.20.1.3"
netmaskv4: 16
ipv4_forwarding: false
ipv6_forwarding: false

View file

@ -6,3 +6,6 @@ interfaces:
wg0:
ipv4: "172.20.1.1"
netmaskv4: 16
ipv4_forwarding: true
ipv6_forwarding: false

View file

@ -0,0 +1,14 @@
---
- name: Enable ipv4 forwarding
ansible.posix.sysctl:
name: net.ipv4.ip_forward
value: '1'
sysctl_set: true
when: "{{ ipv4_forwarding }}"
- name: Enable ipv6 forwarding
ansible.posix.sysctl:
name: net.ipv6.conf.all.forwarding
value: '1'
sysctl_set: true
when: "{{ ipv6_forwarding }}"