怎样把centos 6.2 系统里的网卡em1还原为eth0
来源:互联网 发布:java的if else编程 编辑:程序博客网 时间:2024/05/22 19:03
vi /boot/grub/grub.conf
增加一个 biosdevname=0 的启动参数,我修改的结果如下:
[root@xingfujie ~]# cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/sda1
# initrd /boot/initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-220.el6.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-220.el6.x86_64 ro root=UUID=360d089b-d466-4005-abcb-c5e517d31a96 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM biosdevname=0 #--->这里是新加的
initrd /boot/initramfs-2.6.32-220.el6.x86_64.img
第二步:删除udev的配置文件rm -f /etc/udev/rules.d/70-persistent-net.rules
注:第二步可以不需要操作。
第三步:修改当前网卡配置文件的名称
mv ifcfg-em1 ifcfg-eth0
mv ifcfg-em2 ifcfg-eth1
mv ifcfg-em3 ifcfg-eth2
mv ifcfg-em4 ifcfg-eth3
第四步:修改网卡配置文件内容,把em1全部修改改为eth0
[root@xingfujie ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="24:B6:FD:F8:D5:84"
NM_CONTROLLED="yes"
ONBOOT="yes"
可以使用命令进行替换,如下:
perl -p -i -e 's/em1/eth0/g' ifcfg-eth0 或sed -i 's/em1/eth0/g' ifcfg-eth0
最后一步:重新启动系统 shutdown -r now 启动之后你就发现熟悉的eth0-eth4已经回来啦,顺便说下centos 6.2 还有一个问题就是如果你没有在网卡配置文件里写dns的话,重启之后你就会发现 /etc/resolv.conf 文件被清空了,一个方法就是在网卡配置文件中写DNS,另一个方法就是给/etc/resolv.conf加i属性,chattr +i /etc/resolv.conf
- 怎样把centos 6.2 系统里的网卡em1还原为eth0
- 怎样把centos 6.2 系统里的网卡em1还原为eth0
- 把CentOS 系统里的网卡em1还原为eth0
- 怎样把centos 6.5 系统里的网卡em1还原为eth0
- centos网卡em1改为eth0
- centos6.x修改网卡名称em1、2...为eth0、1...
- 为什么Centos/Redhat6 里看到的网卡是em1 或者p2p1
- 为什么redhat6里看到的网卡是em1?
- 为什么redhat6里看到的网卡是em1
- centos/rhel 6.2 单网卡em1:0设置双IP
- CentOS 7 修改网卡名称为 eth0
- centos7下的系统网卡名称eno16777736更改为eth0
- 主题:怎样把网卡的rom读出来写到文件里?
- CentOS 网卡eth0,未识别的端口
- CentOS修改eth0网卡的名字-yellowcong
- VM 克隆的 centos 的Linux下网卡eth1如何修改为eth0解决办法
- 问题1-- VM 克隆的 centos 的Linux下网卡eth1如何修改为eth0解决办法
- 修改CentOS 7网卡名称eno16777736为eth0
- Android手动切换屏幕方向
- 苹果大中华区营收同比增48% iPhone销量翻番
- 数据库表结构查看工具 DBTool
- 对于通配符*的使用要注意
- Tizen Developer website
- 怎样把centos 6.2 系统里的网卡em1还原为eth0
- Android文件读写操作(含SDCard的读写)
- Linux中的定时任务调度—crontab命令
- linux 内核与用户空间通信之netlink使用方法
- javascript之正则表达式
- 电子签名工具 SignatureTool
- 继承TreeNode,使其在客户端显示Value
- Android Canvas DrawText中文乱码问题。
- poj2485 Highways