Change network device name from eth1 back to eth0

本文介绍如何在 CentOS 6 中将网络接口名称从 eth1 改回 eth0。当虚拟机通过 VMware 或 KVM 克隆,或者更换了物理网络卡时,可能会遇到网络接口名称变化的问题。文章详细说明了修改 /etc/udev/rules.d/70-persistent-net.rules 和 /etc/sysconfig/network-scripts/ifcfg-eth0 两个文件的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The interface name of a network device increases if the mac address of the physical or virtual network card changes. A common case is if you made a clone of a virtual machine for example via VMware or KVM or replaced a physical network card in a non virtualized server.

If it’s a CentOS 6 machine you need to change 2 files to rename the interface for example from eth1 back to eth0.

One file is the udev rule for network devices which is located here:

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

Copy the new mac address to the line of your eth0 rule and delete the new rule for eth1.

# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:50:56:b2:23:e0″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0″

Modify the network configuration located under:

/etc/sysconfig/network-scripts/ifcfg-eth0

and replace the old ip with the new one and the old mac address with the new mac address.

To be sure everything works fine reboot your machine.


https://www.banym.de/linux/centos/change-network-device-name-from-eth1-back-to-eth0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值