Project

General

Profile

Actions

Feature #12416

closed

Support OpenVPN ``client-kill`` to terminate remote clients instead of clearing their session

Added by Viktor Gurov over 2 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Viktor Gurov
Category:
OpenVPN
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
22.01
Release Notes:
Default

Description

Killing a user remote access vpn session from the firewall through the pfsense GUI only works temporarily.
Less then a minute later the VPN will auto connect it self again.

The problem is that openvpn_kill_client() uses the `kill` command, which terminate the client only on the server side.
To terminate the openvpn client on the remote side, the `client-kill {CID} HALT` command must be used:

Test:

# nc -U /var/etc/openvpn/server2/sock
>INFO:OpenVPN Management Interface Version 3 -- type 'help' for more info
client-kill 8 HALT
SUCCESS: client-kill command succeeded

client side result:

2021-10-01 09:16:47 SIGTERM[soft,exit-with-notification] received, process exiting

see also https://openvpn.net/community-resources/management-interface/
and list of messages: https://github.com/OpenVPN/openvpn/blob/master/src/openvpn/forward.c#L212


Related issues

Related to Regression #12817: PHP error when terminating OpenVPN sessions via the dashboard widgetResolvedViktor Gurov

Actions
Actions

Also available in: Atom PDF