Set static IP addresses in Centos and modify the Centos configuration file.

Source: Internet
Author: User
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 TCP/IP network configuration, system boot and startup, Daemon... 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.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.