红联Linux门户
Linux帮助

KVM虚拟机实例网络无法启动一例

发布时间:2014-07-24 15:25:09来源:linux网站作者:ddl007

创建的KVM虚拟机实例,网络无法启动。尝试:

service network restart    提示:

device "eth0" does not seem to be present, delaying initialization


查看网络设备:

ls /etc/sysconfig/network-scripts/ifcfg*
/etc/sysconfig/network-scripts/ifcfg-eth0  /etc/sysconfig/network-scripts/ifcfg-lo


ifconfig -a  查看:

eth1      Link encap:Ethernet  HWaddr FA:16:3E:32:79:88
inet6 addr: fe80::f816:3eff:fe32:7988/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:159 errors:0 dropped:0 overruns:0 frame:0
TX packets:85 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17826 (17.4 KiB)  TX bytes:12487 (12.1 KiB)
Interrupt:10 Base address:0xa000

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)


可以看出是网卡配置异常,记录下eth1的mac地址,修改/etc/sysconfig/network-scripts/ifcfg-eth0 为:

DEVICE="eth1"
BOOTPROTO="dhcp"
HWADDR="FA:16:3E:32:79:88"
NM_CONTROLLED="yes"
ONBOOT="yes"


改名:

mv /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1


再重启网络服务:

service network restart

网络正常了!