Last update at :2024-06-16,Edit by888u
Snail helped a netizen purchase a Limestone Networks server last year (purchase tutorial and experience). This friend is still using it after such a long time. Today, he found that after adding multiple IPs in the background, he could not Automatic configuration parsing should require setting up a configuration file. Because most of the VPS and servers we choose do not automatically match and configure other IP addresses after adding IP.
I just looked through the blog post and saw that Snail had also shared an article "How to add multiple IPV4 IP addresses to Linux CentOS6/Ubuntu 12.04", so this practical article can just detect the current CentOS6 user. Environment adds multiple IP address configuration methods.
First, edit the ifcfg-eth0 file
vi /etc/sysconfig/network-scripts/ifcfg-eth0
If we are proficient in using the vi editor, we can edit it directly. If we are not familiar with it, we can just download it and edit it locally.
1. Confirm that the parameters behind BOOTPROTO are static
2. Confirm that there are NETMASK, IPADDR, and GATEWAY configuration options in the parameters. If we do not have them, we need to complete them. Here I see that the current configuration file exists. The IP address here is our original IP address information, do not change it to a new one.
3. After saving and exiting, execute ifup eth0 update.
Second, create a new IP configuration file
1. Configuration file
vi /etc/sysconfig/network-scripts/ifcfg-eth0:1
Create a new configuration file.
DEVICE=eth0:1BOOTPROTO=staticIPADDR=New IP address ONBOOT=yes
According to the above script, modify it to our new IP address, paste it in, save and exit.
2. Effective execution
ifup eth0:1
The new IP address can take effect here, and so on, if there are other IPs, the same operation will be done.
Recommended site search: private server website space, Hong Kong high-defense server China IP segment, telecom hosting, Chinese domain name registration query, free virtual host, 6 yuan Alibaba Cloud shared virtual host, wordpress space, network server rental, Hong Kong vps host Rent,
发表评论