linux使用:解决克隆虚拟机后UP BROADCAST RUNNING MULTICAST问题
来源:互联网 发布:linux grub 启动顺序 编辑:程序博客网 时间:2024/05/18 08:52
在使用linux的过程中如果安装了多台虚拟机,并且每台虚拟机都是由上一台虚拟机克隆出来的我们可能会出现联网连不上的问题,在linux的控制台输出ifconfg会出现以下信息:
[root@tiny ~]$ ifconfigeth2 Link encap:Ethernet HWaddr 00:0C:29:FE:F8:14 inet6 addr: fe80::20c:29ff:fefe:f814/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:68 errors:0 dropped:0 overruns:0 frame:0 TX packets:9 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:7385 (7.2 KiB) TX bytes:2310 (2.2 KiB) Interrupt:19 Base address:0x2024 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:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:480 (480.0 b) TX bytes:480 (480.0 b)
会报 UP BROADCAST RUNNING MULTICAST错误。这是因为mac地址设置的问题,在这里提供一个解决办法:
1. 切换至root用户
由于相关文件只能由root进行修改,因此我们先应该转换为root用户启动
[admin@tiny ~]$ su root
2.查看当前MAC地址相关信息
[root@tiny rules.d]# 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 0x1022:0x2000 (pcnet32)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:49:e9:9d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"# PCI device 0x1022:0x2000 (vmxnet)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:13:e9:e2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"# PCI device 0x1022:0x2000 (vmxnet)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:fe:f8:14", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
我们可以看到其中包含三块网卡信息分别是eth0,eth1,eth2,而我们使用eth2所以我们需要删除掉其他两块网卡信息。
[root@tiny rules.d]# vi /etc/udev/rules.d/70-persistent-net.rules[root@tiny rules.d]# 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 0x1022:0x2000 (vmxnet)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:fe:f8:14", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
我们只留下eth2的网卡信息,我们记录下eth2的mac地址:00:0c:29:fe:f8:14
。
4. 修改ifcfg-eth2中的信息
在这里我发现了一件非常尴尬的事情,在/etc/sysconfig/network-scripts/
文件夹下没有ifcfg-eth2
[root@tiny network-scripts]# ls /etc/sysconfig/network-scripts/ifcfg-eth0~ ifdown-ippp ifdown-tunnel ifup-isdn ifup-tunnelifcfg-eth1 ifdown-ipv6 ifup ifup-plip ifup-wirelessifcfg-eth1~ ifdown-isdn ifup-aliases ifup-plusb init.ipv6-globalifcfg-lo ifdown-post ifup-bnep ifup-post net.hotplugifdown ifdown-ppp ifup-eth ifup-ppp network-functionsifdown-bnep ifdown-routes ifup-ippp ifup-routes network-functions-ipv6ifdown-eth ifdown-sit ifup-ipv6 ifup-sit
但是,我们可以拷贝一个
[root@tiny network-scripts]# mv /etc/sysconfig/network-scripts/ifcfg-eth1 /etc/sysconfig/network-scripts/ifcfg-eth2
然后我们打开ifcfg-eth2
[root@tiny network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-eth2 DEVICE=eth1TYPE=EthernetUUID=eeb8ed32-3b4d-45c4-b2fe-9c7b5fe4e2acONBOOT=yesNM_CONTROLLED=yesDEFROUTE=yesIPV4_FAILURE_FATAL=yesIPV6INIT=noNAME="System eth1"HWADDR=00:0C:29:49:E9:9DLAST_CONNECT=1488606798BOOTPROTO=staticIPADDR=192.168.132.114NETMASK=255.255.255.0GATEWAY=192.168.132.1DNS1=210.31.249.20
mac地址和在70-persistent-net.rules
中的mac并不一样,我们将70-persistent-net.rules
中的mac地址复制过来,并且将DEVICE和NAME也做相应的修改
[root@tiny network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-eth2 [root@tiny network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-eth2 DEVICE=eth2TYPE=EthernetUUID=eeb8ed32-3b4d-45c4-b2fe-9c7b5fe4e2acONBOOT=yesNM_CONTROLLED=yesDEFROUTE=yesIPV4_FAILURE_FATAL=yesIPV6INIT=noNAME="System eth2"HWADDR=00:0c:29:fe:f8:14LAST_CONNECT=1488606798BOOTPROTO=staticIPADDR=192.168.132.115NETMASK=255.255.255.0GATEWAY=192.168.132.1DNS1=210.31.249.20
5. 重启服务,并测试
重启network,查看网卡信息,并测试联网情况 。执行下面的命令:
[root@tiny network-scripts]# service network restart正在关闭接口 eth2: 设备状态:3 (断开连接) [确定]关闭环回接口: [确定]弹出环回接口: [确定]弹出界面 eth2: 活跃连接状态:激活的活跃连接路径:/org/freedesktop/NetworkManager/ActiveConnection/23 [确定][root@tiny network-scripts]# ifconfigeth2 Link encap:Ethernet HWaddr 00:0C:29:FE:F8:14 inet addr:192.168.132.115 Bcast:192.168.132.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fefe:f814/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1595 errors:0 dropped:0 overruns:0 frame:0 TX packets:117 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:159465 (155.7 KiB) TX bytes:33595 (32.8 KiB) Interrupt:19 Base address:0x2024 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:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:480 (480.0 b) TX bytes:480 (480.0 b)[root@tiny network-scripts]# ping 119.75.217.109PING 119.75.217.109 (119.75.217.109) 56(84) bytes of data.64 bytes from 119.75.217.109: icmp_seq=1 ttl=64 time=0.611 ms64 bytes from 119.75.217.109: icmp_seq=2 ttl=64 time=0.261 ms^C--- 119.75.217.109 ping statistics ---2 packets transmitted, 2 received, 0% packet loss, time 1424msrtt min/avg/max/mdev = 0.261/0.436/0.611/0.175 ms
修改成功
阅读全文
0 0
- linux使用:解决克隆虚拟机后UP BROADCAST RUNNING MULTICAST问题
- VMware 虚拟机 Ubuntu 系统执行 ifconfig 命令 eth0没有IP地址(intet addr、Bcast、Mask) 解决:UP BROADCAST MULTICAST 问题
- VMware 虚拟机 linux执行 ifconfig 命令 eth0没有IP地址(intet addr、Bcast、Mask) UP BROADCAST MULTICAST 问题
- 解决虚拟机中克隆linux后系统无法上网的问题
- 解决虚拟机克隆后不能上网的问题
- 如何解决虚拟机克隆后ip冲突问题
- VMware虚拟机克隆后解决网络冲突问题
- 虚拟机克隆后网卡问题
- 关于使用虚拟机克隆后eth0见的问题
- Linux解决VMware克隆虚拟机网卡不能启动的问题
- linux克隆虚拟机出现问题bringing up interface eth0:device eth0
- MULTICAST && BROADCAST
- 解决克隆 centos虚拟机后修改克隆后的机器的ip、mac、uuid失败的问题 参考 解决办法
- 虚拟机克隆后无法联网问题修复
- Vmware克隆虚拟机后不能上网问题
- 克隆LINUX虚拟机后无网卡
- vmware 克隆linux虚拟机后设置网卡
- 虚拟机中Linux克隆后相关配置
- centos7编译安装redis-4.0.0
- springmvc实现json交互-requestBody和responseBody
- c++实现直接插入排序
- java web在线人数统计
- qt学习之修改图标
- linux使用:解决克隆虚拟机后UP BROADCAST RUNNING MULTICAST问题
- 数据存储的学习
- 学习MongoDB笔记(二)——mogo基础操作
- HTML5之Svg(三)文本与图像
- 聚焦关键信息基础设施防护,2017中国信息安全服务年会顺利召开!
- git教程--删除文件
- c++实现希尔排序
- LeetCode-14-Longest Common Prefix(最长公共前缀)
- Error: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not b