当前位置: > 数据库 > Oracle >

用Oracle VirtualBox 安装 CentOS 6.0 后连接不上网络

时间:2014-10-07 17:00来源:linux.it.net.cn 作者:it
Device eth0 does not seem to be present,

    用Oracle VirtualBox 安装 CentOS 6.0 后,网络连接不上 service network restart 出现以下提示

      evice eth0 does not seem to be present

使用ifconfig 命令只能看到lo  的状态信息,  使用ifconfig -a   如下

——————————————————————————————————————

eth4      Link encap:Ethernet  HWaddr 00:0C:29:75:9D:A8
          inet addr:192.168.1.133  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe75:9da8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4377 errors:2 dropped:3 overruns:0 frame:0
          TX packets:988 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:451841 (441.2 KiB)  TX bytes:78718 (76.8 KiB)
          Interrupt:19 Base address:0x2000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:246 errors:0 dropped:0 overruns:0 frame:0
          TX packets:246 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:27552 (26.9 KiB)  TX bytes:27552 (26.9 KiB)
——————————————————————————————————————————————————————

   eth0变eth4了,晕,想了半天,明白了,是因为我装linux后,把linux虚拟盘复制了4次,以满足我的多系统的测试。 所以复制后的网卡分别变成1-4了。

    我是这样解决的,

先把脚本eth0 改成 eth4

[root@linux ~]# mv  /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth4 


[root@linux ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth4

DEVICE="eth4"

//绑定网卡mac地址
HWADDR="00:0C:29:75:9D:A8"  #(注意,这是原来eth0的MAC 要改成ifconfig -a 后显示的 eth4的MAC哦)

NM_CONTROLLED="yes"
ONBOOT="yes"
BROADCAST="192.168.1.255"
BOOTPROTO="static"
IPADDR="192.168.1.133"
NETMASK="255.255.255.0"
NETWORK="192.168.1.0"
GATEWAY="192.168.1.1"

 

      保存后

service network restart 解决问题


(责任编辑:IT)
------分隔线----------------------------