centos 7 網卡名稱更改

來源:互聯網
上載者:User

標籤:centos7網卡名稱更改

Centos7安裝完成後網卡名稱預設為enoXXX,非常熟悉的ethX沒有了,總是感覺怪怪的。如果迷你安裝找不到ifconfig命令,請安裝net-tools軟體包.更改步驟如下:


  1. [[email protected] ~]#vi /etc/sysconfig/network-scripts/ifcfg-enoXXX

    HWADDR=00:0C:29:AF:BF:18
    TYPE=Ethernet
    BOOTPROTO=dhcp
    DEFROUTE=yes
    PEERDNS=yes
    PEERROUTES=yes
    NAME=enoXXX                   //此處將enoXXX更改為ethX
    UUID=17cdd976-0b81-4286-80cf-185ec95f5ae8
    ONBOOT=no                    //此處將no更改為yes      

  2.  [[email protected] ~]#cd /etc/sysconfig/network-scripts

     [[email protected] ~]#mv ifcfg-enoXXX ifcfg-eth0

  3. [[email protected] ~]# vi /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_CMDLINE_LINUX="vconsole.keymap=us crashkernel=auto  vconsole.font=latarcyrheb-sun16 net.ifnames=0 biosdevname=0 rhgb quiet"
    GRUB_DISABLE_RECOVERY="true"   //委任標記為紅色的兩個參數

  4. [[email protected] ~]# grub2-mkconfig -o /boot/grub2/grub     // 執行此命令,重新載入下grub配置
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img
    Warning: Please don‘t use old title `CentOS Linux, with Linux 3.10.0-123.el7.x86_64‘ for GRUB_DEFAULT, use `Advanced options for CentOS Linux>CentOS Linux, with Linux 3.10.0-123.el7.x86_64‘ (for versions before 2.00) or `gnulinux-advanced-66b96693-051c-4021-85ef-5f7ef0f970e2>gnulinux-3.10.0-123.el7.x86_64-advanced-66b96693-051c-4021-85ef-5f7ef0f970e2‘ (for 2.00 or later)
    Found linux image: /boot/vmlinuz-0-rescue-b6f54d97b52944738996d2d9aeb3d59b
    Found initrd image: /boot/initramfs-0-rescue-b6f54d97b52944738996d2d9aeb3d59b.img
    done

  5. [[email protected] ~]# reboot

    重啟作業系統,Centos7的網卡名稱就更改完成了。


centos 7 網卡名稱更改

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.