CentOS7修改网卡名称为eth0

  • 原创
  • Madman
  • /
  • /
  • 0
  • 9479 次阅读

CentOS7修改网卡名称为eth0-min.png

Synopsis: CentOS6之前基于传统的网卡命名方式如eth0、eth1等,缺点是多接口时可能重启系统后ethX对应的网卡接口会变动。CentOS7之后提供了不同的命名规则,默认是基于固件、拓扑、位置信息来分配,这样做的优点是命名是全自动的、可预知的,缺点是比eth0、wlan0更难读,比如enp131s0f0

1. 修改grub

编辑/etc/default/grub文件:

# vi /etc/default/grub
在GRUB_CMDLINE_LINUX参数中增加net.ifnames=0,即:
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap net.ifnames=0 rhgb quiet"

重新生成GRUB配置文件,并更新内核参数:

# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-327.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-d3ea6ff7d55d4a409459174c8477366f
Found initrd image: /boot/initramfs-0-rescue-d3ea6ff7d55d4a409459174c8477366f.img
done

2. 创建udev网络命名规则文件

2.1 获取mac地址

(1) 查看本机所有网络设备的MAC地址

1. ifconfig命令输出信息中的 ether 00:0c:29:02:2f:d3
# ifconfig

2
                                
                            
分类: Linux
标签: CentOS eth0 grub network
  • slinzhang007
  • Educate Yourself and Obtain a Refund cv505813.tw1.ru fg
  • Share a post earn dollars cv505813.tw1.ru nK
  • Your individually tailored cash bonus cv505813.tw1.ru ke
  • You've laid claim to deserted finances cv505813.tw1.ru RX
  • Today is Your Day for a Cash Bonus fdjhgkhjkg.temp.swtest.ru G1
  • Claim your located cash prize without delay cx180165.tw1.ru Df
  • Receive a brand new cash present fdjhgkhjkg.temp.swtest.ru 6N
  • Access your special cash offer now cx180165.tw1.ru lY
  • Open this for a bonus energy shockwave cv505813.tw1.ru D1
  • Come and Get Your Money Incentive cv505813.tw1.ru 23
  • Reveal a cash prize by scratching here cv505813.tw1.ru 30
  • Profit from Your Very Presence cv505813.tw1.ru x5
  • A 12 hour only exclusive for you fdjhgkhjkg.temp.swtest.ru JE
  • Reply and get an instant reward cv505813.tw1.ru sB
  • Earn a Bonus Upon Registration cx180165.tw1.ru 0i
  • Be Compensated for Sundry Duties fdjhgkhjkg.temp.swtest.ru g4
  • The bonus of the season is now available cv505813.tw1.ru 5b
  • Receive a cash reward for commenting cv505813.tw1.ru vs
  • A sleeping financial asset has been roused cx180165.tw1.ru 6S
  • Get an On the Spot Cash Win cx180165.tw1.ru 4H
  • Instantaneous money winning opportunities cv505813.tw1.ru EA
  • Don't lose your money it's expiring soon cv505813.tw1.ru nO
  • Your update comes with a cash bonus fdjhgkhjkg.temp.swtest.ru 7P
未经允许不得转载: LIFE & SHARE - 王颜公子 » CentOS7修改网卡名称为eth0

分享

作者

作者头像

Madman

如需 Linux / Python 相关问题付费解答,请按如下方式联系我

0 条评论

暂时还没有评论.

专题系列