【Linux】Linux网络配置基础4 RHEL6 操作系统更换网卡

Linux网络配置基础4
RHEL6 操作系统更换网卡

如服务器网卡故障更换网卡,或者服务器其他硬件故障,直接把硬盘拆下放到其他服务器上使用时。

都是网卡硬件发生变化,对应的是网卡mac地址改变。
此时系统启动起来后,网络是无法正常使用的。
涉及到一个文件
/etc/udev/rules.d/70-persistent-net.rules


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


[root@rhel64 ~]# poweroff
关闭操作系统,修改虚拟机网卡mac地址,模拟更换网卡硬件







启动虚拟机,CRT已经无法远程连接,使用控制台图形化界面登陆管理


[root@rhel64 ~]# ifconfig
[root@rhel64 ~]# ifocnfig -a


[root@rhel64 ~]# service network restart
[root@rhel64 ~]# ifup eth0
报错:Device eth0 does not seem to be present,delaying initialization.



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


[root@rhel64 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0


【解决方法】
手动修改网卡eth0配置文件,使用ifconfig -a查询出来的新mac地址替换旧mac


修改/etc/udev/rules.d/70-persistent-net.rules文件,注释或删除掉eth0对应行
将新mac地址对应的eth1更改为eth0

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


重启操作系统验证
[root@rhel64 ~]#reboot
[root@rhel64 ~]# ifconfig

网络已经恢复,CRT可以远程连接


也可以只修改eth0网卡配置文件对应HWADDR,
直接删除/etc/udev/rules.d/70-persistent-net.rules文件,重启操作系统后此文件会自动生成。

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





吕星昊
2016.7.12

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29475508/viewspace-2121900/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29475508/viewspace-2121900/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值