Why Can't an EIP Be Pinged?

Symptom

After you purchase an HECS with an EIP bound, you fail to ping the EIP of the HECS, or the HECS cannot ping the Internet.

Troubleshooting

Possible causes are listed here in order of their probability.

If the fault persists after you have ruled out one cause, move on to the next one in the list.

Figure 1 Method of locating the failure to ping an EIP
Table 1 Method of locating the failure to ping an EIP

Possible Cause

Handling Measure

No security group rule allows ICMP traffic.

Add a security group rule to allow ICMP traffic. For details, see Checking Security Group Rules.

Ping operations are prohibited on the firewall.

Allow ping operations on the firewall. For details, see Checking Firewall Settings.

Ping operations are prohibited on the HECS.

Allow ping operations on the HECS. For details, see Checking Whether Ping Operations Are Prohibited on the HECS.

The associated network ACL denies ICMP traffic.

Check whether the network ACL associated with the VPC denies ICMP traffic. For details, see Checking Network ACL Rules.

A network exception occurred.

Use another HECS in the same region to check whether the local network is functional. For details, see Checking the Network.

Routes are incorrectly configured if multiple NICs are used.

If the network is inaccessible due to an extension NIC, the fault is generally caused by incorrect route configurations. To resolve this issue, see Checking the HECS Route Configuration If Multiple NICs Are Used.

The domain name is not ICP licensed or cannot be resolved.

If the domain name cannot be pinged, the domain name is not ICP licensed or cannot be resolved. To resolve this issue, see Checking Domain Name Resolution If the Domain Name Cannot Be Pinged.

Checking Security Group Rules

The ping operations use the ICMP protocol. Check whether the security group associated with the HECS allows ICMP traffic in the inbound direction.

  1. Log in to the management console.
  2. Click in the upper left corner and select your region and project.
  3. Under Computing, click Hyper ECS.
  4. On the Hyper Elastic Cloud Server page, click the name of the HECS with security group rules to be modified.

    The HECS details page is displayed.

  5. Click the Security Groups tab, expand the information of the security group, and view security group rules.
  6. Click the security group ID.

    The system automatically switches to the security group console.

  7. On the Inbound Rules tab, click Add Rule. In the displayed dialog box, set required parameters to add an inbound rule.
    Figure 2 Add Inbound Rule
    Table 2 Security group rules

    Direction

    Type

    Protocol/Port Range

    Source

    Inbound

    IPv4

    ICMP/Any

    0.0.0.0/0

    0.0.0.0/0 indicates all IP addresses.

  8. Click OK to complete the security rule configuration.

Checking Firewall Settings

If a firewall is enabled on the HECS, check whether the firewall blocks the ping operation.

Linux
  1. Run the following command to check the firewall status, taking CentOS 7 as an example:

    firewall-cmd --state

    If running is displayed in the command output, the firewall has been enabled.

  1. Check whether there is any ICMP rule blocking the ping operation.

    iptables -L

    If the command output shown in Figure 3 is displayed, there is no ICMP rule blocking the ping operation.

    Figure 3 Checking firewall rules

    If the ping operation is blocked by an ICMP rule, run the following commands to modify the rule for unblocking:

    iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT

    iptables -A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT

Windows
  1. Log in to the Windows HECS, click the Windows icon in the lower left corner of the desktop, and choose Control Panel > Windows Firewall.
  2. Click Turn Windows Firewall on or off.

    View and set the firewall status.

  3. If the firewall is On, go to 4.
  4. Check the ICMP rule statuses in the firewall.
    1. In the navigation pane on the Windows Firewall page, click Advanced settings.
    2. Enable the following rules:

      Inbound Rules: File and Printer Sharing (Echo Request - ICMPv4-In)

      Outbound Rules: File and Printer Sharing (Echo Request - ICMPv4-Out)

      If IPv6 is enabled, enable the following rules:

      Inbound Rules: File and Printer Sharing (Echo Request - ICMPv6-In)

      Outbound Rules: File and Printer Sharing (Echo Request - ICMPv6-Out)

      Figure 4 Inbound Rules
      Figure 5 Outbound Rules

Checking Whether Ping Operations Are Prohibited on the HECS

Windows

Enable ping operations using the CLI.

  1. Start the Run dialog box. Enter cmd and press Enter.
  2. Run the following command to enable ping operations:

    netsh firewall set icmpsetting 8

Linux

Check the kernel parameters of the HECS.
  1. Check the net.ipv4.icmp_echo_ignore_all value in the /etc/sysctl.conf file. Value 0 indicates that ping operations are allowed, and value 1 indicates that ping operations are prohibited.
  2. Allow ping operations.
    • Run the following command to temporarily allow the ping operations:

      #echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_all

    • Run the following command to permanently allow the ping operations:

      net.ipv4.icmp_echo_ignore_all=0

Checking Network ACL Rules

By default, no network ACL is configured for a VPC. If a network ACL is associated with a VPC, check the network ACL rules.

  1. Check whether the subnet of the HECS has been associated with a network ACL.

    If a network ACL name is displayed, the subnet of the HECS has been associated with the network ACL.

    Figure 6 Network ACL
  2. Click the network ACL name to view its status.
    Figure 7 Enabled network ACL
  3. If the network ACL is enabled, add an ICMP rule to allow traffic.
    Figure 8 Adding an ICMP rule

    The default network ACL rule denies all incoming and outgoing packets. After the network ACL is disabled, the default rule still takes effect.

Checking the Network

  1. Use another HECS in the same region to check whether the local network is functional.

    Use another HECS in the same region to ping the affected EIP. If the EIP can be pinged, the VPC is functional. In such a case, rectify the local network fault and ping the affected EIP again.

  2. Check whether the link is accessible.

    A ping failure may be caused by link congestion, link node faults, or heavy load on the HECS.

    For details, see Troubleshooting a Ping Failure or Packet Loss Using a Link Test.

Checking the HECS Route Configuration If Multiple NICs Are Used

The default route of an OS preferentially selects the primary NIC generally. If an extension NIC is selected in a route and the network malfunctions, this issue is generally caused by the incorrect route configuration.

  • If the HECS is configured with multiple NICs, check whether there is a default route in the HECS.
    1. Log in to the HECS and run the following command to check whether the default route is available:

      ip route

      Figure 9 Default route
    2. If the route is unavailable, run the following command to add it:

      ip route add default via XXXX dev eth0

      In the preceding command, XXXX specifies a gateway IP address.

Checking Domain Name Resolution If the Domain Name Cannot Be Pinged

If the EIP can be pinged but the domain name cannot be pinged, the possible cause is that the domain name has not obtained an ICP license or an error occurred in domain name.

  1. Check the ICP license of the domain name.

    According to the Regulation on Internet Information Service of the People's Republic of China released by the Ministry of Industry and Information Technology (MIIT), all websites with their own domain name that operate in China are required to obtain a license.

    • If you want to use a server in the Chinese mainland to provide Internet services, you need to submit an ICP licensing request to the server provider to obtain an ICP license for the domain name.
    • If your server is outside the Chinese mainland, no ICP license is required.
  2. Check the domain name resolution.

    If your domain name has been licensed but the domain name records are incorrectly configured, the domain name may fail to be resolved.

    Switch to the DNS console to view details about the domain name records.

  3. Check the DNS server configuration.

    If the system shows no server found after you ping the domain name, this issue may be caused by slow response from the DNS server. In such a case, see Troubleshooting Slow Access of a Website Outside the Chinese Mainland over an ECS.