It is particularly worth mentioning that there are many things worth learning to set static IP addresses for Centos and modify the Centos configuration file. Here we mainly introduce how to set static IP addresses for Centos, including the Centos configuration file, centOS system TCP/IP network configuration, system boot and startup, daemon management, system monitoring and backup and recovery. Many virtual machines are installed in VirtualBox. DHCP is used by default. However, as more virtual machines are installed, this method is inconvenient, therefore, you need to set the IP addresses of all machines in Centos to the static IP address. Explanation: IPADDRIP address NETMASK subnet mask NETWORK gateway address is usually, to change the host address to a static address or host name, you need to modify the following files: /etc/sysconfig/network Centos set host name and network configuration/etc/sysconfig/network-scripts/ifcfg-eth0 set for specific NIC/etc/resolv. conf sets DNS/etc/hosts to set the specified domain name resolution address. Generally, you only need to modify the NIC's Centos configuration file. For example, my Centos configuration file is as follows: DEVICE = eth0BOOTPROTO = staticTYPE = EthernetNAME = "System etho0 "BROADCAST = 08: 00: 27: 24: F8: 9 BIPADDR = 192.168.56.1014256init = yesIPV6_AUTOCONF = yesNETMASK = 255.255.255.0NETWORK = 192.168.56.1ONBOOT = yes after the Centos IP address is set, restart the NIC: service network restart. There is another way to set the static IP address in Centos through the ifconfig command. We usually use it to view some information about the current Nic, and it can also be used to set some Nic information. The modified command is as follows: ifconfig eth0 192.168.56.102 however, after this command is executed, only the address of the NIC can be modified in the current session, let's take a look at the ifcfg-eth0 configuration file, still # Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] DEVICE = eth0ONBOOT = yesBOOTPROTO = dhcpHWADDR = 08: 00: 27: 43: 73: 2f after restarting the server, the IP address is still obtained in the Centos configuration file. Therefore, if you need to change the IP address to a static IP address, the best way is to modify the Centos configuration file.