Bug #14613
openIncorrect wireguard control panel status management
Added by hao zhang over 1 year ago. Updated 11 months ago.
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
clipboard-202307262256-rlh8k.png (166 KB) clipboard-202307262256-rlh8k.png | hao zhang, 07/26/2023 02:56 PM | ||
clipboard-202308252204-q3tlb.png (69.7 KB) clipboard-202308252204-q3tlb.png | hao zhang, 08/25/2023 02:04 PM | ||
clipboard-202311200758-wonvv.png (75.2 KB) clipboard-202311200758-wonvv.png | hao zhang, 11/19/2023 11:58 PM | ||
clipboard-202311200800-ubhho.png (40.7 KB) clipboard-202311200800-ubhho.png | hao zhang, 11/20/2023 12:00 AM |
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 over 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 over 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