Hi all!
Is it possible to load the wg-interface configuration through a setting in rc.conf without using the devd hook?
On FreeBSD v.14 my wireguard service run under that config:
For load wireguard config file, I was need to create ``devd`` hook file:
Question: is it possible to load the interface configuration through a setting in rc.conf without using the devd hook?
Is it possible to load the wg-interface configuration through a setting in rc.conf without using the devd hook?
On FreeBSD v.14 my wireguard service run under that config:
Bash:
# cat /boot/loader.conf | grep wg
if_wg_load="YES"
#
# cat /etc/rc.conf | grep wg
cloned_interfaces="wg"
ifconfig_wg0="inet 192.168.68.1 netmask 255.255.255.240"
#
# cat /etc/wireguard/wg0.conf
[Interface]
PrivateKey = ****************************************=
ListenPort = 45045
[Peer]
# HomeDesktop
PublicKey = *****************************************=
AllowedIPs = 192.168.68.2/32
[Peer]
# HomePad
PublicKey = ...
For load wireguard config file, I was need to create ``devd`` hook file:
Bash:
# cat /etc/devd/wireguard.conf
notify 0 {
match "system" "IFNET";
match "type" "LINK_UP";
media-type "unknown";
action ". /etc/rc.subr
. /etc/network.subr
load_rc_config network
if autoif $subsystem && [ -r /etc/wireguard/$subsystem.conf ]
then
grep -vE '^[[:space:]]*(Address|DNS|MTU|Table|PreUp|PostUp|PreDown|PostDown)[[:space:]]*=' /etc/wireguard/$subsystem.conf |
wg setconf $subsystem /dev/stdin
fi";
};
Question: is it possible to load the interface configuration through a setting in rc.conf without using the devd hook?