启动虚拟化支持后,网卡无法激活

来源:互联网 发布:贵州网络微商传销 编辑:程序博客网 时间:2024/05/14 06:34

问题:


64位CPU,BIOS中未设置虚拟化支持。主机操作系统 - Windows XP,Vmware Workstation 7.01,客户操作系统fedora 15, 32bit。工作正常。

在BIOS中打开虚拟化支持,启动XP,启动fedora,发现无法连接网络。

#ifconfig

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:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

网卡不工作。


解决:

查看/var/log/message,发现:

/etc/sysconfig/network-scripts/ifup-eth: Device p3p1 does not seem to be present, delaying initialization.

p3p1是开启虚拟化之前fedora的网卡名称,安装的时候默认的,没有修改过。

#ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:0C:29:D4:03:20
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:144 errors:0 dropped:0 overruns:0 frame:0
          TX packets:124 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:16558 (16.1 KiB)  TX bytes:41388 (40.4 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:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
发现eth0,但是p3p1不见了。没搞清楚为什么,有人知道麻烦告诉我:)

网卡被检测到了,但是没有被分配地址,于是

#dhclient eth0

(参考:http://stackoverflow.com/questions/175876/how-do-i-fix-my-vms-network-connection-if-it-seems-to-be-running-ok-from-the-hos)

#ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0C:29:D4:03:20
          inet addr:192.168.20.140  Bcast:192.168.20.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fed4:320/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:51 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7373 (7.2 KiB)  TX bytes:7636 (7.4 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:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
现在可以看到,eth0工作了。


接下来,重启fedora 15,同样的问题再次出现。不可能每次都去手动dhclient,肯定还有需要改的地方。

根据/var/log/messages里的提示,做了以下修改:

1, #mv /etc/sysconfig/network-scripts/ifcfg-p3p1 /etc/sysconfig/network-scripts/ifcfg-eth0

2,把移动后的ifcfg-eth0中的DEVICE="P3P1"换为DEVICE="eth0"


重新启动,一切正常。搞定:)