On Sun, Oct 22, 2023 at 05:56:28PM +0200, Pierre Peyronnel wrote: > Hi there, > > Since upgrading from 7.3 to 7.4 my wireguard setup stopped working. > Now, it might be me. Still here's what I have. > > Stripping down wg0.conf, I have this message as soon as I add a [Peer] > section and its public key: > > bsd# cat /etc/wireguard/wg0.conf > > > > [Interface] > > PrivateKey = (hidden by me) > > ListenPort = 51820 > > > > [Peer] > > PublicKey = (hidden by me) > > #PresharedKey = (hidden by me) > > #AllowedIPs = 10.x.x.10/32 > > > > > > # wg setconf wg0 /etc/wireguard/wg0.conf > > Unable to modify interface: Address family not supported by protocol family > > > > Trying to set it up manually, I get the following result: > > > bsd# ifconfig wg0 wgpeer '(hidden by me)' wgpsk '(hidden by me)' wgaip > > '10.x.x.10/32' > > bsd# wg > > interface: wg0 > > public key: (hidden by me) > > private key: (hidden) > > listening port: 51820 > > > > peer: (hidden by me) > > preshared key: (hidden) > > allowed ips: (none) > >
Maybe this 'wg' tool just doesn't display the config correctly? ifconfig wg0 as root displays wgaip settings just fine here. For automatic setup you can set up wg0 via /etc/hostname.wg0, adding all the ifconfig wg0 commands you need on a single line. There is no need to use any files in /etc/wireguard anymore, nor is there a need for a wireguard config tool from packages. My /etc/hostname.wg0 looks like this (except that the random keys and IPs are in fact different): rdomain 1 wgkey "86oHs/awV8nlLe2KKHkMEAhmsRRIA8nLilzHwnFFP8A=" wgpeer "6e0ZhZs/q4R8JZjNTp973DlO0FDRrkCiHAnMinFfn1U=" wgaip 0.0.0.0/0 wgaip ::/0 wgendpoint 10.10.10.10 443 wgpsk "ksorfAqLmd+CteNrc+aNL/q/5ItL6B2qZDllYNEgvqk=" wgpka 25 wgrtable 0 mtu 1332 inet 10.2.2.4/24 inet6 2001:db8::4/64 !/sbin/route -T1 add -inet default 10.2.2.1 !/sbin/route -T1 add -inet6 default 2001:db8::1