Viewing VPN Connection Logs
Scenario
After the VPN logging function is enabled, you can view the logs of a specified VPN connection.
Prerequisites
The Log Tank Service (TLS) has been enabled. For details, see the Log Tank Service (TLS).
Procedure
- Creating a log group
- Log in to the management console.
- Click
in the upper left corner and select the desired region and project. - Click
in the upper left corner of the page, and choose . - Create a log group. For details, see Managing Log Groups.
- Creating a log stream
- Log in to the management console.
- Click
in the upper left corner and select the desired region and project. - Click
in the upper left corner of the page, and choose . - Create a log stream. For details, see Managing Log Streams.
- Configuring the connection log function
- Log in to the management console.
- Click
in the upper left corner and select the desired region and project. - Click
in the upper left corner, and choose . - In the navigation pane on the left, choose .
- Click the P2C VPN Gateways tab. In the P2C VPN gateway list, locate the target P2C VPN gateway, and click View Server in the Operation column.
- Click the Connections tab. The VPN connection details page is displayed.
- In the Connection Log area, click Configure Connection Log.
- In the dialog box that is displayed, toggle on Collect Logs.
- Select the target log group and log stream, and click OK.
On the Connections tab page, you can view the configured connection log.
- Viewing connection logs
- Log in to the management console.
- Click
in the upper left corner and select the desired region and project. - Click
in the upper left corner, and choose . - In the navigation pane on the left, choose .
- Click the P2C VPN Gateways tab. In the P2C VPN gateway list, locate the target P2C VPN gateway, and click View Server in the Operation column.
- Click the Connections tab. The VPN connection details page is displayed.
- In the Connection Log area, click View Log Details. The LTS page is displayed.
- In the log group list, click
on the left of the target log group to view log stream details. - Click a log stream name to view log details, including the time and log content.
$p2c_vgw_id $connection_id $client_public_ip $client_private_ip $client_user_name $event_type $event_timestamp
Table 1 Description of the log format Parameter
Description
p2c_vgw_id
Gateway ID
connection_id
Connection ID
client_public_ip
Actual address
client_private_ip
Virtual address
client_user_name
Username
event_type
Online/Offline event type
event_timestamp
Timestamp
You can search for logs by keyword on the log stream details page on the LTS console.