0、错误信息:网络
[root@hadoop101 network-scripts]# service network restart 关闭环回接口: [肯定] 弹出环回接口: [肯定] 弹出界面 eth0: 错误:没有找到合适的设备:没有找到可用于链接 'System eth0' 的设备。
一、查看系统是否识别相应网卡(发现没有eth0网卡存在):oop
[root@hadoop101 network-scripts]# ifconfig eth1 Link encap:Ethernet HWaddr 00:0C:29:A8:21:63 inet addr:192.168.184.134 Bcast:192.168.184.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fea8:2163/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:162 errors:0 dropped:0 overruns:0 frame:0 TX packets:51 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:11995 (11.7 KiB) TX bytes:4798 (4.6 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:65536 Metric:1 RX packets:52 errors:0 dropped:0 overruns:0 frame:0 TX packets:52 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:4416 (4.3 KiB) TX bytes:4416 (4.3 KiB)
根据显示信息咱们能够初步断定系统网卡信息有问题,没有eth0网卡信息。rest
二、查看当前MAC地址相关信息:code
[root@hadoop101 桌面]# 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) #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:01:26:11", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # PCI device 0x8086:0x100f (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:0b:a3:b2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # PCI device 0x8086:0x100f (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:a8:21:63", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
发现多出一块eth1网卡信息。接口
三、删除多余mac地址信息,并修改网卡配置文件:ip
/etc/udev/rules.d/70-persistent-net.rules 文件下记录着网卡对应mac地址信息:hadoop
# 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:01:26:11", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # PCI device 0x8086:0x100f (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:0b:a3:b2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # PCI device 0x8086:0x100f (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:a8:21:63", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
删除 全部eth0的网卡信息,留下eth1。而且记录下eth1对应的MAC地址,将eth1改为eth0 ;generator
将/etc/sysconfig/net-script/ifcfg-etho的mac地址替换掉虚拟机
四、重启网络服务service network restart或者重启虚拟机reboot,完成 ~it