centos7修改網(wǎng)卡名字的方法
發(fā)布時間:2016-10-08 14:54:12 作者:佚名
我要評論

很多同學在裝完centos7,發(fā)現(xiàn)網(wǎng)卡接口名字變了, 不再是eth*或者em*了,而是ens*,但是很不利于維護,下面小編給大家介紹下centos7修改網(wǎng)卡名字的方法,非常不錯,一起看看吧
很多同學在裝完centos7,發(fā)現(xiàn)網(wǎng)卡接口名字變了, 不再是eth*或者em*了,而是ens*,但是這樣統(tǒng)一維護起來就比較麻煩,那么怎么修改呢,請看下文:
1. 拷貝網(wǎng)卡接口配置文件
Ruby Code復制內(nèi)容到剪貼板
- # cd /etc/sysconfig/network-scripts/
- # cp ifcfg-ens32 ifcfg-eth0
編輯ifcfg-eth0, 將文件中的ens32改為eth0
Ruby Code復制內(nèi)容到剪貼板
- # cd /etc/sysconfig/network-scripts/
- # cp ifcfg-ens32 ifcfg-eth0
編輯ifcfg-eth0, 將文件中的ens32改為eth0
2. 修改grub
Ruby Code復制內(nèi)容到剪貼板
- # vim /etc/default/grub
- 修改GRUB_CMDLINE_LINUX 行內(nèi)容,在后面加上 net.ifnames=0 biosdevname=0,如下:
- GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet net.ifnames=0 biosdevname=0"
- # vim /etc/default/grub
- 修改GRUB_CMDLINE_LINUX 行內(nèi)容,在后面加上 net.ifnames=0 biosdevname=0,如下:
- GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet net.ifnames=0 biosdevname=0"
3. 重新生成grub.cfg文件
Python
Ruby Code復制內(nèi)容到剪貼板
- # 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-cbe15acd3ca347f4a373c8f4adaf2619
- Found initrd image: /boot/initramfs-0-rescue-cbe15acd3ca347f4a373c8f4adaf2619.img
- done
- # 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-cbe15acd3ca347f4a373c8f4adaf2619
- Found initrd image: /boot/initramfs-0-rescue-cbe15acd3ca347f4a373c8f4adaf2619.img
- done
4. reboot 重啟
以上所述是小編給大家介紹的centos7修改網(wǎng)卡名字的方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
相關文章
CentOS7系統(tǒng)進行IP和主機名的網(wǎng)絡配置的過程圖解
有不少用戶不知道怎么對CentOS7進行安裝和配置,主要是因為CentOS7的主機名和IP等相關網(wǎng)絡配置跟之前的版本有些不同,下面針對CentOS7系統(tǒng)怎么進行IP和主機名網(wǎng)絡配置進行2015-05-27centos7下systemd實現(xiàn)tomcat多實例配置方法
這篇文章主要介紹了centos7下systemd實現(xiàn)tomcat多實例配置方法,需要的朋友可以參考下2015-11-02CentOS 7.1 中文正式版怎么樣?CentOS 7.1功能介紹及下載安裝
CentOS 7.1 中文正式版怎么樣?CentOS 是基于 Red Hat Enterprise Linux的源代碼再編譯出來的免費版,很受中小型公司的歡迎,下面我們一起來看看CentOS 7.1 中文正式版介紹2015-09-28centos 7與windows系統(tǒng)引導恢怎么恢復?
centos 7與windows系統(tǒng)引導恢怎么恢復?安裝centos 7后發(fā)現(xiàn)已經(jīng)安裝的windows 8系統(tǒng)和xp系統(tǒng)的啟動項消失了,而且安裝時centos的引導直接安裝在主引導記錄中,根本沒有安裝2015-01-21- 本文給大家分享兩種centos7修改主機名方法,非常不錯,具有參考借鑒價值,感興趣的朋友一起看看吧2016-10-20