Virtual machine fixed IP---Xiaohei's daily ultra-detailed tutorial

Foreword:

     After the virtual machine is restarted, the IP segment remains unchanged but the last number is sometimes random. If you need a fixed environment IP, you need to change the configuration file of the virtual machine.

Table of contents

 1. Change the configuration file

 2. Check the gateway of your virtual machine

 3. Configure network work

 4. Configure the advertised DNS service

5. Close the firewall and restart the network service


 1. Change the configuration file

 2. Check the gateway of your virtual machine

             Edit the virtual machine network editor and select the NAT settings of vm-net8

 3. Configure network work

 vi   /etc/sysconfig/network        加入NETWORKING=yes

 

 4. Configure the advertised DNS service

             vi  /etc/resolv.conf          nameserver   8.8.8.8

5. Close the firewall and restart the network service

systemctl stop firewalld   零时关闭防火墙

systemctl disable  firewalld  禁止开机启动

service network restart       重启网络服务

 

Guess you like

Origin blog.csdn.net/G_WEB_Xie/article/details/129280867