VirtualBox下Centos6 配置eth0 提示Device does not see...

故障現象

重啓網絡: html

service network restart

獲得如下提示信息: linux

Shutting down loopback insterface:                                                                          [   OK  ]
Bringing up loopback insterface:                                                                            [   OK  ]
Bringing up interface eth0:  Device eth0 does not seem to be present,delaying initialization.               [   FAILED  ]

解決問題的過程

運行ifconfig命令查看網卡設備: centos

ifconfig -a

個人到了如下信息: 服務器

只出現了eth1而沒有出現eth0, 網絡

而後經過查看虛擬機的網卡配置,咱們能夠獲得網卡的mac地址: ide

然後經過查看 /etc/sysconfig/network-scripts/ 文件夾下的網卡配置: oop

ll /etc/sysconfig/network-scripts/ | grep "ifcfg-"

我發現能夠能獲得ifcfg-eth0的信息: ui

嘗試把ifcfg-eth0重命名成ifcfg-eth1,而且把文件裏的 DEVICE 參數值從 eth0 改爲 eth1 ,重啓網絡。至此,問題搞定。 spa

反思和總結

Centos網絡配置文件

RedHat系列的linux全部有關網絡的配置文件,都放在了 /etc/sysconfig/network-scripts/ 文件夾下。這個文件夾下一共有三類腳本: rest

  1. 網絡接口配置文件(Interface configuration files)
  2. 網絡接口控制腳本(Interface control scripts)
  3. 網絡功能腳本(Network function files)

/etc/hosts

本地的域名和ip地址解析文件。e.g. 127.0.0.1 localhost

/etc/resolv.conf

DNS域名解析的配置文件,它包含了主機的域名搜索順序和DNS服務器的地址,每一行應包含一個關鍵字和一個或多個的由空格隔開的參數。

/etc/sysconfig/network

這個文件包含了全部網絡接口共享的路由以及主機名信息。

更多信息能夠參考 Section 27.1.22, 「/etc/sysconfig/network」Linux經常使用網絡配置文件介紹

/etc/sysconfig/network-scripts/ifcfg-

系統網絡接口設備的配置文件。關於這些網絡接口設備的配置參數,參考文檔:Section 13.2, 「Interface Configuration Files」

參考文檔

  1. Centos 配置eth0 提示Device does not seem to be present
  2. CentOS 6.0找不到ifcfg-eth0解決方案
  3. Deployment Guide Chapter 13. Network Interfaces
  4. Linux經常使用網絡配置文件介紹
  5. Red_Hat_Enterprise_Linux-6-Deployment_Guide
  6. Red_Hat_Enterprise_Linux-6-Deployment_Guide
相關文章
相關標籤/搜索