How Can I Prevent VPN Connection Interruption?
VPN connections may be renegotiated when the IPsec SA lifecycle is about to expire or the data transferred through the VPN connection exceeds 20 GB. Usually, renegotiation does not interrupt VPN connections.
Most disconnections are caused by incorrect configurations on both ends of the VPN connection or renegotiation fails due to Internet exceptions.
The common causes of connection interruptions are as follows:
- ACLs of the devices at the two ends of the VPN connection do not match.
- SA lifecycles at the two ends of the VPN connection do not match.
- DPD is not configured in the data center.
- Configuration is modified when the VPN is used.
- Packets are fragmented because the data size exceeds the MTU.
- Jitter occurs on the carrier's network.
Therefore, ensure that the following configurations to keep the VPN connection alive:
- The local subnet of one side is the same as the remote subnet of the other side and the remote subnet of one side is the same as the local subnet of the other side.
- SA lifecycles at the two ends of the VPN connection are consistent.
- DPD is enabled on the gateway device of the data center, and the number of detection times is greater than or equal to 5.
- Parameters are modified at both ends of the VPN connection during the use of the VPN connection.
- Set TCP MAX-MSS to 1300 for the gateway device in the data center.
- The bandwidth of the gateway in the data center is large enough to be used by VPN.
- VPN connection negotiation can be triggered by the two ends and the active negotiation configuration of the gateway in the data center has been enabled.
- Run a long ping on the subnets at both ends. The script content is as follows:
#!/bin/sh host=$1 if [ -z $host ]; then echo "Usage: `basename $0` [HOST]" exit 1 fi log_name=$host".log" while :; do result=`ping -W 1 -c 1 $host | grep 'bytes from '` if [ $? -gt 0 ]; then echo -e "`date +'%Y/%m/%d %H:%M:%S'` - host $host is down"| tee -a $log_name else echo -e "`date +'%Y/%m/%d %H:%M:%S'` - host $host is ok -`echo $result | cut -d ':' -f 2`"| tee -a $log_name fi sleep 5 # avoid ping rain done #./ping.sh x.x.x.x >>/dev/null &
- Use the vi editor to copy the preceding script to the ping.sh file.
- Run the chmod 777 ping.sh command to grant permissions to the file.
- Run the ping command:
./ping.sh x.x.x.x >>/dev/null &
x.x.x.x indicates the IP address to be pinged.
- After the ping command is executed, the x.x.x.x.log file is generated. Run the following command:
You can view the long ping result in real time.
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.