diff options
| author | Paul Buetow <paul@buetow.org> | 2025-05-03 18:03:53 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-05-03 18:03:53 +0300 |
| commit | cc92b6d7ab12b8e0eee9fdb2a49687aeffd5716b (patch) | |
| tree | f24ab5336c2f26361bc6e99436bc870277c99dc5 | |
| parent | cdcaeaa74d656a52e865bbbc1ffdb8a2bc37245e (diff) | |
more on this
| -rw-r--r-- | README.md | 8 | ||||
| -rw-r--r-- | wireguardmeshgenerator.rb | 8 | ||||
| -rw-r--r-- | wireguardmeshgenerator.yaml | 4 |
3 files changed, 17 insertions, 3 deletions
@@ -80,6 +80,14 @@ https://github.com/angristan/wireguard-install/discussions/499 https://docs.vultr.com/install-wireguard-vpn-server-on-openbsd-7-0 ```sh +blowfish$ doas pkg_add wireguard-tools +blowfish$ doas mkdir /etc/wireguard +blowfish$ doas touch /etc/wireguard/wg0.conf +blowsish$ cat <<END | doas tee /etc/hostname.wg0 +inet 192.168.2.110 255.255.255.0 NONE +up +!/usr/local/bin/wg setconf wg0 /etc/wireguard/wg0.conf +END ``` ### Install the config diff --git a/wireguardmeshgenerator.rb b/wireguardmeshgenerator.rb index 5b6236c..0f7b5eb 100644 --- a/wireguardmeshgenerator.rb +++ b/wireguardmeshgenerator.rb @@ -78,7 +78,7 @@ WireguardConfig = Struct.new(:myself, :hosts) do <<~CONF [Interface] # #{myself}.#{hosts[myself]['wg0']['domain']} - Address = #{hosts[myself]['wg0']['ip']} + #{address} PrivateKey = #{keytool.priv} ListenPort = 56709 @@ -101,6 +101,12 @@ WireguardConfig = Struct.new(:myself, :hosts) do private + def address + return '# No Address = ... for OpenBSD here' if hosts[myself]['os'] == 'OpenBSD' + + "Address = #{hosts[myself]['wg0']['ip']}" + end + def peers excluded = hosts[myself].fetch('exclude_peers', []) << myself i_am_in_lan = hosts[myself].key?('lan') diff --git a/wireguardmeshgenerator.yaml b/wireguardmeshgenerator.yaml index 26a6526..ea9956b 100644 --- a/wireguardmeshgenerator.yaml +++ b/wireguardmeshgenerator.yaml @@ -87,7 +87,7 @@ hosts: user: rex conf_dir: /etc/wireguard sudo_cmd: doas - reload_cmd: rcctl reload wireguard + reload_cmd: sh /etc/netstart wg0 internet: domain: 'buetow.org' ip: '23.88.35.144' @@ -101,7 +101,7 @@ hosts: user: rex conf_dir: /etc/wireguard sudo_cmd: doas - reload_cmd: rcctl reload wireguard + reload_cmd: sh /etc/netstart wg0 internet: domain: 'buetow.org' ip: '46.23.94.99' |
