克隆或复制VMware虚拟机时的网络设置
2016-05-05 21:09
609 查看
在clone之后的虚拟机里,启动之后更改MAC地址和设备文件名。
[root@sparkworker1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
HWADDR="00:0C:29:16:ED:6A"
IPV6INIT="yes"
NM_CONTROLLED="yes"
ONBOOT="yes"
IPADDR="192.168.10.81"
NETMASK="255.255.255.0"
GATEWAY="192.168.10.1"
DNS1="192.168.10.1"
[root@sparkworker1 ~]# cat /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)
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:e1:7b:39", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
[root@sparkworker1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
//这里把/etc/sysconfig/network-scripts/ifcfg-eth0 里的MAC改成"00:0c:29:e1:7b:39"
[1]+ Stopped vim /etc/sysconfig/network-scripts/ifcfg-eth0
[root@sparkworker1 ~]# fg
vim /etc/sysconfig/network-scripts/ifcfg-eth0
[root@sparkworker1 ~]# vim /etc/udev/rules.d/70-persistent-net.rules
[root@sparkworker1 ~]# ifdown eth0 //重启网卡即可
[root@sparkworker1 ~]# ifup eth0
Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/1
state: activated
Connection activated
[root@sparkworker1 ~]#
[root@sparkworker1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
HWADDR="00:0C:29:16:ED:6A"
IPV6INIT="yes"
NM_CONTROLLED="yes"
ONBOOT="yes"
IPADDR="192.168.10.81"
NETMASK="255.255.255.0"
GATEWAY="192.168.10.1"
DNS1="192.168.10.1"
[root@sparkworker1 ~]# cat /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)
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:e1:7b:39", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
[root@sparkworker1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
//这里把/etc/sysconfig/network-scripts/ifcfg-eth0 里的MAC改成"00:0c:29:e1:7b:39"
[1]+ Stopped vim /etc/sysconfig/network-scripts/ifcfg-eth0
[root@sparkworker1 ~]# fg
vim /etc/sysconfig/network-scripts/ifcfg-eth0
[root@sparkworker1 ~]# vim /etc/udev/rules.d/70-persistent-net.rules
[root@sparkworker1 ~]# ifdown eth0 //重启网卡即可
[root@sparkworker1 ~]# ifup eth0
Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/1
state: activated
Connection activated
[root@sparkworker1 ~]#
相关文章推荐
- android wifi 无线调试
- XP下使用虚拟机安装配置Solaris[多图]
- 在 Linux 上安装 VMware 工具
- VirtualBox虚拟机XP与宿主机Ubuntu互访共享文件夹
- 把Chrome OS安装在VMWare下及Chrome OS的关键特性和一些截图
- 安装 VMware Tools 时报 客户机操作系统已将 CD-ROM 门锁定,并且可能正在使用CD-ROM
- 什么是Mac OS X?跟Linux有什么区别
- mac下安装mysql(转载)
- mysql 修改编码 Linux/Mac/Unix/通用(杜绝修改后无法启动的情况!)
- 企业云 2.0:VMware 眼中的企业 IT 的未来
- Linux下三大免费桌面虚拟机评测
- 当存储无可用空间时无法启动虚拟机
- Windows 8虚拟机不能全屏的解决方法
- 使用VMware Workstation虚拟机保护数据
- 用 GNOME Boxes 下载一个操作系统镜像
- Linux vs Mac:Linux 比 Mac 好的 7 个原因
- 拨号网络的简单知识
- IP地址的分类及范围详解:A、B、C、D、E五类是如何划分的?