A local server fails to ping an instance. Possible causes include:
If the local network is normal (other websites can be pinged from the local network), troubleshoot as follows:
An instance can access other computers on the Internet only if it has a public IP address. Otherwise, the instance cannot be pinged through outside the private IP address.
A security group is a virtual firewall that controls the inbound and outbound traffic of the associated instance. You can specify the protocol, port, and policy in a security group rule. Because ICMP is used in the ping test, you need to check whether the protocol is allowed in the security group associated with the instance. To view the security group associated with the instance and its inbound and outbound rules, perform the following steps:
Based on the operating system of the instance, select a method to check the configuration:
Whether a ping test is allowed in Linux operating system depends on both kernel and firewall configurations. If either of them denies the ping test, "Request timeout" occurs.
cat /proc/sys/net/ipv4/icmp_echo_ignore_all
echo "0" >/proc/sys/net/ipv4/icmp_echo_ignore_all
Run the following command to check whether the firewall rule and the corresponding ICMP rule of the current server are disabled:
iptables -L
If the following result is returned, the ICMP rule is not disabled. In this case, check whether the domain name has ICP filing (for domain names served in Mainland China).
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT icmp -- anywhere anywhere icmp echo-request
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT icmp -- anywhere anywhere icmp echo-request
If the return result shows that the ICMP rule is disabled, run the following commands to enable it.
#Chain INPUT
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
#Chain OUTPUT
iptables -A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT
If the previous operations cannot troubleshoot the problem, refer to the following:
Was this page helpful?