Linux6-修改网卡名字:eth2—>>>>eth1

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:280

Linux6-修改网卡名字:eth2--->>>>eth1
1、由于未发现有/etc/udev/rule.d/70-persistent-net.rules文件,重启;重启后也未发现此文件

2、手动执行/lib/udev/write_net_rules;提示缺少变量INTERFACE

root@server:/lib/udev/rules.d# /lib/udev/write_net_rules
missing $INTERFACE
增加变量:

root@server: export INTERFACE="eth0"
missing valid match

root@server:export MATCHADDR="00:0c:29:1f:1a:f5"

root@server:/lib/udev/write_net_rules

# ls /etc/udev/rules.d/
70-persistent-net.rules README

修改70-persistent-net.rules

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:1f:1a:f5", KERNEL=="eth*", NAME="eth0"

修改后:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:1f:1a:eb", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:1f:1a:f5", KERNEL=="eth*", NAME="eth1"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:1f:1a:ff", KERNEL=="eth*", NAME="eth2"

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】