„wireguard.yml“ ändern

This commit is contained in:
olli 2023-06-08 09:58:58 +02:00
parent 4ebe911bd7
commit 7d410f66d3

View File

@ -35,7 +35,7 @@
block: | block: |
wireguard wireguard
- name: ufw firewall rules for routing to the Internet - name: ufw firewall rules for ipv6 routing to the Internet
blockinfile: blockinfile:
path: /etc/ufw/before.rules path: /etc/ufw/before.rules
create: yes create: yes
@ -44,6 +44,24 @@
group: root group: root
marker: "# {mark} ANSIBLE MANAGED BLOCK for wireguard" marker: "# {mark} ANSIBLE MANAGED BLOCK for wireguard"
insertbefore: BOF insertbefore: BOF
block: |
*nat
:POSTROUTING ACCEPT - [0:0]
# Route network a192:b168:cd44::/32 (wg0)
-A POSTROUTING -s a192:b168:cd44::/32 -j MASQUERADE
COMMIT
notify:
- Restart ufw
- name: ufw firewall rules for ipv4 routing to the Internet
blockinfile:
path: /etc/ufw/before6.rules
create: yes
mode: "0440"
owner: root
group: root
marker: "# {mark} ANSIBLE MANAGED BLOCK for wireguard"
insertbefore: BOF
block: | block: |
*nat *nat
:POSTROUTING ACCEPT - [0:0] :POSTROUTING ACCEPT - [0:0]
@ -53,6 +71,7 @@
notify: notify:
- Restart ufw - Restart ufw
- name: Allow Routing - name: Allow Routing
community.general.ufw: community.general.ufw:
rule: allow rule: allow
@ -133,11 +152,11 @@
- WGUI_USERNAME=wgadmin - WGUI_USERNAME=wgadmin
- WGUI_MANAGE_START=true - WGUI_MANAGE_START=true
- WGUI_MANAGE_RESTART=true - WGUI_MANAGE_RESTART=true
- WGUI_DNS=46.182.19.48 - WGUI_DNS=2a02:2970:1002::18,46.182.19.48
- WGUI_MTU=1450 - WGUI_MTU=1450
- WGUI_CONFIG_FILE_PATH=/etc/wireguard/wg0.conf - WGUI_CONFIG_FILE_PATH=/etc/wireguard/wg0.conf
- WGUI_LOG_LEVEL=INFO - WGUI_LOG_LEVEL=INFO
- WGUI_SERVER_INTERFACE_ADDRESSES=192.168.44.1/24 - WGUI_SERVER_INTERFACE_ADDRESSES=a192:b168:cd44::1/32,192.168.44.1/24
- WGUI_SERVER_LISTEN_PORT=59666 - WGUI_SERVER_LISTEN_PORT=59666
- WGUI_SERVER_POST_UP_SCRIPT - WGUI_SERVER_POST_UP_SCRIPT
- WGUI_SERVER_POST_DOWN_SCRIPT - WGUI_SERVER_POST_DOWN_SCRIPT