虚拟机克隆后eth0网卡变成eth1网卡并且IP地址消失问题解决(3)
(1) 将原NAME="eth0"行内容注释
(2) 将NAME="eth1"行内容中的"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:5e:35:00", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:3a:f2:8e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" |
5.2、修改克隆后机器(B机器)的Mac地址与IP地址
[root@ol6_weblogic_1 network-scripts]# vi/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0" HWADDR="00:0C:29:3a:f2:8e" NM_CONTROLLED="yes" ONBOOT="yes" IPADDR=192.168.1.230 NETWORK=192.168.1.0 NETMAST=255.255.255.0 TYPE="Ethernet" UUID="b1b9ac33-19ad-4bb3-ac6c-06d5a3fa7c5b" |
特别注意:
修改的MAC地址,只能是与70-persistent-net.rules文件中ATTR{address}相同的地址
5.3、重启操作系统生效
经验证,重启网络服务(service network restart)方式,IP地址可以变化过来,但是网络接口名称修改不生效。
6、验证
[root@ol6_weblogic_1 ~]# ifconfig –a
eth0 Link encap:Ethernet HWaddr 00:0C:29:3A:F2:8E inet addr:192.168.1.230 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe3a:f28e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:380 errors:0 dropped:0 overruns:0 frame:0 TX packets:402 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:35506 (34.6 KiB) TX bytes:54463 (53.1 KiB)
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
|
结果:eth1变回了eth0,并且IP地址为所设置的IP地址,网络已可正常使用
相关新闻>>
- 在VMwarevSphereClient下使用Linux虚拟机安装CentOS6.4系统
- 解决虚拟机提示VMwareWorkstationcannotconnecttothevirtualmach
- VMWarelinux虚拟机扩容
- 在VMware虚拟机中安装中文版Win7系统详细教程 附虚拟机下载
- 虚拟机无法联网解决方法
- 虚拟机VMWare“提示:软件虚拟化与此平台上的长模式不兼容”的解
- Virtualbox虚拟机安装CentOS6.5图文详细教程
- VMware虚拟机平台的网络配置(RHEL5)
- VMware虚拟机上网络连接(networktype)的三种模式--bridged、ho
- Vbox虚拟机下如何登陆Windows2008
- 发表评论
-
- 最新评论 更多>>