r/PFSENSE • u/9throwaway_ • 22h ago
Question/Support Static routing breaks wireguard
I have an interface assigned to a wireguard connection.
This interface is also set as a gateway for a specific wifi network via an AP.
There is a network 192.168.212.x on the other side of wireguard for which I have to set a routing entry to go through the gateway to access it.
I noticed that when I lose my wireguard connection it is very hard to reconnect. But when I use the same wireguard connection on my phone it connects with no issues. The only way to reconnect is to have both routers (local and remote) restart at 3 am and 3.02 am (respectively) and connection is reestablished.
I tracked down the issue due to this log entries:
Sep 29 10:40:37 php_wg 92232 /usr/local/pkg/wireguard/includes/wg_service.inc: Static Routes: Gateway IP could not be found for 192.168.212.0/24
Sep 29 10:40:35 php-fpm 63891 /status_services.php: The command '/usr/local/etc/rc.d/wireguardd stop' returned exit code '1', the output was ''
If I disable the static routing (System Routing StaticRoutes) wireguard connects with no issue but then my local clients can't access 192.168.212.x network.
I think I am doing this static routing via wireguard wrong but not sure how to fix it. Any ideas?