標籤:centos7網卡名稱更改
Centos7安裝完成後網卡名稱預設為enoXXX,非常熟悉的ethX沒有了,總是感覺怪怪的。如果迷你安裝找不到ifconfig命令,請安裝net-tools軟體包.更改步驟如下:
[[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
[[email protected] ~]#cd /etc/sysconfig/network-scripts
[[email protected] ~]#mv ifcfg-enoXXX ifcfg-eth0
[[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" //委任標記為紅色的兩個參數
[[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
[[email protected] ~]# reboot
重啟作業系統,Centos7的網卡名稱就更改完成了。
centos 7 網卡名稱更改