Renew to wireguard
This commit is contained in:
1 parent
ad72dc2817
commit
baf26860e6
12 files changed
+108
-263
No files matched your search
@@ -0,0 +1,11 @@
|
||||
[Interface]
|
||||
Address = {{ vpn_gateway_net_prefix }}.{{ vpn_client.index }}/32
|
||||
PrivateKey = {{ vpn_client.private_key }}
|
||||
DNS = {{ vpn_internal_dns }}
|
||||
|
||||
[Peer]
|
||||
PublicKey = {{ vpn_gateway_public_key }}
|
||||
Endpoint = {{ vpn_gateway_host }}:{{ vpn_gateway_port }}
|
||||
AllowedIPs = {{ vpn_gateway_net_prefix }}.1/{% if vpn_allow_adjacent_client_traffic %}{{ vpn_gateway_net_cidr }}{% else %}32{% endif %}
|
||||
|
||||
PersistentKeepalive = {{ vpn_keepalive }}
|
||||
@@ -0,0 +1 @@
|
||||
{{ vpn_gateway_private_key }}
|
||||
@@ -0,0 +1 @@
|
||||
{{ vpn_gateway_public_key }}
|
||||
@@ -0,0 +1,25 @@
|
||||
[Interface]
|
||||
Address = {{ vpn_gateway_net_prefix }}.1/{{ vpn_gateway_net_cidr }}
|
||||
ListenPort = {{ vpn_gateway_port }}
|
||||
PrivateKey = {{ vpn_gateway_private_key }}
|
||||
|
||||
{% if vpn_gateway_forward is defined and vpn_gateway_forward | length > 0 %}
|
||||
PreUp = sysctl -w net.ipv4.ip_forward=1
|
||||
PreUp = sysctl -w net.ipv6.conf.all.forwarding=1
|
||||
|
||||
{% for config in vpn_gateway_forward %}
|
||||
PreUp = iptables -t nat -A PREROUTING -i {{ vpn_gateway_interface }} -p {{ config.protocol | default('tcp') }} --dport {{ config.server_port }} -j DNAT --to-destination {{ vpn_gateway_net_prefix }}.{{ config.client_index }}:{{ config.client_port }}
|
||||
PostDown = iptables -t nat -D PREROUTING -i {{ vpn_gateway_interface }} -p {{ config.protocol | default('tcp') }} --dport {{ config.server_port }} -j DNAT --to-destination {{ vpn_gateway_net_prefix }}.{{ config.client_index }}:{{ config.client_port }}
|
||||
|
||||
{% endfor %}
|
||||
PreUp = iptables -t nat -A POSTROUTING -o {{ cloud_name }} -j MASQUERADE
|
||||
PostDown = iptables -t nat -D POSTROUTING -o {{ cloud_name }} -j MASQUERADE
|
||||
{% endif %}
|
||||
|
||||
{% for client in vpn_clients %}
|
||||
## vpn {{ cloud_name }} - {{ client }} ##
|
||||
[Peer]
|
||||
PublicKey = {{ vpn_clients[client].public_key }}
|
||||
AllowedIPs = {{ vpn_gateway_net_prefix }}.{{ vpn_clients[client].index }}/32
|
||||
|
||||
{% endfor %}
|
||||
Reference in new issue
Block a user