Centos 8 如何修改网卡名称

  • Step 1. The robust solution that worked for me: These four lines that must exist in the network-script file:

/etc/sysconfig/network-scripts/ifcfg-somename1

NAME=somename1 DEVICE=somename1 HWADDR=FE:FF:GG:11:00:10 UUID=b623cbaa-ffe2-3456-7890-1a23b465cd67 

Caveat: The file cannot have HWADDR and MACADDR at the same time, it can only have one or the other. You can get the UUID from the command nmcli c.

  • Step 2. add net.ifnames=0 somewhere after nomodeset and before rhgb in this file:

/etc/default/grub

then run the command sudo grub2-mkconfig -o /boot/grub2/grub.cfg

  • Step 3. Match the MAC address to the nic name in this file:

/etc/systemd/network/70-custom-ifnames.link

[Match] MACAddress=FE:FF:GG:11:00:10 [Link] Name=somename1 
  • Step 4. Add these lines to the custom rules file:

/etc/udev/rules.d/70-custom-ifnames.rules

SUBSYSTEM=="net",ACTION=="add",ATTR{address}=="FE:FF:GG:11:00:10",ATTR{type}=="1",NAM

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值