This topic describes how to resolve network configuration failures for an elastic network interface on a Windows instance. These failures can occur after you alternately hot-swap disks and elastic network interfaces.
Symptoms
The network configuration of an elastic network interface on a Windows instance can become invalid. Symptoms include disconnected or failed network connections, invalid IP addresses, invalid subnet configurations such as the subnet mask and default gateway, unusual traffic routing, and invalid VLAN configurations.
These failures typically occur in the following scenarios:
-
You attach multiple disks when creating an ECS instance. After the instance is created, you alternately hot-swap disks and elastic network interfaces, and then restart the instance.
-
You attach a secondary elastic network interface when creating an ECS instance. After the instance is created, you alternately hot-swap disks and elastic network interfaces, and then restart the instance.
For example, you create a Windows instance with three disks attached. After the instance is created, you detach the disks, attach a new elastic network interface to the instance, and configure a secondary private IP address. The configuration is as follows:
In the Network Connections window (Control Panel > Network and Internet > Network Connections), you can see two Red Hat VirtIO Ethernet Adapters, Ethernet and Ethernet 2, both in a connected state.
C:\Users\Administrator>ipconfig
Windows IP Configuration
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::a915:a252:4124:aae6%3
IPv4 Address. . . . . . . . . . . : 192.168.1.166
Subnet Mask . . . . . . . . . . . : 255.255.255.0
IPv4 Address. . . . . . . . . . . : 192.168.1.167
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.253
Ethernet adapter Ethernet 2:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::f3b3:c68:e912:216c%10
IPv4 Address. . . . . . . . . . . : 192.168.1.148
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.253
After you restart the ECS instance, the network configuration of the attached elastic network interface becomes invalid. For example, Ethernet 3 becomes an unidentified network.
C:\Users\Administrator>ipconfig
Windows IP Configuration
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::e9d9:70a7:70ea:cda4%3
IPv4 Address. . . . . . . . . . . : 192.168.1.166
Subnet Mask . . . . . . . . . . . : 255.255.255.0
IPv4 Address. . . . . . . . . . . : 192.168.1.167
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.253
Ethernet adapter Ethernet 3:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::f12c:fc6:9a63:e40f%11
Autoconfiguration IPv4 Address. . . : 169.254.214.80
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :
Cause
Windows names elastic network interfaces based on the scan order. Alternately hot-swapping disks and elastic network interfaces changes the device detection order and causes device numbers to change. As a result, Windows cannot apply the network configuration to the correct elastic network interface, and the configuration becomes invalid.
Solution
Choose a solution based on whether your elastic network interface requires a secondary private IP address or IPv6 addresses.
Primary IP only
If your elastic network interface does not require a secondary private IP address or an IPv6 address, configure the network adapter to obtain an IP address automatically. To do this, perform the following steps:
-
Connect to the ECS instance.
For more information, see Log on to a Windows instance by using Workbench.
-
Open the Network and Sharing Center.
-
Click Change adapter settings.
-
Double-click the name of the current network connection, such as Ethernet. In the Ethernet Status dialog box, click Properties.
-
In the Ethernet Properties dialog box, double-click Internet Protocol Version 4 (TCP/IPv4).
-
In the Internet Protocol Version 4 (TCP/IPv4) Properties dialog box, select Obtain an IP address automatically and Obtain DNS server address automatically, and then click OK.
Secondary IPs and IPv6
If your elastic network interface requires a secondary private IP address or IPv6 addresses, you must reconfigure the IP addresses after the instance starts. To do this, perform the following steps:
-
Configure a secondary private IPv4 address.
For more information, see Configure a secondary private IPv4 address.
-
Configure an IPv6 address.
For more information, see IPv6 communication.
This restores the network configuration of the elastic network interface.
In the Windows Control Panel > Network and Internet > Network Connections window, both Red Hat VirtIO Ethernet adapters are in a connected state.