enabled IP forwarding

This commit is contained in:
2024-11-20 19:45:40 +01:00
parent 20469486fe
commit c7e857aa4e

View File

@@ -31,6 +31,15 @@
name: "wg-quick@{{ wg_interface }}"
state: started
enabled: true
- name: enable IP forwarding
lineinfile:
path: /etc/sysctl.conf
regexp: "{{ item }}"
line: "{{ item }}=1"
with_items:
- net.ipv4.ip_forward
- net.ipv6.conf.all.forwarding
notify: reload sysconfig
handlers:
- name: read wg config
service:
@@ -40,6 +49,8 @@
# command: "wg setconf {{ wg_interface }} /etc/wireguard/{{ wg_interface }}.conf"
# - name: reload interface
# shell: "ifdown {{ wg_interface }}; ifup {{ wg_interface }}"
- name: reload sysconfig
command: sysctl -p /etc/sysctl.conf
- name: Generate client configs
hosts: localhost
tasks: