Linux virtual machine ip always changes

Enter the directory: cd /etc/sysconfig/network-scripts/

Edit the file: vi ifcfg-eth0, change the first red box to static, and the second red box to the static ip you want to set

Reboot: reboot

Then check whether the ip has been set successfully: ifconfig press Enter

Guess you like

Origin blog.csdn.net/m0_54853503/article/details/123981239