日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

怎样把centos 6.2 系统里的网卡em1还原为eth0

發布時間:2025/6/15 windows 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 怎样把centos 6.2 系统里的网卡em1还原为eth0 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2019獨角獸企業重金招聘Python工程師標準>>>

第一步 :修改系統grub
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

轉載于:https://my.oschina.net/zhangxu0512/blog/359521

總結

以上是生活随笔為你收集整理的怎样把centos 6.2 系统里的网卡em1还原为eth0的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。