虛擬機克隆後遇到的網絡相關的問題

0、錯誤信息:

[root@hadoop101 network-scripts]# service network restart
關閉環回接口:                                             [確定]
彈出環回接口:                                             [確定]
彈出界面 eth0: 錯誤:沒有找到合適的設備:沒有找到可用於連接 'System eth0' 的設備。

1、查看系統是否識別相應網卡(發現沒有eth0網卡存在):

[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網卡信息。

2、查看當前MAC地址相關信息:

[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網卡信息。

3、刪除多餘mac地址信息,並修改網卡配置文件:

/etc/udev/rules.d/70-persistent-net.rules 文件下記錄着網卡對應mac地址信息:

# 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 ;

將/etc/sysconfig/net-script/ifcfg-etho的mac地址替換掉

4、重啓網絡服務service network restart或者重啓虛擬機reboot,完成 ~

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章