First release
This commit is contained in:
parent
ee0c4f54b2
commit
c71ca190ab
11 changed files with 154 additions and 1 deletions
6
templates/etc/firewalld/services/wireguard.xml
Normal file
6
templates/etc/firewalld/services/wireguard.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<service>
|
||||
<short>WireGuard</short>
|
||||
<description>WireGuard is a virtual private network (VPN) solution. It is used to create encrypted point-to-point tunnels between computers. If you plan to provide a VPN service, enable this option.</description>
|
||||
<port protocol="udp" port="{{ wireguard_port }}"/>
|
||||
</service>
|
||||
14
templates/etc/wireguard.conf.j2
Normal file
14
templates/etc/wireguard.conf.j2
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
[Interface]
|
||||
PrivateKey = {{ wireguard_private_key }}
|
||||
#Address = 10.0.0.1/24
|
||||
DNS = {{ vpn_network }}.1
|
||||
SaveConfig = true
|
||||
ListenPort = {{ wireguard_port }}
|
||||
PostUp = firewall-cmd --add-port {{ wireguard_port }}/udp && firewall-cmd --add-masquerade
|
||||
PostDown = firewall-cmd --remove-port {{ wireguard_port }}/udp && firewall-cmd --remove-masquerade
|
||||
|
||||
[Peer]
|
||||
PublicKey = {{ public_key_files.results[0].stdout }}
|
||||
AllowedIPs = 0.0.0.0/0,::/0
|
||||
Endpoint = {{ ansible_default_ipv4.address }}:{{ vpn_port }}
|
||||
PersistentKeepalive = 20
|
||||
Loading…
Add table
Add a link
Reference in a new issue