Mercurial > code > home > repos > infra
changeset 251:33d2de3d7e70
wg fixes
author | drewp@bigasterisk.com |
---|---|
date | Mon, 08 Jan 2024 18:40:51 -0800 |
parents | 17811a892951 |
children | b97de8433fe1 |
files | net.py templates/hosts.j2 templates/wireguard/wg0.conf.j2 |
diffstat | 3 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/net.py Mon Jan 08 18:39:32 2024 -0800 +++ b/net.py Mon Jan 08 18:40:51 2024 -0800 @@ -97,5 +97,9 @@ create_remote_dir=True, ) apt.packages(packages=['network-manager'], present=False) + + systemd.service(service='systemd-networkd.service', enabled=True, running=True, restarted=True) - systemd.service(service='systemd-networkd.service', enabled=True, running=True, restarted=True) + # TODO this breaks wg on garage, i think. workaround: + if host.name == 'garage': + server.shell('ip -4 address add 10.5.0.14/24 dev wg0') \ No newline at end of file
--- a/templates/hosts.j2 Mon Jan 08 18:39:32 2024 -0800 +++ b/templates/hosts.j2 Mon Jan 08 18:40:51 2024 -0800 @@ -11,7 +11,13 @@ ff02::2 ip6-allrouters -{% if host.name in ['prime', 'piedmont'] %} +{% if host.name in ['prime', 'plus'] %} 10.5.0.1 bang bang.bigasterisk.com bang5 bang5.bigasterisk.com 10.5.0.7 ditto ditto.bigasterisk.com ditto5 ditto5.bigasterisk.com +10.5.0.5 dash {% endif %} + +{% if host.name in ['prime'] %} +# for wireguard setup: +127.0.0.1 public.bigasterisk.com +{% endif %}
--- a/templates/wireguard/wg0.conf.j2 Mon Jan 08 18:39:32 2024 -0800 +++ b/templates/wireguard/wg0.conf.j2 Mon Jan 08 18:40:51 2024 -0800 @@ -21,7 +21,7 @@ {% elif host.name == 'prime' %} {{ peer_block('ditto', '10.5.0.0/24') }} {{ peer_block('drew-note10', '10.5.0.112/32') }} - {{ peer_block('plus', '10.5.0.110/32') }} + {{ peer_block('plus', '10.5.0.110/32', 'public.bigasterisk.com:1195') }} {% elif host.name == 'plus' %} {{ peer_block('ditto', '10.5.0.0/24', 'ditto:1195', 50) }} {% else %}