RHEL6虛擬機器轉殖網路問題解決方法

2021-09-02 13:48:21 字數 2677 閱讀 9574

rhel6虛擬機器轉殖網路問題解決方法

環境:virtualbox+rhel 6 x64

用virtualbox的vboxmanager轉殖的虛擬機器,作業系統rhel6,啟動後發現網絡卡不能用了。重啟網路服務,報以下錯誤:

bringing up inte***ce eth0: device eth0 does not seem to be present, delaying initialization. [failed]

在rhel5裡也發生類似事情,因為複製虛擬機器mac會重新生成,但是作業系統的mac卻寫在ifcfg-ethx裡,造成了不一致,所以不能啟動網路介面,在rhel5裡可以使用kudzu或者注釋網絡卡配置檔案的mac欄位來解決這個問題。但是在rhel6裡,kudzu已經被hal服務取代了。

雖然lspci能夠正常認到網絡卡,但是卻無法使用/etc/init.d/network restart來啟動服務。嘗試注釋ifcfg-eth0的mac欄位,還是報錯。檢視了下udev的規則,發現了問題的所在。

[root@

oracle

~]# 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.

# net device () (custom name provided by external tool)

subsystem=="net", action=="add", drivers=="?*", attr=="08:00:27:16:31:11", attr=="1", kernel=="eth*", name="eth0"

# net device ()

subsystem=="net", action=="add", drivers=="?*", attr=="08:00:27:32:66:63", attr=="1", kernel=="eth*", name="eth1"

[root@oracle ~]#

原來udev這裡把轉殖前的mac當成了當前虛擬機器的eth0 mac,而重新生成的08:00:27:32:66:63是eth1的mac。

解決這個問題,只要刪除舊的udev配置,修改為:

[root@oracle ~]# 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.

# net device () (custom name provided by external tool)

subsystem=="net", action=="add", drivers=="?*", attr=="08:00:27:32:66:63", attr=="1", kernel=="eth*", name="eth0"

重啟network服務,一切ok

[root@oracle ~]# /etc/init.d/network restart

shutting down inte***ce eth0: [ ok ]

shutting down loopback inte***ce: [ ok ]

bringing up loopback inte***ce: [ ok ]

bringing up inte***ce eth0: [ ok ]

[root@oracle ~]# ifconfig eth0

eth0 link encap:ethernet hwaddr 08:00:27:32:66:63

inet addr:172.16.100.3 bcast:172.16.100.255 mask:255.255.255.0

inet6 addr: fe80::a00:27ff:fe32:6663/64 scope:link

up broadcast running multicast mtu:1500 metric:1

rx packets:206 errors:0 dropped:0 overruns:0 frame:0

tx packets:203 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

rx bytes:21157 (20.6 kib) tx bytes:24515 (23.9 kib)

virtualbox有這個問題,vmware轉殖虛擬機器應該也是有這個問題的。

kvm虛擬機器配置被轉殖rhel6客戶機的網絡卡

例子 配置被轉殖rhel6客戶機的網絡卡 rhel6的網絡卡是通過udev規則來進行命名 每個網絡卡都有不一樣的mac udev規則是根據網絡卡的mac來進行識別 轉殖出來的客戶機,為了遵守每個網絡卡的mac都是全球唯一的準則,所以轉殖之後的新客戶機的網絡卡mac位址肯定發生變化 結果 轉殖出來的客...

解決虛擬機器轉殖網路配置問題

使用vmware轉殖了3臺虛擬機器,配置網絡卡的時候出現報錯 device eth0 does not seem to be present,delaying initialization 解決方法簡單,如下三步 第一步 刪除檔案70 persistent net.rules rm f etc ud...

6 kvm轉殖虛擬機器

kvm轉殖有兩種方法可以使用 先暫停kvm虛擬機器 virsh suspend privi server 方法一 對虛擬機器本身直接clone virt clone o privi server n privi server clone f kvm clone privi server clone....