centos7系統如何修改網卡的名字?很多同學在裝完centos7,發現網卡接口名字變了, 不再是eth*或者em*了,而是ens*,但是這樣統一維護起來就比較麻煩,那么怎么修改呢,請看下文:
1. 拷貝網卡接口配置文件
Ruby Code復制內容到剪貼板
-
-
編輯ifcfg-eth0, 將文件中的ens32改為eth0
Ruby Code復制內容到剪貼板
-
-
編輯ifcfg-eth0, 將文件中的ens32改為eth0
2. 修改grub
Ruby Code復制內容到剪貼板
-
- 修改GRUB_CMDLINE_LINUX 行內容,在后面加上 net.ifnames=0 biosdevname=0,如下:
- GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet net.ifnames=0 biosdevname=0"
-
- 修改GRUB_CMDLINE_LINUX 行內容,在后面加上 net.ifnames=0 biosdevname=0,如下:
- GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet net.ifnames=0 biosdevname=0"
3. 重新生成grub.cfg文件
Python
Ruby Code復制內容到剪貼板
-
- 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-cbe15acd3ca347f4a373c8f4adaf2619
- Found initrd image: /boot/initramfs-0-rescue-cbe15acd3ca347f4a373c8f4adaf2619.img
- done
-
- 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-cbe15acd3ca347f4a373c8f4adaf2619
- Found initrd image: /boot/initramfs-0-rescue-cbe15acd3ca347f4a373c8f4adaf2619.img
- done
4. reboot 重啟
以上centos7系統如何修改網卡的名字?就是小編為大家收集整理的全部內容了,希望對大家有所幫助。如果您喜歡這篇文章,可以收藏或分享給您的小伙伴們吧!歡迎持續關注我們的后續更新。 |