You may be unable to ping the IPv6 address of an Elastic Compute Service (ECS) instance for several reasons. This topic describes how to troubleshoot this issue.
Symptoms
After you enable an IPv6 address for an ECS instance, you cannot use the ping -6
command to reach the IPv6 address of the instance.
Causes
You may be unable to ping the IPv6 address of an ECS instance for the following reasons:
The IPv6 address of the ECS instance is not correctly configured.
The security group of the ECS instance is incorrectly configured.
IPv6 Internet bandwidth is not enabled for the instance. As a result, the instance cannot communicate with the Internet over IPv6.
Step 1: Check the IPv6 configuration of the ECS instance
Connect to the Linux instance using a VNC connection. For more information, see Connect to a Linux instance using a VNC connection.
Run the following command to view and record the MAC address of the ECS instance.
curl http://100.100.100.200/latest/meta-data/mac && echo
Run the following command to retrieve the metadata of the ECS instance. The metadata includes the IPv6 address, IPv6 gateway, and IPv6 CIDR block.
NoteReplace `[$MAC_ID]` with the MAC address that you obtained in the previous step.
curl http://100.100.100.200/latest/meta-data/network/interfaces/macs/[$MAC_ID]/ipv6s && echo \n && curl http://100.100.100.200/latest/meta-data/network/interfaces/macs/[$MAC_ID]/ipv6-gateway && echo \n && curl http://100.100.100.200/latest/meta-data/network/interfaces/macs/[$MAC_ID]/vswitch-ipv6-cidr-block && echo \n
The command returns a similar output.
Run the following command to check whether the IPv6 address of the ECS instance is inconsistent with the IPv6 address in the metadata.
NoteThis topic uses the eth0 network interface card (NIC) as an example. You must use the name of your actual NIC.
ifconfig eth0
The output shows that the addresses are consistent. If they are inconsistent, configure the IPv6 address again. For more information, see Configure an IPv6 address.
Run the following command to check whether the IPv6 gateway of the ECS instance is inconsistent with the IPv6 gateway in the metadata.
route -6 -ne | grep ::/0
The output shows that the gateways are consistent. If they are inconsistent, configure the IPv6 address again. For more information, see Configure an IPv6 address.
Run the following command to check if the ECS server's IPv6 CIDR block does not match the one in the metadata.
route -6 -ne | grep eth0
The output indicates that the CIDR blocks are consistent. If they are inconsistent, reconfigure the IPv6 address. For more information, see Configure an IPv6 address.
Step 2: Check the security group configuration
In the top navigation bar, select the region and resource group of the resource that you want to manage.
Find the target security group and click Manage Rules in the Actions column.
On the security group details page, go to the Access Rule section and select the Inbound or Outbound tab.
To use the ping command, you need to add a rule that sets Protocol to All ICMP-IPv6 and Access Source to the corresponding IPv6 address segment, for example,
2001:db8:1234:1a00::***
. If this security group rule is missing, see Add a security group rule.
Step 3: Check if IPv6 Internet bandwidth is enabled
By default, the IPv6 address of an instance can be used only for private network communication. To access the Internet using the IPv6 address, you must enable IPv6 Internet bandwidth for the instance. For more information, see Enable IPv6 Internet bandwidth.
Also, check whether Egress-only rules are configured for the IPv6 gateway. If you want to allow inbound traffic from the Internet to the IPv6 address of the instance, you must delete these rules.