In this article the old left not to discuss the Cohoha data center (with more Japanese and Singapore) performance and speed stability, because there are many users in the use of the old left also opened Singapore room in use, and stability is still acceptable. The default Conoha VPS host only a separate IPV4 address, if some of our projects may need to add multiple IP address use, such as our VPS to add multiple independent IP, so different sites to assign different independent IP, you can save a certain cost.
After appending the independent IP, does not automatically match to the system, we need to make the configuration file the setting. Because in the past some time to see a lot of netizens have mentioned that there is such a demand, so I will open a separate machine directly, and then add independent IP for testing configuration. Here needs to mention is that the VPS host default space is in accordance with the hourly deduction fee, if the IP address separately added, 30 days is not deleted.
First, append multiple independent IP address
Default we open VPS host only assign a IPV4 address to us, if we need (if not necessary, do not toss), then according to the following scheme to add a new independent IP address.
1, additional IP address
In the background panel, network-Append IP address.
2. Select room and number
Then we choose according to the room area of the demand and the number of IP addresses we need.
3, determine the payment cycle
We can see the requirements, additional independent IP address can not be deleted within 30 days, from the cost of the new Japanese independent IP address, January is 350 yen, equivalent to 18 yuan or so (the cost of sharing the article is quite high, for the authenticity of the article, but also really need to open an independent IP out).
4, configuration to the VPS host
We need to suspend the current VPS operation and then proceed to configure the VPS. After the completion of the installation of the VPS host reboot, restart the new IP is not available, we need to configure the file can be.
Second, the new IP address configuration file
This step is still more important, although there are many similar tutorials on the web, but not as accurate as the official documentation provided, which is not based on the official documentation tutorials previously provided by P.
1, Login VPS and determine ETH address
The code is as follows |
Copy Code |
Ifconfig-a |
And then view
The code is as follows |
Copy Code |
eth1 Link encap:ethernet hwaddr fa:16:xx:xx:xx:xx |
The red part needs to be recorded and will need to be used below.
2, set eth1 profile information
The code is as follows |
Copy Code |
Vi/etc/sysconfig/network-scripts/ifcfg-eth1 |
Add the following script
The code is as follows |
Copy Code |
Device= "Eth1" Hwaddr= "Fa:16:xx:xx:xx:xx" #上面获得的MAC地址 bootproto= "Static" Nm_controlled= "No" onboot= "Yes" Type= "Ethernet" Ipaddr= "XX. Xx. Xx. XX "#我们的新追加IP地址 netmask= "255.255.254.0" |
Save the file after you add it.
3. Set Routing strategy
The code is as follows |
Copy Code |
Vi/etc/iproute2/rt_tables |
Add a row of rules
The code is as follows |
Copy Code |
201 GW1 |
Added in.
The code is as follows |
Copy Code |
Vi/etc/sysconfig/network-scripts/route-eth1 |
Append IP Gateway setting policy.
The code is as follows |
Copy Code |
Default via Xxx.xxx. xxx.1 Table Gw1 |
Current IP address gateway settings.
The code is as follows |
Copy Code |
Vi/etc/sysconfig/network-scripts/rule-eth1 |
Append static routing Address setting.
The code is as follows |
Copy Code |
From 157.xxx.xxx. XX1 Table Gw1 From 157.xxx.xxx. XX2 Table Gw1 |
Enter the IP address, if there are multiple, one line.
Third, restart effective
The code is as follows |
Copy Code |
Service Network restart |
Restart the network environment, if the configuration is not a problem, our new IP address is in effect, can be applied to the project