route anon1 over upstream1

This commit is contained in:
Astro 2018-06-18 23:21:15 +02:00
parent 2c8f10b2e7
commit c8b7519948
3 changed files with 3 additions and 3 deletions

View File

@ -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:

View File

@ -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'] %}

View File

@ -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