liunx configures static IP and changes ens33 network card to eth0
[Copy link]
【】Modify the network card and change ens33 to eth0
1. Edit the gurb configuration file
vim /etc/sysconfig/grub
Modify the GRUB_CMDLINE_LINUX variable and add two parameters
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap net.ifnames=0 biosdevname=0 rhgb quiet"
2. Regenerate the grub configuration file
grub2-mkconfig -o /boot/grub2/grub.cfg
and restart the Linux operating system. You can see through ip addr that the network card name has changed to eth0.
3. Modify the network card configuration file
mv /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-eth0
# Modify the ifcfg-eth0 file as follows (other contents remain unchanged)
NAME=eth0
DEVICE=eth0
[root@localhost ~]# systemctl restart network.service # Restart network serviceservice network restart
【】Configure static ip using NET network connection method
1.vi /etc/sysconfig/network-scripts/ifcfg-eth0
2.vim /etc/udev/rules.d/70-persistent-ipoib.rules
3. Modify the host name
vim /etc/sysconfig/network
modify the host name
NETWORKING=yes
HOSTNAME=[your host name]
|