Git initial commit

This commit is contained in:
lhahn committed 2023-09-17 10:56:26 +02:00
commit 5bac50269f
11 files changed
+157

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 }}
+1
View File
@@ -0,0 +1 @@
{{ vpn_gateway_private_key }}
+1
View File
@@ -0,0 +1 @@
{{ vpn_gateway_public_key }}
+25
View File
@@ -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 vpn_client in vpn_clients %}
## vpn {{ cloud_name }} - {{ vpn_client.name }} ##
[Peer]
PublicKey = {{ vpn_client.public_key }}
AllowedIPs = {{ vpn_gateway_net_prefix }}.{{ vpn_client.index }}/32
{% endfor %}