Help Center> Elastic Cloud Server> Troubleshooting> Configuring the Network> Why Does the NIC Names Change After I Start a Linux ECS?
Updated on 2023-03-30 GMT+08:00

Why Does the NIC Names Change After I Start a Linux ECS?

Scenarios

After an ECS running CentOS 6 created using a private image starts, the first NIC is named as eth0, rather than eth1.

This solution provided in this section involves restarting the ECS. Restarting the ECS will interrupt services running on it. Exercise caution when performing this operation.

Root Cause

The /etc/udev/rules.d/70-persistent-net.rules file still records the mappings between NICs and MAC addresses in the private image. You need to disable the rules.

Solution

  1. The correct way to disable udev is to overwrite it with an empty file. Any rules in /etc/udev/rules.d take precedence over the rules in /lib/udev/rules.d.

    # touch /etc/udev/rules.d/75-persistent-net-generator.rules

  2. Restart the ECS.

    # reboot