卸載
使用命令ifconfig命令查看網卡情況
確認自己使用的是哪一塊網卡,然后把其它的網卡都卸載掉。
運行命令ifconfig 網卡名稱 down。
如: ifconfig eth1 down
再次運行ifconfig就會發現被卸載掉的網卡沒了。現在可以ping 一下內網的IP試試看能不能ping通。
刪除
一、刪除VM中多余的ifcfg-eth0.bak
Centos系統更改網卡或網卡MAC地址后會出現個eth0.bak配置備份文件
解決方法:
/etc/sysconfig/networking/devices目錄下,將ifcfg-eth0.bak刪除
/etc/sysconfig/networking/profiles/default,將ifcfg-eth0.bak刪除
/etc/sysconfig/network-scripts/,將ifcfg-eth0.bak刪除
二、刪除Linux系統中多余的網卡(例如:eth1)
/etc/modprobe.conf,刪除alias eth1 XXXX
/etc/sysconfig/networking/devices目錄下,將ifcfg-eth1刪除
/etc/sysconfig/networking/profiles/default目錄下,將ifcfg-eth1刪除
/etc/sysconfig/network-scripts/目錄下,將ifcfg-eth0.bak刪除
三、檢測網絡接口(eth0)是否工作正常
/etc/modprobe.conf,該文件中必須有:alias eth0 XXX
/etc/sysconfig/hwconf,該文件中eth0對應的配置也必須正確
/etc/sysconfig/network-scripts目錄下,必須有網絡接口的配置文件:ifcfg-eth0
/etc/sysconfig/network-scripts/ifcfg-eth0文件中的配置是否正確,例如:DEVICE=eth0