linux中使用ifconfig命令檢視網絡卡資訊時顯示為eth1,但是在network-scripts中只有ifcfg-eth0的配置檔案,並且裡面的NAME="eth0"。
除了題目中的問題,其實在執行命令:service network restart時,會報錯:
解決辦法:
首先需要修改70-persistent-net.rules檔案:
vim /etc/udev/rules.d/70-persistent-net.rules
然後修改ifcfg-eth0檔案:
vim /etc/sysconfig/network-scripts/ifcfg-eth0
最後:重啟網路:service network restart
如果ifconfig命令下,eth1沒有改變為eth0,重啟系統:init 6 或:service NetworkManager restart可以解決。