修改Fedora 16 的网络接口名使其变回 eth0

80497312 2012-05-05

Fedora 16 搞的consistent network device names本人觉的很哦心,很难记。

all onboard ethernet adapters are labeled as emX (em1, em2…) and all PCI ethernet adapters are labeled as pXpX (p[slot]p[port], like p7p1 for port 1 on slot 7).

我的网卡名就变成了p3p1

下面我们就来把她改成eth0

vim /etc/default/grub
在 GRUB_CMDLINE_LINUX=<font color="#2a00ff">"rd.lvm.lv=VolGroup/LogVol01 rd.lvm.lv=VolGroup/LogVol00 rd.dm=0 LANG=zh_CN.UTF-8  KEYTABLE=us quiet rhgb rd.md=0 rd.luks=0 "</font> 中加入biosdevname=0
变成
GRUB_CMDLINE_LINUX=<font color="#2a00ff">"rd.lvm.lv=VolGroup/LogVol01 rd.lvm.lv=VolGroup/LogVol00 rd.dm=0 LANG=zh_CN.UTF-8  KEYTABLE=us quiet rhgb rd.md=0 rd.luks=0 biosdevname=0 "</font>
  
$grub2-mkconfig -o /boot/grub2/grub.cfg
  
$<font color="#ff1493">touch</font> /etc/udev/rules.d/70-persistent-net.rules
<font color="#3f5fbf">#写入 </font>
SUBSYSTEM==<font color="#2a00ff">"net"</font>, ACTION==<font color="#2a00ff">"add"</font>, DRIVERS==<font color="#2a00ff">"?*"</font>, ATTR{address}==<font color="#2a00ff">"44:37:e6:19:46:5e"</font>, ATTR{dev_id}==<font color="#2a00ff">"0x0"</font>, ATTR{<font color="#ff1493">type</font>}==<font color="#2a00ff">"1"</font>, KERNEL==<font color="#2a00ff">"eth*"</font>, NAME=<font color="#2a00ff">"eth0"</font>
  
$<font color="#ff1493">cd</font> /etc/sysconfig/network-script/
  
$<font color="#ff1493">cp</font> ifcfg-p3p1  ifcfg-eth0
  
<font color="#3f5fbf">#再把里面的DEVICE="p3p1" 改成DEVICE="eth0" </font>
reboot机器就可以了

相关推荐

ganyouxianjava / 0评论 2012-05-31