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


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

故障现象
重启网络:
service network restart
得到以下提示信息:
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命令查看网卡设备:
ifconfig -a
我的到了以下信息:

只出现了eth1而没有出现eth0,
然后通过查看虚拟机的网卡配置,我们可以得到网卡的mac地址:

而后通过查看 /etc/sysconfig/network-scripts/ 文件夹下的网卡配置:
ll /etc/sysconfig/network-scripts/ | grep "ifcfg-"
我发现可以能得到ifcfg-eth0的信息:

尝试把ifcfg-eth0重命名成ifcfg-eth1,并且把文件里的 DEVICE 参数值从 eth0 改成 eth1 ,重启网络。至此,问题搞定。

反思和总结
Centos网络配置文件
RedHat系列的linux所有有关网络的配置文件,都放在了 /etc/sysconfig/network-scripts/ 文件夹下。这个文件夹下一共有三类脚本:
网络接口配置文件(Interface configuration files)
网络接口控制脚本(Interface control scripts)
网络功能脚本(Network function files)
/etc/hosts
本地的域名和ip地址解析文件。e.g. 127.0.0.1 localhost
/etc/resolv.conf
DNS域名解析的配置文件,它包含了主机的域名搜索顺序和DNS服务器的地址,每一行应包含一个关键字和一个或多个的由空格隔开的参数。
/etc/sysconfig/network
这个文件包含了所有网络接口共享的路由以及主机名信息。

相关内容

    暂无相关文章