add routing
This commit is contained in:
parent
5710b2bf89
commit
763911246e
5 changed files with 24 additions and 0 deletions
|
@ -3,3 +3,4 @@
|
||||||
- hosts: vpn
|
- hosts: vpn
|
||||||
roles:
|
roles:
|
||||||
- vpn
|
- vpn
|
||||||
|
- networking
|
||||||
|
|
|
@ -6,3 +6,6 @@ interfaces:
|
||||||
wg0:
|
wg0:
|
||||||
ipv4: "172.20.1.2"
|
ipv4: "172.20.1.2"
|
||||||
netmaskv4: 16
|
netmaskv4: 16
|
||||||
|
|
||||||
|
ipv4_forwarding: false
|
||||||
|
ipv6_forwarding: false
|
||||||
|
|
|
@ -6,3 +6,6 @@ interfaces:
|
||||||
wg0:
|
wg0:
|
||||||
ipv4: "172.20.1.3"
|
ipv4: "172.20.1.3"
|
||||||
netmaskv4: 16
|
netmaskv4: 16
|
||||||
|
|
||||||
|
ipv4_forwarding: false
|
||||||
|
ipv6_forwarding: false
|
||||||
|
|
|
@ -6,3 +6,6 @@ interfaces:
|
||||||
wg0:
|
wg0:
|
||||||
ipv4: "172.20.1.1"
|
ipv4: "172.20.1.1"
|
||||||
netmaskv4: 16
|
netmaskv4: 16
|
||||||
|
|
||||||
|
ipv4_forwarding: true
|
||||||
|
ipv6_forwarding: false
|
||||||
|
|
14
roles/networking/tasks/main.yml
Normal file
14
roles/networking/tasks/main.yml
Normal 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 }}"
|
Loading…
Reference in a new issue