首页 > 系统服务 > 详细

VMware启动CentOS 6.5后将网卡eth1重新设置为eth0

时间:2014-12-29 18:32:12      阅读:519      评论:0      收藏:0      [点我收藏+]

在配置vmbox虚拟机的时候,为了方便,经常采用复制虚拟机的操作,但是复制后的虚拟机即便采用了桥接网络的方式,还是无法正常连接局域网


后来网上查了一下,可以重新设置eth

首先查看文件 /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:92:5e:f2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:5a:00:b2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

记住eth1 中的mac地址 "08:00:27:5a:00:b2"

然后编辑文件 vim /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth1
HWADDR=08:00:27:5a:00:b2
TYPE=Ethernet
#UUID=62b19c7b-4fbd-45ef-b73f-73d9bf664f69
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.102.6
NETMASK=255.255.255.0
GATEWAY=192.168.102.1

将原来的eth0,改为eth1,并将HWADDR修改该为上面文件里的mac地址

保存退出后

重启网络

service network restart

即可完成内网的联通

测试输入ifconfig回车,如果能看到刚才文件里设置的ip,标示设置成功!


VMware启动CentOS 6.5后将网卡eth1重新设置为eth0

原文:http://power9li.blog.51cto.com/8267716/1597381

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!