pivpn/pivpn

[General Issue]: Wireguard connected client list not updated

timpoldo opened this issue · 2 comments

In raising this issue I confirm that

Describe the issue

I can connect to my local network with Pivpn running in Wireguard mode with WG official app from Playstore on my android.
After disconnect or tuning-off my phone from pivpn, giving "pivpn -c" i still see client connected

Is that normal, or is an issue in pivpn?

Expected behavior

After disconnect android client, i expect to see void the output of "pivpn -c" command

Please describe the steps to replicate the issue

  1. Install Wireguard app from Playstore on android smartphone
  2. Run "pivpn -qr" on pivpn server
  3. Add connection in smartphone via QR code
  4. Connect smartphone to pivpn server
  5. Run "pivpn -c" to see client connected
  6. Disconnect smartphone from pivpn server OR turn-off the smartphone
  7. Run "pivpn -c" to see client is STILL CONNECTED

Have you taken any steps towards solving your issue?

Tryied to install WG app on an another smartphone. Same issue.

Screenshots

No response

Where did you run pivpn?

RaspberryPI

Please provide your output from uname -a

Linux raspy 6.1.21+ #1642 Mon Apr 3 17:19:14 BST 2023 armv6l GNU/Linux

Details about Operative System

PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Installation

No response

Profile / Client creation

No response

Debug output

::: Generating Debug Output
:::: PiVPN debug ::::

:::: Latest commit ::::
Branch: master
Commit: 16189ed
Author: 4s3ti
Date: Thu Aug 3 23:33:23 2023 +0200
Summary: fix(core): typo on distroCheck

:::: Installation settings ::::
PLAT=Raspbian
OSCN=bullseye
USING_UFW=0
IPv4dev=eth0
IPv6dev=eth0
dhcpReserv=1
IPv4addr=192.168.0.99/24
IPv4gw=192.168.0.1
install_user=pi
install_home=/home/pi
VPN=wireguard
pivpnPORT=5182
pivpnDNS1=1.1.1.1
pivpnDNS2=1.0.0.1
pivpnHOST=REDACTED
INPUT_CHAIN_EDITED=0
FORWARD_CHAIN_EDITED=0
INPUT_CHAIN_EDITEDv6=0
FORWARD_CHAIN_EDITEDv6=0
pivpnPROTO=udp
pivpnMTU=1420
pivpnDEV=wg0
pivpnNET=10.136.254.0
subnetClass=24
pivpnenableipv6=1
pivpnNETv6="fd11:5ee:bad:c0de::"
subnetClassv6=64
ALLOWED_IPS="192.168.0.1/24, ::0/0"
UNATTUPG=1
INSTALLED_PACKAGES=(unattended-upgrades)

:::: Server configuration shown below ::::
[Interface]
PrivateKey = server_priv
Address = 10.136.254.1/24,fd11:5ee:bad:c0de::1/64
MTU = 1420
ListenPort = 5182

begin pi-Cell

[Peer]
PublicKey = pi-Cell_pub
PresharedKey = pi-Cell_psk
AllowedIPs = 10.136.254.2/32,fd11:5ee:bad:c0de::2/128

end pi-Cell

=============================================
:::: Client configuration shown below ::::
[Interface]
PrivateKey = pi-Cell_priv
Address = 10.136.254.2/24,fd11:5ee:bad:c0de::2/64
DNS = 1.1.1.1, 1.0.0.1

[Peer]
PublicKey = server_pub
PresharedKey = pi-Cell_psk
Endpoint = REDACTED:5182
AllowedIPs = 0.0.0.0/0, ::0/0

:::: Recursive list of files in ::::
:::: /etc/wireguard shown below ::::
/etc/wireguard:
configs
keys
wg0.conf

/etc/wireguard/configs:
clients.txt
pi-Cell.conf

/etc/wireguard/keys:
pi-Cell_priv
pi-Cell_psk
pi-Cell_pub
server_priv
server_pub

:::: Self check ::::
:: [OK] IP forwarding is enabled
:: [OK] Iptables MASQUERADE rule set
:: [OK] WireGuard is running
:: [OK] WireGuard is enabled
(it will automatically start on reboot)
:: [OK] WireGuard is listening on port 5182/udp

:::: Having trouble connecting? Take a look at the FAQ:
:::: https://docs.pivpn.io/faq

:::: WARNING: This script should have automatically masked sensitive ::::
:::: information, however, still make sure that PrivateKey, PublicKey ::::
:::: and PresharedKey are masked before reporting an issue. An example key ::::
:::: that you should NOT see in this log looks like this: ::::
:::: YIAoJVsdIeyvXfGGDDadHh6AxsMRymZTnnzZoAb9cxRe ::::

:::: Debug complete ::::
:::
::: Debug output completed above.
::: Copy saved to /tmp/debug.log
:::

After disconnect or tuning-off my phone from pivpn, giving "pivpn -c" i still see client connected

Is that normal, or is an issue in pivpn?

As you can see, it says "Last seen". Yes it is normal. WireGuard does not have a concept of connection and disconnection. It just sends data on demand.

Thanks for reply.
Now I understand better how it works.

Regards