vm下rhel6网卡启动不了

       vm esx4.1对rhel6的支持不是太好,克隆了一个rhel6的VM,启动网卡报错Device eth0 does not seem to be present,delaying initialization.发现IP地址、MAC地址都没有改,手工改了之后还是报错,这是由于克隆后的系统还是认原来的MAC地址,即使改了ifcfg-eth文件也没有用,这里有两个办法,第一种办法比较简单直接,直接把原网卡删除,再重新添加网卡,系统就会为新网卡重新配置MAC,第二种方法复杂一些,但是会加深对linux网络服务的了解

[root@Oracle ~]# cat /etc/udev/rules.d/70-persistent-net.rules

# This file was automatically generated by the /lib/udev/write_net_rules

# program, run by the persistent-net-generator.rules rules file.

#

# You can modify it, as long as you keep each rule on a single

# line, and change only the value of the NAME= key.

# net device () (custom name provided by external tool)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:16:31:11", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


# net device ()

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:32:66:63", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

 

原来UDEV这里把克隆前的MAC当成了当前虚拟机的eth0 MAC,而重新生成的08:00:27:32:66:63是eth1的MAC。

删除旧的UDEV配置,将新的UDEV配置的网卡名字改为eth0:

[root@Oracle ~]# cat /etc/udev/rules.d/70-persistent-net.rules

# This file was automatically generated by the /lib/udev/write_net_rules

# program, run by the persistent-net-generator.rules rules file.

#

# You can modify it, as long as you keep each rule on a single

# line, and change only the value of the NAME= key.

 

# net device () (custom name provided by external tool)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:32:66:63", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

 

重启network服务,一切OK(这里如果还是不行重启系统应该能搞定)

[root@Oracle ~]# /etc/init.d/network restart

Shutting down interface eth0:                              [  OK  ]

Shutting down loopback interface:                          [  OK  ]

Bringing up loopback interface:                            [  OK  ]

Bringing up interface eth0:                                [  OK  ]


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值