What Should I Do If the Remote Server Fails to Be Accessed Through the NAT Gateway?

If your TCP connection fails when your ECS is accessing a server on the public network through an SNAT rule, perform the following steps:

  1. 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.

  2. 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

Method 1: Modifying the kernel parameter of the remote server

Method 2: Modifying the kernel parameter of the local client