From 521bfd2840544454301720b8746cb0328dc35cd8 Mon Sep 17 00:00:00 2001 From: lhahn Date: Mon, 18 Sep 2023 12:08:56 +0200 Subject: [PATCH] optimize vpn client conf --- templates/etc/wireguard/clients/wireguard-client.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/etc/wireguard/clients/wireguard-client.conf.j2 b/templates/etc/wireguard/clients/wireguard-client.conf.j2 index 1d1b91c..31dd6f0 100644 --- a/templates/etc/wireguard/clients/wireguard-client.conf.j2 +++ b/templates/etc/wireguard/clients/wireguard-client.conf.j2 @@ -1,11 +1,11 @@ [Interface] -Address = {{ vpn_gateway_net_prefix }}.{{ vpn_client.index }}/32 +Address = {{ vpn_gateway_net_prefix }}.{{ vpn_client.index }}/{{ vpn_gateway_net_cidr }} 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 %} +AllowedIPs = {{ vpn_gateway_net_prefix }}{% if vpn_allow_adjacent_client_traffic %}.0/{{ vpn_gateway_net_cidr }}{% else %}.1/32{% endif %} PersistentKeepalive = {{ vpn_keepalive }}