After centos7 is installed, the system usually has a name similar to ensXXXXX, and if we want to use the name eth0, we need to modify it. The modification method is also very simple. Here is a brief list of steps.
cd /etc/sysconfig/network-scripts
cat ifcfg-ens1770
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=172.20.1.8
NETMASK=255.255.254.0
GATEWAY=172.20.1.1
DNS1=114.114.114.114
DNS2=8.8.8.8
mv ifcfg-ens1770 ifcfg-eth0
vim /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="crashkernel=auto rd.lvm.lv=centos/root "net.ifnames=0 biosdevname=0" rd.lvm.lv=centos/swap rhgb quiet" #Modify the content of this paragraph and add"net.ifnames=0 biosdevname=0"
GRUB_DISABLE_RECOVERY="true"
grub2-mkconfig -o /boot/grub2/grub.cfg
init 6
Recommended Posts