Michael Shriver Senior Computer Specialist - College of the Environment

#OpenBSD Kernel Wireguard Configuration

Since OpenBSD 7.4 Wireguard support has been added into the kernel. In this release and later, it is no longer necessary to add additional wireguard packages, instead you configure wireguard as it’s own interface using a file such as /etc/hostname.wg0:

wgkey <private_key_here>
wgpeer <peer_public_key> wgendpoint 128.208.74.7 51821 wgaip 192.168.1.0/24 wgaip 192.168.2.0/24 wgaip 222.22.2.0/24 wgaip 222.22.3.0/24 wgpka 20
inet 192.168.1.254/24
up
!route add -net 182.168.1.0/24 192.168.1.1

Available fields in this file:

Additional fields are configured as per normal OpenBSD network interfaces, e.g.:

References: