linux虚拟器卸载网卡,Linux虚拟机网卡改名方法

因为虚拟机的配置是需要通过其他初始化脚本来生成的,所以网卡的设备名不能改变,如果需要把eth3修改为eth0

以rhel6为例,把以下文件作修改如下:

1、把eth0 ,eth1 ,eth2的相关行删除掉

2、把eth3的相关行保留,并把eth3改为eth0即可。

[root@ovm0246 ~]# vim/etc/udev/rules.d/70-persistent-net.rules

# This file was automatically generated bythe/lib/udev/write_net_rules

# program, run by thepersistent-net-generator.rules rules file.

#

# You can modify it, as long as you keepeach rule on a single

# line, and change only the value of theNAME= key.

# PCI device 0x10ec:0x8139 (8139cp) (customname provided by external tool)

SUBSYSTEM=="net",ACTION=="add", DRIVERS=="?*",ATTR{address}=="52:54:00:12:34:56", ATTR{type}=="1",KERNEL=="eth*", NAME="eth0"

# PCI device 0x10ec:0x8139 (8139cp)

SUBSYSTEM=="net",ACTION=="add", DRIVERS=="?*",ATTR{address}=="02:00:c0:a8:14:f9", ATTR{type}=="1",KERNEL=="eth*", NAME="eth1"

# PCI device 0x10ec:0x8139 (8139cp)

SUBSYSTEM=="net",ACTION=="add", DRIVERS=="?*",ATTR{address}=="52:54:00:e4:d4:1d", ATTR{type}=="1",KERNEL=="eth*", NAME="eth2"

# PCI device 0x10ec:0x8139 (8139cp)

SUBSYSTEM=="net",ACTION=="add", DRIVERS=="?*",ATTR{address}=="02:00:c0:a8:14:fa", ATTR{type}=="1",KERNEL=="eth*", NAME="eth3"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值