遷移vmware伺服器後Device eth0 does not seem to be present
用VMware 安裝 linux 6.0 後,網路連線不上 service network restart 出現以下提示
evice eth0 does not seem to be present
使用ifconfig 命令只能看到lo 的狀態資訊, 使用ifconfig -a 如下
——————————————————————————————————————
eth4 Link encap:Ethernet HWaddr 00:0C:29:75:9D:A8
inet addr:192.168.1.133 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe75:9da8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4377 errors:2 dropped:3 overruns:0 frame:0
TX packets:988 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:451841 (441.2 KiB) TX bytes:78718 (76.8 KiB)
Interrupt:19 Base address:0x2000
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:246 errors:0 dropped:0 overruns:0 frame:0
TX packets:246 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:27552 (26.9 KiB) TX bytes:27552 (26.9 KiB)
——————————————————————————————————————————————————————
eth0變eth4了,暈,想了半天,明白了,是因為我裝linux後,把linux虛擬盤複製了4次,以滿足我的多系統的測試。 所以複製後的網絡卡分別變成1-4了。
我是這樣解決的,
先把指令碼eth0 改成 eth4
[[email protected] ~]# mv /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth4
[[email protected] ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth4
DEVICE="eth4"
HWADDR="00:0C:29:75:9D:A8" #(注意,這是原來eth0的MAC 要改成ifconfig -a 後顯示的 eth4的MAC哦)
NM_CONTROLLED="yes"
ONBOOT="yes"
BROADCAST="192.168.1.255"
BOOTPROTO="static"
IPADDR="192.168.1.133"
NETMASK="255.255.255.0"
NETWORK="192.168.1.0"
GATEWAY="192.168.1.1"
儲存後
service network restart 解決問題