Resolve the "General fault" error when pinging a public IP address from a Windows ECS instance

Updated at:

This topic describes how to troubleshoot the "General failure" error that occurs when you ping a public IP address from a Windows ECS instance.

Symptoms

When you ping a public IP address from a Windows ECS instance, a "General failure" error is returned.

Causes

This issue can occur for the following reasons:

Possible cause

Troubleshooting

Third-party antivirus or security software is installed on the ECS instance.

Check third-party antivirus or security software

The instance has an incorrect default gateway or default route configuration.

Check the instance gateway and route

Other less common causes.

Troubleshoot other possible causes

Solutions

Check third-party antivirus or security software

Third-party antivirus or security software often includes network protection features that can control and restrict traffic.

If you have third-party antivirus or security software installed, try uninstalling or temporarily disabling it. Then, try to ping the public IP address again.

Check the instance gateway and route

An ECS instance needs a correctly configured default gateway and default route to communicate with external networks. If these settings are missing or incorrect, network connectivity will fail.

Step 1: Check the default gateway

Run the ipconfig command to view the default gateway configuration.

PS C:\Users\Administrator> ipconfig
Windows IP Configuration
Ethernet adapter Ethernet:
   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::xxx::7e%3
   IPv4 Address. . . . . . . . . . . : 172.16.0.72
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 172.16.0.253
Ethernet adapter Ethernet 2:
   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::xxx::d%25
   IPv4 Address. . . . . . . . . . . : 172.16.0.74
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 172.16.0.253

Verify that the default gateway address is correct by checking the IPv4 CIDR block of the vSwitch to which the ECS instance belongs. For example, with a vSwitch CIDR block of 172.16.0.0/24, the correct gateway is 172.16.0.253, the third-to-last available address. The default gateway in the command output is therefore correct.

If no default gateway is displayed, or if the address is incorrect, follow these steps to reconfigure it:

Configure the default gateway

Note

This example uses Windows Server 2022.

  1. Open Network and Sharing Center.

  2. Click Change adapter settings.

  3. Double-click the primary ENI, named Ethernet. In the Ethernet Status dialog box, click Properties.

  4. In the Ethernet Properties dialog box, double-click Internet Protocol Version 4 (TCP/IPv4).

  5. In the Internet Protocol Version 4 (TCP/IPv4) Properties dialog box, select Obtain an IP address automatically. Alternatively, to configure the settings manually, select Use the following IP address and enter the correct IP address, default gateway, and other network information.

  6. Click OK in each dialog box to save your settings.

Step 2: Check the default route

Run the route print command to check for a default route.

As shown in the following output, the route entry with a Network Destination and Netmask of 0.0.0.0 is the default route, which is used for communication with external networks.

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface        Metric
          0.0.0.0          0.0.0.0    192.168.1.253    192.168.1.14     271
        127.0.0.0        255.0.0.0         On-link         127.0.0.1     331
        127.0.0.1  255.255.255.255         On-link         127.0.0.1     331
  127.255.255.255  255.255.255.255         On-link         127.0.0.1     331
      192.168.1.0    255.255.255.0         On-link      192.168.1.14     271

If there is no default route, run the following command to add one. You need to replace the placeholder with the actual default gateway address.

route -p add 0.0.0.0 mask 0.0.0.0 <default gateway address>

Example:

route -p add 0.0.0.0 mask 0.0.0.0 172.16.0.253

Troubleshoot other possible causes

Other factors can also cause this issue, including problems with the network adapter, the TCP/IP stack, or misconfigured Windows security tools. Follow the steps below to investigate these possibilities.

Check the network adapter status

  1. Open Device Manager.

  2. Check that the network adapters are working correctly. If an adapter is disabled, enable it. If an adapter is malfunctioning or uses an outdated driver, update the driver by following the instructions in Install Virtio drivers. In Device Manager, expand the Network adapters node. Right-click the Red Hat VirtIO Ethernet Adapter and select Enable device if it is disabled. To verify the driver is loaded correctly, expand Network adapters, double-click the Red Hat VirtIO Ethernet Adapter to open its properties. On the General tab, confirm that the device status is "This device is working properly."

Reset the TCP/IP stack

If the TCP/IP stack is corrupted, use the following commands to reset it.

netsh int ip reset
netsh winsock reset

After the reset is complete, re-check your configuration by following the steps in the Check the instance gateway and route section.

Check the system firewall

This procedure uses Windows Server 2012 as an example. The steps are similar for other versions of Windows Server.

  1. Click the 服务器管理..png icon in the lower-left corner to open Server Manager.

  2. In the upper-right corner, select Tools(T) > Windows Firewall with Advanced Security.

  3. Check the firewall status.

    1. If the firewall is off, no action is required.

      In the Windows Firewall with Advanced Security console, if the Domain, Private, and Public profiles all show Windows Firewall is off (indicated by a red X icon), the firewall is disabled.

    2. If the firewall is on, continue with the following steps:

      1. In the Windows Firewall with Advanced Security window, click Outbound Rules.

      2. Check for any outbound rules set to Block that might be preventing traffic. If you find such rules, disable or modify them.

Check local security policies

  1. Open Local Security Policy.

  2. Click IP Security Policies on Local Computer. To review a policy, right-click it and select Properties. In the policy's filter action properties, go to the Security Methods tab and check if the Block option is selected.

  3. If a policy is assigned and contains blocking rules, disable or modify it.

Check the Routing and Remote Access tool

  1. Open Server Manager. In the upper-right corner, select Tools > Routing and Remote Access.

    Note

    If this tool is not listed, it is not installed, and no action is needed.

  2. The Routing and Remote Access service can interfere with network traffic if enabled. To check its status, open the tool and click Server Status in the left navigation pane of the Routing and Remote Access console. Verify that the status in the right pane is Stopped (unconfigured).