centos7修改網(wǎng)卡名字的方法

很多同學(xué)在裝完centos7,發(fā)現(xiàn)網(wǎng)卡接口名字變了, 不再是eth*或者em*了,而是ens*,但是這樣統(tǒng)一維護(hù)起來(lái)就比較麻煩,那么怎么修改呢,請(qǐng)看下文:
1. 拷貝網(wǎng)卡接口配置文件
- # cd /etc/sysconfig/network-scripts/
- # cp ifcfg-ens32 ifcfg-eth0
編輯ifcfg-eth0, 將文件中的ens32改為eth0
- # cd /etc/sysconfig/network-scripts/
- # cp ifcfg-ens32 ifcfg-eth0
編輯ifcfg-eth0, 將文件中的ens32改為eth0
2. 修改grub
- # 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
- # 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)卡名字的方法,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
相關(guān)文章
CentOS7系統(tǒng)進(jìn)行IP和主機(jī)名的網(wǎng)絡(luò)配置的過(guò)程圖解
有不少用戶不知道怎么對(duì)CentOS7進(jìn)行安裝和配置,主要是因?yàn)镃entOS7的主機(jī)名和IP等相關(guān)網(wǎng)絡(luò)配置跟之前的版本有些不同,下面針對(duì)CentOS7系統(tǒng)怎么進(jìn)行IP和主機(jī)名網(wǎng)絡(luò)配置進(jìn)行2015-05-27centos7下systemd實(shí)現(xiàn)tomcat多實(shí)例配置方法
這篇文章主要介紹了centos7下systemd實(shí)現(xiàn)tomcat多實(shí)例配置方法,需要的朋友可以參考下2015-11-02CentOS 7.1 中文正式版怎么樣?CentOS 7.1功能介紹及下載安裝
CentOS 7.1 中文正式版怎么樣?CentOS 是基于 Red Hat Enterprise Linux的源代碼再編譯出來(lái)的免費(fèi)版,很受中小型公司的歡迎,下面我們一起來(lái)看看CentOS 7.1 中文正式版介紹2015-09-28centos 7與windows系統(tǒng)引導(dǎo)恢怎么恢復(fù)?
centos 7與windows系統(tǒng)引導(dǎo)恢怎么恢復(fù)?安裝centos 7后發(fā)現(xiàn)已經(jīng)安裝的windows 8系統(tǒng)和xp系統(tǒng)的啟動(dòng)項(xiàng)消失了,而且安裝時(shí)centos的引導(dǎo)直接安裝在主引導(dǎo)記錄中,根本沒(méi)有安裝2015-01-21- 本文給大家分享兩種centos7修改主機(jī)名方法,非常不錯(cuò),具有參考借鑒價(jià)值,感興趣的朋友一起看看吧2016-10-20