Change eth0 Nic name to eth1 in Ubuntu

Source: Internet
Author: User

This method is used to solve the problem where the new Nic is changed to eth1 and the source Nic name is eth0, which cannot be used by the new Nic. It can also be used to rename a nic.

After the nic mac address is changed, find the NIC in Linux. The new NIC will be identified as eth1 or written to/etc/udev/rules. in the D/70-persistent-net.rules file, modify/etc/udev/rules. in the D/70-persistent-net.rules file, modify the MAC address of eth0 to the changed address.

First back up the file
/Etc/udev/rules. d/70-persistent-net.rules

1 cp /etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/70-persistent-net.rules_backup

Then modify the file

1 gedit /etc/udev/rules.d/70-persistent-net.rules

# This file maintains persistent names for network interfaces.
# See udev (7) for syntax.
# Entries are automatically added by the 75-persistent-net-generator.rules
# File; however you are also free to add your own entries.

# PCI device 0x14e4: 0x1713 (tg3)
Subsystem = "Net", Action = "add", drivers = "? * ", ATTR {address} =" 00: 1E: EC: 0f: 79: F
6 ", ATTR {type }==" 1 ", kernel =" ETH * ", name =" eth0"

# PCI device 0x8086: 0x4222 (iwl3945)
Subsystem = "Net", Action = "add", drivers = "? * ", ATTR {address} =" 00: 1f: 3C: 48: 70: B
1 ", ATTR {type }==" 1 ", kernel =" WLAN * ", name =" wlan0"

Change eth0 to eth1. If you need to delete unused Nic devices. Save and restart the system.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.