I'm currently in the process of "cloning" an existing OpenBSD machine (that functioned as both an OpenVPN server, and an OpenVPN client), but with FreeBSD (14.3-RELEASE-p2) instead. The main reason for this is the new machine needs ZFS support, which means either Linux or FreeBSD, and I much prefer FreeBSD (plus I prefer pf over pretty much every Linux firewall option, even if it has diverged significantly from OpenBSD).
Anyway the server configuration ported over with zero issues, just pkg install openvpn, set openvpn_enable="YES" in /etc/rc.conf, and copy over all of the files. Started right up, clients able to connect without any issue, no problems. The client setup however has not been as smooth. I copied over the existing configuration and it technically works, as long as I remove the 'user openvpn' and 'group openvpn' lines from the configuration. If I leave them in, the tunnel works, but I get repeated "Failed to poll for packets: Operation not permitted (errno=1)" messages to syslog, and eventually the tunnel goes down. When it does go down (or if I stop the process before then) it fails to destroy the tunnel it created, and leaves all of the added routes in the routing table. This is a bit of a problem--the tunnel interface isn't really important, but leaving the routes in the routing table means I'm unable to reach them at all (instead of it going back to routing them out the default gateway), like I want.
So out of curiosity I thought I'd monitor the logs and stop the server process, and I see similar errors, they just don't really matter much (because leaving the tunnel and routes in place when it exits is okay). The errors look like this:
Anyone know why this happens? And is this expected normal behavior on FreeBSD?
Anyway the server configuration ported over with zero issues, just pkg install openvpn, set openvpn_enable="YES" in /etc/rc.conf, and copy over all of the files. Started right up, clients able to connect without any issue, no problems. The client setup however has not been as smooth. I copied over the existing configuration and it technically works, as long as I remove the 'user openvpn' and 'group openvpn' lines from the configuration. If I leave them in, the tunnel works, but I get repeated "Failed to poll for packets: Operation not permitted (errno=1)" messages to syslog, and eventually the tunnel goes down. When it does go down (or if I stop the process before then) it fails to destroy the tunnel it created, and leaves all of the added routes in the routing table. This is a bit of a problem--the tunnel interface isn't really important, but leaving the routes in the routing table means I'm unable to reach them at all (instead of it going back to routing them out the default gateway), like I want.
So out of curiosity I thought I'd monitor the logs and stop the server process, and I see similar errors, they just don't really matter much (because leaving the tunnel and routes in place when it exits is okay). The errors look like this:
Code:
Sep 13 20:42:43 fw openvpn[22826]: ERROR: FreeBSD route delete command failed: external program exited with error status: 77
Sep 13 20:42:43 fw syslogd: last message repeated 3 times
Sep 13 20:42:43 fw openvpn[22826]: /sbin/ifconfig tun0 192.168.128.1 -alias
Sep 13 20:42:43 fw openvpn[22826]: FreeBSD ip addr del failed: external program exited with error status: 1
Sep 13 20:42:43 fw openvpn[22826]: /sbin/ifconfig tun0 destroy
Sep 13 20:42:43 fw kernel: tun0: link state changed to DOWN
Sep 13 20:42:43 fw openvpn[22826]: FreeBSD 'destroy tun interface' failed (non-critical): external program exited with error status: 1
Anyone know why this happens? And is this expected normal behavior on FreeBSD?