diff --git a/salt/vpn/openvpn.sls b/salt/vpn/openvpn.sls index 0df7f00..c7d460c 100644 --- a/salt/vpn/openvpn.sls +++ b/salt/vpn/openvpn.sls @@ -10,7 +10,7 @@ hostroutes-{{ name }}: {%- for a in salt.dnsutil.A(conf['server']) %} - ipaddr: {{ a }} netmask: 255.255.224.0 - gateway: {{ pillar['hosts-inet']['core']['upstream2'] }} + gateway: {{ pillar['hosts-inet']['core']['upstream1'] }} {%- endfor %} /etc/openvpn/{{ name }}.conf: diff --git a/salt/wireguard/init.sls b/salt/wireguard/init.sls index 0343400..ff187ab 100644 --- a/salt/wireguard/init.sls +++ b/salt/wireguard/init.sls @@ -6,7 +6,7 @@ wireguard-tools: - source: salt://wireguard/wireguard.service - template: 'jinja' - context: - gateway: {{ pillar['hosts-inet']['core']['upstream2'] }} + gateway: {{ pillar['hosts-inet']['core']['upstream1'] }} endpoints: {%- for instance, conf in pillar['wireguard-instances'].items() %} {%- for peer in conf['peers'] %} diff --git a/salt/wireguard/wireguard.service b/salt/wireguard/wireguard.service index e64be40..2ff9698 100644 --- a/salt/wireguard/wireguard.service +++ b/salt/wireguard/wireguard.service @@ -5,7 +5,7 @@ PartOf=wireguard.service [Service] Type=oneshot {%- for endpoint in endpoints %} -ExecStart=-/bin/ip route add {{ endpoint }} via {{ gateway }} +ExecStart=-/bin/ip route add {{ endpoint }}/32 via {{ gateway }} {%- endfor %} ExecStart=/usr/bin/wg-quick up /etc/wireguard/%i.conf ExecStop=/usr/bin/wg-quick down /etc/wireguard/%i.conf