CentOS修改网卡名称

root
233
文章
0
评论
2020年2月21日15:43:45 评论 1048字阅读3分29秒

CentOS修改网卡名称

修改网络配置文件设备名称

[root@web02 ~]# vim /etc/sysconfig/network-scripts/ifcfg-ethX

重命名网卡配置文件的名称信息

[root@web02 ~]# cd /etc/sysconfig/network-scripts/

[root@web02 network-scripts]# mv ifcfg-eth33 ifcfg-eth0

修改网卡名称规则内核文件

[root@web02 /]# vim /etc/default/grub 
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_DISABLE_RECOVERY="true"
GRUB_CMDLINE_LINUX="crashkernel=auto net.ifnames=0 biosdevname=0 rhgb quiet"

使系统重新加载grub配置文件

[root@web02 /]# grub2-mkconfig -o /boot/grub2/grub.cfg

 

方法二:

/etc/udev/rules.d/70-persistent-net.rules 

[root@localhost ~]# vi /etc/udev/rules.d/70-persistent-net.rules 

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:5a:8c:72", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

然后进入网卡目录下进行修改名称,重启就完成了

 

 

继续阅读
历史上的今天
2月
21
weinxin
我的微信
这是我的微信扫一扫
  • 文本由 发表于 2020年2月21日15:43:45
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: