In Linux Ubuntu, how does one modify the NIC name ?, Linuxubuntu

Source: Internet
Author: User

In Linux Ubuntu, how does one modify the NIC name ?, Linuxubuntu
In Linux Ubuntu, how does one modify the NIC name?

I. solution 1:

1. First, modify the physical configuration file of the NIC. If this file is not available, create a new one or copy a copy from the existing environment and modify the configuration as required.

Vi/etc/udev/rules. d/70-persistent-net.rules

# PCI device 0x14e4: 0x1692 (tg3)

SUBSYSTEM = "net", ACTION = "add", DRIVERS = "*", ATTR {address} = "bc: 30: 5b: b1: cd: be ", ATTR {dev_id} =" 0x0 ", ATTR {type} =" 1 ", KERNEL =" eth * ", NAME =" eth0"

Keyword explanation:

ATTR {address }= = "bc: 30: 5b: 9c: AE: 79" # view the MAC address ifconfig of the physical network adapter

KERNEL = "eth *" # original Nic name

NAME = "eth0" # current Nic NAME

You need to configure the MAC address of the NIC in this file, the original Nic name, And the NIC name to be changed.

2. Modify the network configuration file

Vi/etc/network/interfaces

Auto eth0

Iface eth0 inet static

Address 172.16.19.XX

Netmask 255.255.255.0

You need to configure the new Nic name after modification.

Auto eth0 # correct Nic name

3. Restart the server.

Restarting a physical server is risky because the server is not restarted. In my personal testing environment, the server cannot be restarted, or the server is disconnected due to network configuration errors. The following message is displayed: when modifying the NIC, it is best to keep the server close to itself. do not modify the NIC remotely to prevent server disconnection.

Ii. solution 2:

In/etc/default/grub, add the net. ifnames = 0 biosdevname = 0 parameter to GRUB_CMDLINE_LINUX, as shown in:

Then execute update-grub in the command line and modify the/etc/network/interfaces file,

Change the NIC name to eth0

Restart the system. The NIC name is successfully changed. Of course, server disconnection may also occur.

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: info-contact@alibabacloud.com 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.