Wireguard VPN problem - setting interface address without mask is no longer supported

On my FreeBSD desktop computer I'm using a commercial vpn server via wireguard for years without any problem.
Unfortunately the vpn does not work anymore on FreeBSD 15. On FreeBSD 14.3 the vpn is still working fine.

At the time I want to create the wireguard connection I get the following error message:

Code:
Trying to create the wireguard interface...
[#] ifconfig wg create name pia
[#] wg setconf pia /dev/stdin
[#] ifconfig pia inet 10.237.2.137 alias
ifconfig: ERROR: setting interface address without mask is no longer supported.
[#] ifconfig pia destroy

Does someone know how I can fix this?
 
E.g.:
Code:
[#] ifconfig pia inet 10.237.2.137/24 alias

ifconfig(8)
Code:
EXAMPLES
     Assign the IPv4 address 192.0.2.10, with a network mask of 255.255.255.0,
     to the interface em0:
           # ifconfig em0 inet 192.0.2.10 netmask 255.255.255.0

     Add the IPv4 address 192.0.2.45, with the CIDR network prefix /28, to the
     interface em0:
           # ifconfig em0 inet 192.0.2.45/28 alias
 
Thank you T-Daemon. With your post about the CIDR network prefix you got me on the right track.

In case someone uses pia-vpn with wireguard and comes across this thread in the future.

The file connect_to_wireguard_with_token.sh needs to be fixed as of FreeBSD 15.0.
Change line 135: Address = $(echo "$wireguard_json" | jq -r '.peer_ip')
to 135: Address = $(echo "$wireguard_json" | jq -r '.peer_ip')/32

After that everything should be working again.
 
Back
Top