Disconnecting VPN clients
Connections are VPN sessions that are established by VPN clients. After a VPN client connects to the VPN server, you can view all VPN clients that connected to the server in the last hour. VPN client information includes the client IP, user ID, status, remote IP, remote port, and session start/end time (if applicable).
Disconnecting VPN clients in the console
To disconnect a VPN client from the VPN server, follow these steps:
-
Navigate to the VPNs for VPC page and click the Client-to-site servers tab.
-
Click the name of the VPN server to display its details.
-
Click the Clients tab to view VPN clients that connected in the last 5 minutes.
-
Click the Actions menu
next to the client that you want to disconnect, then click Disconnect. The disconnected VPN client is automatically deleted after one hour.
VPN clients You can also specify to Delete the VPN client, which deletes the client session immediately.
Disconnecting VPN clients from the CLI
Before you begin, set up your CLI environment.
To disconnect a VPN client from the CLI, enter the following command:
The disconnected VPN client is automatically deleted after one hour. To automatically delete a VPN client, use the ibmcloud is vpn-server-client-delete command.
ibmcloud is vpn-server-client-disconnect VPN_SERVER_ID (CLIENT_ID1 CLIENT_ID2 ...) [-f, --force] [-q, --quiet]
Where:
- VPN_SERVER_ID: is the ID of the VPN server.
- CLIENT_ID1: is the ID of the VPN route.
- CLIENT_ID2: is the ID of the VPN route.
- --force, -f: is the force operation without confirmation.
- --quiet, -q: suppresses verbose output.
For example:
ic is vpn-server-client-disconnect r006-46ca4654-fe57-431c-9f5a-1c82773b6e83 86b1f0cc-6e83-45e5-bd78-1bef291be6e7
This will disconnect VPN client 86b1f0cc-16b0-45e5-bd78-1bef291be6e7 and cannot be undone. Continue [y/N] ?> y
Disconnect VPN client 86b1f0cc-16b0-45e5-bd78-1bef291be6e7 under account IBM as user terry@ibm.com...
OK
Disconnection request for VPN client 86b1f0cc-6e83-45e5-bd78-1bef291be6e7 has been accepted.
Disconnecting VPN clients with the API
To disconnect a VPN client with the API, follow these steps:
The disconnected VPN client is automatically deleted after one hour.
-
Set up your API environment with the right variables.
-
Store any additional variables to be used in the API commands; for example:
export vpnServerID=<your_vpn_server_id> export vpnClientID=<your_vpn_client_id>
-
When all variables are initiated, disconnect the VPN client:
curl -X POST "$vpc_api_endpoint/v1/vpn_servers/$vpnServerID/clients/$vpnClientID/disconnect?version=$api_version&generation=2" \ -H "Authorization: $iam_token"