天天看點

Linux相關【oracle linux中ifconfig不顯示eth0或者ens33】--01

系統環境:

Linux相關【oracle linux中ifconfig不顯示eth0或者ens33】--01

問題:oracle linux中ifconfig不顯示eth0或者ens33,如圖:

Linux相關【oracle linux中ifconfig不顯示eth0或者ens33】--01

第一步:打開terminal,輸入cd /etc/sysconfig/network-scripts 進入目錄,輸入ifconfig -a指令,可以看到eth0和lo。

Linux相關【oracle linux中ifconfig不顯示eth0或者ens33】--01

第二步:輸入ifconfig eth0 up,啟用網卡。此時用ifconfig,隻能看到inet6的位址,沒有ip

Linux相關【oracle linux中ifconfig不顯示eth0或者ens33】--01

第三步:輸入vi ifcfg-eth0 或者vi ifcfg-ens33(可使用ll -ltrh ifcfg-*檢視具體是哪個)編輯檔案, 把ONBOOT=no 改為 ONBOOT=yes,檢查其他資訊有沒有錯誤(自動生成的,一般沒有問題)。

Linux相關【oracle linux中ifconfig不顯示eth0或者ens33】--01

第四步:重新開機服務,檢視現象    service restart network 

Linux相關【oracle linux中ifconfig不顯示eth0或者ens33】--01

完美解決!

另外--

/etc/sysconfig/network-scripts 目錄下沒有ifcfg-ens*開頭的檔案。

可以看到并沒有生成網卡配置檔案ifcfg-ens34,而之前在建立虛拟機時增加的網卡ens*是有相應的配置檔案ifcfg-ens*。在oracle linux 中使用nmtui來設定網絡,nmtui 屬于curses-based text user interface(文本使用者界面), 類似Linux7以前的setup工具。

nmtui