linux7 udev eth,CENTOS 7 udev:renamed network interface eth0 to eth1 eno16777736

将这个/etc/udev/rules.d/70-persistent-net.rules删除,重启,网卡eth0成功启动,并重新生成/etc/udev/rules.d/70-persistent-net.rules文件。

[iyunv@localhost rules.d]# cat 70-persistent-ipoib.rules

# This is a sample udev rules file that demonstrates how to get udev to

# set the name of IPoIB interfaces to whatever you wish.  There is a

# 16 character limit on network device names though, so don't go too nuts

#

# Important items to note: ATTR{type}=="32" is IPoIB interfaces, and the

# ATTR{address} match must start with ?* and only reference the last 8

# bytes of the address or else the address might not match on any given

# start of the IPoIB stack

#

# Note: as of rhel7, udev is case sensitive on the address field match

# and all addresses need to be in lower case.

#

# ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{type}=="32", ATTR{address}=="?*00:02:c9:03:00:31:78:f2", NAME="mlx4_ib3"

上次装archLinux时把整个win都给删掉了,现在觉得还是略有些不方便,所以格盘重新安装了win7,然后准备再次安装arch

不过下载了最新镜像后,安装一路没问题,重启后顺利进入系统,不过wifi-menu提示找不到wlan0

ip link set wlan0 up也提示interface wlan0 not found

dmesg|grep -i wlan0后发现一句systemd-udevd:renamed network interface wlan0 to wl8s0

按wl8s0操作,没有问题,可以up。。。

不过,为啥会被改成这个奇葩名字呢?dmesg发现eth0也被改了一个名字

还有/etc/udev/下的文件夹都是空的,rule.d里边也是空的,正常吗?

网上的类似的办法都是修改rule.d的配置,而且接口名字也只是wlan0被改成了wlan1,但没有出现wl8s0这种奇葩(准确的名字记不得了,不过大致是这几个字母)

邮件列表原文:

Since 197 was just tagged and there still seems to be some confusion, here's an FAQ: *** What happens after installing systemd 197?

For existing installs: Nothing happens, and this is strictly opt-in. A post_upgrade() message will mention the feature and add a dummy file called /etc/udev/rules.d/80-net-name-slot.rules to mask the new rule which performs the renaming.

If you wish to opt-in, remove this dummy file. Next reboot, the rule will take effect. For new installs: You are opted-in to this change. The post_install() will do nothing to mask the rule.

If you wish to opt out, you can do 1 of 2 things:

1) mask the rule: ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules

2) provide your own udev rule that applies a NAME to the interface. As long as this rule is ordered lexically before 80-net-name-slot.rules, then the upstream rule will have no effect. For example, providing a file called 70-net-naming.rules will trump 80-net-name-slot.rules.

首先,先编辑网卡的配置文件 vi /etc/sysconfig/network-scripts/ifcfg-eno16777736 将里面的NAME项修改为eth0

然后,禁用该可预测命名规则。对于这一点,你可以在启动时传递“net.ifnames=0 biosdevname=0 ”的内核参数。这是通过编辑/etc/default/grub并加入“net.ifnames=0 biosdevname=0 ”到GRUBCMDLINELinux变量来实现的。

运行命令grub2-mkconfig -o /boot/grub2/grub.cfg 来重新生成GRUB配置并更新内核参数。

其实到第5步的时候,重启在ifconfig查看应该就已经生效了,根据Centos 官方WIKI的FAQ中得知,如果你有多个接口,并且想要控制其设备名,而不是让内核以它自己的方式命名,创建,/etc/udev/rules.d/XXX-net.rules规则是必要的!那么这里我们也创建好规则吧。

注意:以前系统的net规则名称是70-persistent-net.rules,这里我也按照这个名字定义规则!

Linux系统版本:CentOS_7(64位)

一、前言:

今天又从Centos 6.5装回了Centos 7,毕竟还是要顺应潮流嘛。安装完成之后,发现发现CentOS 7默认的网卡名称是eno16777736,如图所示:

302bad67f9dda864b7616bad5169f95e.gif

1643479022221381.jpg (21.37 KB, 下载次数: 1)

2015-8-3 08:51 上传

像我这种有轻微强迫症的人看到这个名字总感觉不爽,于是偏要把eno16777736改成以前版本的eth0,那就开始吧。

二、修改CentOS 7的网卡名称:

输入如下命令,进入对应目录,编辑文件:

1.vim /etc/sysconfig/grub

然后,往这个文件中添加“net.ifnames=0 biosdevname=0”内容,如下图所示:

302bad67f9dda864b7616bad5169f95e.gif

1643479022221382.jpg (9.67 KB, 下载次数: 2)

2015-8-3 08:51 上传

上图中,红框部分是我所添加的内容(注意它的位置)。

紧接着,执行如下命令:

1.grub2-mkconfig -o /boot/grub2/grub.cfg

效果如下:

302bad67f9dda864b7616bad5169f95e.gif

1643479022221383.jpg (18.87 KB, 下载次数: 1)

2015-8-3 08:51 上传

然后,重启系统后查看网卡名称:

302bad67f9dda864b7616bad5169f95e.gif

1643479022221384.jpg (20.85 KB, 下载次数: 0)

2015-8-3 08:51 上传

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值