您的位置:首页 > 运维架构 > Linux

CentOS克隆导致网卡eth0变成eth1,以及修改网卡名

2018-02-10 10:58 507 查看

1.进入虚拟机文件夹将hadoop01复制一份,重命名为hadoop02



2.进入VM主界面,打开hadoop02文件



开启虚拟机



3.打开终端

vi /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:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:d3:d1:35", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:d33:d1:45", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"


删除etho信息,把eth1修改为eth0,结果如下:

# 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:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:d33:d1:45", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


修改 vi /etc/sysconfig/network-scripts/ifcfg-eth0



修改:
HWADDR=00:0c:29:d33:d1:45
IPADDR=192.168.137.203


4 重启机器

service network restart
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  centos linux eth0 ip hostname