Focus on cloud service provider activities
Notes on website operation and maintenance

Linux CentOS7 binding and adding new IP addresses differ from system to system

Generally, ECS comes with an independent IP address. Some ECS and independent servers come with multiple IP addresses, but most of those with multiple IP addresses will directly and automatically help us bind to the desired IP address in the configuration and directly resolve it. However, some servers can't be used without the configuration file binding settings after we add new IP addresses or purchase new IP addresses.

Lao Zuo is there“ How to add multiple IP bindings to Linux VPS "This problem was mentioned in the article, but at that time it was only based on CentOS6 and previous versions. Yesterday, Lao Zuo encountered that CentOS7 was different from the previous version. Here you can refer to those who need it.

 Linux CentOS7 binding and adding new IP addresses differ from system to system

Here, in the/etc/sysconfig/network scripts/file, only the ifcfg-em1 IP address configuration file can be seen, but not the ifcfg-eth0 mentioned earlier. The visible methods are different. So open this file to have a look.

Here, the server tested by Laozuo has three IP addresses configured on its own, and we can see the rules. Then we can add a new IP address as follows.

Pay attention to IPADDR, NETMASK and GATEWAY tags, and write them in order.

Finally, we need to restart the "systemctl restart network" network configuration to take effect. Then we parse the new IP address or ping test to see if it works.

Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Linux CentOS7 binding and adding new IP addresses differ from system to system


Scan the code to follow the official account

Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge