wg-quick: changes in freebsd
Cristiano Deana <[email protected]> Mon, 1 Dec 2025 09:57:54 +0100
| Newsgroups | com.zx2c4.lists.wireguard |
|---|---|
| Message-ID | <[email protected]> |
Hi,
in FreeBSD 15 `ifconfig' command required a specific netmask when assign
an IP, but wg-quick extract (and save to .conf file) only the address,
without mask.
I just wrote a little patch (that's not my job, maybe awful) to save
$address/$mask to $INTERFACE.conf:
# diff freebsd.bash /usr/local/bin/wg-quick
347,348c347,349
< { read -r _; while read -r _ _ _ address _; do
< new_config+="Address = $address"$'\n'
---
> { read -r _; while read -r _ _ network address _; do
> mask=$(echo "$network" | awk -F / '{print $2}')
> new_config+="Address = $address/$mask"$'\n'
Feel free to point me the correct way to submit a patch request, thank you.
Cris