Use VirtualBox to install many virtual machines. The default mode is DHCP. However, as more and more virtual machines are installed, this mode is not convenient, so you need to set the IP address of the machine to static IP. IPADDR IP address NETMASK Subnet mask NETWORK gateway address Generally, if you want to change the host address to a static address or change the host name, you need to modify the following files: /etc/sysconfig/network Configure the host name and network configuration. /etc/sysconfig/network-scripts/ifcfg-eth0 Configure the DNS for a specific nic /etc/hosts Set the domain name resolution address. Generally, you only need to modify the configuration file of the NIC. For example, my configuration file is as follows: DEVICE=eth0 BOOTPROTO=static TYPE=Ethernet NAME=”System etho0″ BROADCAST=192.168.56.255 HWADDR=08:00:27:24:F8:9B IPADDR=192.168.56.101 IPV6INIT=yes IPV6_AUTOCONF=yes NETMASK=255.255.255.0 NETWORK=192.168.56.1 ONBOOT=yes Another way to set a static IP address is through the ifconfig command. Usually, we use it to view some information about the current network card, at the same time, it can also be used to set some network card information. Modify the command as follows: Ifconfig eth0 192.168.56.102 After this command is executed, you can only change the IP address of the nic in the current session. Still # Advanced Micro Devices [AMD] 79C970 [PCnet32 LANCE] DEVICE=eth0 ONBOOT=yes BOOTPROTO= DHCP HWADDR= 08:00:27:43:73:2F That is, after the server is restarted, the IP address is still obtained in the configuration file. Therefore, if you need to change the IP address to a static IP address, the best way to do so is to modify the configuration file. Set the IP address of CentOS manually