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