VirtualBox-复制虚拟机-重置网卡

更改编程网络配置
本文详细介绍了如何在Linux系统中更改虚拟机的网络适配器名称及MAC地址,包括修改网卡名称为eth0,注释掉原eth0设置,以及更新对应的MAC地址。通过编辑/etc/udev/rules.d/70-persistent-net.rules和/etc/sysconfig/network-scripts/ifcfg-eth0文件实现网络配置的更改。

情况说明

11464886-60c52db8ac659d95.png
11464886-05c074c70a4e15b4.png

改网卡名

改拥有新虚拟机MAC地址的网卡名称为eth0;
注释掉原eth0;

[root@lebron ~]# vim /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100e (e1000)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:1c:68:04", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:ee:4b:73", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:6c:8b:62", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

改eth0的MAC地址

[root@lebron ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:6C:8b:62
TYPE=Ethernet
UUID=1e3c54ec-0df1-42f7-a577-6a18be5a839e
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值