CentOS 7.x eth0

1:Test Environment

[root@linux-node1 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.5 (Maipo)
[root@linux-node1 ~]# uname -r
3.10.0-862.3.2.el7.x86_64

2:Modifying the NIC configuration file

[root@linux-node1 network-scripts]# mv ifcfg-enp0s25 ifcfg-eth0
[root@linux-node1 network-scripts]# cat ifcfg-eth0 
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
NAME=eTH0
DEVICE=eth0
ONBOOT=yes

3: Modifying the GRUB configuration file

[root@linux-node1 default]# cat /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="rhgb net.ifnames=0 biosdevname=0 quiet"
GRUB_DISABLE_RECOVERY="true"

grub2-mkconfig -o /boot/grub2/grub.cfg

4: reboot

猜你喜欢

转载自www.cnblogs.com/xilong-devops/p/9174860.html