What Should I Do If the Remote Server Fails to Be Accessed Through the NAT Gateway?
When an ECS accesses a server on the public network through an SNAT rule, TCP connection fails. To rectify the fault, perform the following steps:
- Run the following command to check whether tcp_tw_recycle is enabled on the remote server:
sysctl -a|grep tcp_tw_recycle
If the value of tcp_tw_recycle is 1, tcp_tw_recycle is enabled.
- Run the following command to check the number of lost packets of the remote server:
cat /proc/net/netstat | awk '/TcpExt/ { print $21,$22 }'
If the value of ListenDrops is not 0, packet loss occurs, that is, the network is faulty.
Troubleshooting
This problem can be solved by modifying the kernel parameters of the remote server.
- Run the following command to temporarily modify the parameters (the modification becomes invalid after the server is restarted):
- Perform the following operations to permanently modify the parameters:
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.