Bug #14613
openIncorrect wireguard control panel status management
0%
Description
Wireguard can still be clicked on to start while in the boot state and is unresponsive when clicked on, making wireguard uncontrollable.
pfsense2.7
pfSense-pkg-WireGuard 0.2.0_2
Files
Updated by hao zhang over 1 year ago
Meanwhile, in this state, although it shows that the peer is connected, it is not actually able to communicate
Updated by hao zhang about 1 year ago
I reinstalled pfsense and ran into this problem again
I have 3 tunnel, 5 peers and each tunnel is assigned interface
When using wireguard, I installed it once and uninstalled it once, and after completing the wireguard configuration, restarting pfsense gives me this problem
Reinstalling wireguard in the plugin manager restores it
Updated by hao zhang about 1 year ago
I do it manually with ssh
/usr/local/bin/php_wg -f /usr/local/pkg/wireguard/includes/wg_service.inc stop
then web UI can be controlled
Updated by hao zhang about 1 year ago
I checked /var/run/wireguardd.pid before rebooting and it was 22536.
After that I rebooted the pfsense.
After reboot /var/run/wireguardd.pid changed to 52579 but the pid is not found in top.
And the process php_wg is not found.
But running /usr/local/bin/php_wg -f /usr/local/pkg/wireguard/includes/wg_service.inc start
The WireGuard service is already running.
So I'm assuming that wireguard is already running, but for some reason it crashed and the wireguard control program didn't recognize the state of wireguard correctly.
I checked wg_is_service_running() in /usr/local/pkg/wireguard/includes/wg_service.inc, and the $wouldblock of this function returns true when php_wg doesn't exist, and I found out that it's dpinger after fstat. The /var/run/wireguardd.pid is occupied.
But I can't find the reason why php_wg crashes on startup
I can't find any logs in the system logs, how do I turn on the wireguard logs?
Updated by hao zhang about 1 year ago
After running
/usr/local/bin/php_wg -f /usr/local/pkg/wireguard/includes/wg_service.inc stop
fstat shows that /var/run/wireguardd.pid has been unoccupied
Updated by hao zhang about 1 year ago
You can only enable wiregtuard by starting it in the web gui.
After starting with the script /usr/local/bin/php_wg -f /usr/local/pkg/wireguard/includes/wg_service.inc
Symptoms are the same as at startup, but I don't know php very well, so I can't find the actual call from web gui to start the wireguard process.
I'm guessing this is why the problem occurs.
Updated by Johannes Rohde about 1 year ago
I can second this bug on pfsense ce 2.7.1. It seems to have something to do with a missing ipv6 gateway. Please refer to https://forum.netgate.com/topic/183372/some-services-show-can-t-start/117?_=1700424014535
Updated by Johannes Rohde about 1 year ago
I can get php_wg to work again as well as soon as I make a change to an interface within the gui. That fixes the wireguard gui as well. I can second that there is not much in the logs to shed any light on why php_wg is not starting even when triggered through the gui.
All our wireguard tunnels are associated with an interface as well. As soon as I remove the interfaces the error is gone as well. Unfortunately we need them in production though.
The error might affect 23.09 as well (refer to forum post).
Updated by hao zhang about 1 year ago
- File clipboard-202311200758-wonvv.png clipboard-202311200758-wonvv.png added
- File clipboard-202311200800-ubhho.png clipboard-202311200800-ubhho.png added
Johannes Rohde wrote in #note-7:
I can second this bug on pfsense ce 2.7.1. It seems to have something to do with a missing ipv6 gateway. Please refer to https://forum.netgate.com/topic/183372/some-services-show-can-t-start/117?_=1700424014535
My ipv6 address should be normal and I can use ipv6, although pfsense doesn't seem to recognize the prefix correctly, making npt unusable