One of the features that are provided by different hosting providers when you opt for a Linux server is adding additional IP addresses. This procedure isn’t that hard if you have a good guide for it, so that is what we want to provide you with today. But first, let’s see why you might actually need additional IP addresses.
Why do you need additional IP addresses?
A dedicated server or a VPS allows you to have your dedicated IP address, which is a great advantage in contrast to shared hosting. It enhances the security of your server for transmitting data, which is especially beneficial for e-commerce websites, and it also improves the ranking of your website on search engines. However, many hosting providers offer the option of increasing the number of IPs on your server.
The reasons to have multiple IPs are the following:
- Mailing. There are cases when a business needs to send huge amounts of emails in a short period of time. In this case, additional IPs may be useful to increase the available amount of emails. Also, if you need to hold the reputation of each mail stream at a certain level, then it’s advantageous to have a dedicated IP address for each.
- If there is a need to host several SSL sites at the same time.
- If you used to have multiple services that were hosted on different hosts and now you have migrated to one server, but want that the same addresses remain.
- If you need to run a service several times simultaneously.
- If any of the hosts is out of operation at the moment and there is a need to compensate for it by adding its IP to another host.
- If, you have several IP networks that you want to host on the same server and you want to improve the performance by separating the traffic.
- You can also use different public addresses to bypass firewalls.
- You can enhance the security of your website by making it less apparent how it works. For example, if you want to run apache on one of the IP addresses and permit SSH only on another this way a potential hacker may fail at finding the SSH.
Configuring additional IPs
The first thing you need is the system files that are to be configured. However, they vary across different Linux distributions, so we’ll cover them in specific sections.
Then, you’ll have to obtain SSH access. To do it, you’ll need the root password (you’ll see it in the Control Panel) as well as an SSH client. As for the latter, it’s a good idea to choose Putty. You’ll find it at the following link: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html.
Once you have it, open the terminal window and start the configuration.
Configuring an additional IP for Debian and Ubuntu
- Open /etc/network/interfaces.
- Add this: auto eth0:1 line below this one: auto eth0.
- You’ll see the line corresponding to the description of the first interface – iface eth0. Below this one, add the second interface description:
iface eth0:1 inet static
address 207.210.118.58
netmask 255.255.255.224
broadcast 207.210.118.63
network 207.210.118.32
gateway 207.210.118.33
Check whether all data are inserted correctly.
Configuring an additional IP on CentOS
When configuring CentOS, your actions will be a bit different. Rather than configuring existing files, you’ll have to create a new interface file.
1. First, go to the following path: /etc/sysconfig/network-scripts.
2. Select which interface you are going to apply to add IP addresses. An often used option is eth0, in particular in the case of public IP addresses. Insert: ifconfig
3. To add an IP, type ifcfg-eth0 and then add ifcfg-eth0:<0 to it. It should look like this:
cp ifcfg-eth0 ifcfg-eth0:0
cp ifcfg-eth0 ifcfg-eth0:1
cp ifcfg-eth0 ifcfg-eth0:2
cp ifcfg-eth0 ifcfg-eth0:3
cp ifcfg-eth0 ifcfg-eth0:4
4. In each command, change the fields DEVICE, IPADDR, and NETMASK, filling them with the information corresponding to each new IP.
5. Reload the service of the network:
/etc/init/d/network restart
Check, if everything went correctly and if the changes have been successfully applied.
6. Verify the IP address of your server with this command:
ipconfig
If you want to make sure that everything runs properly, get SSH access to the server with one of the new IPs.
Conclusion
Adding additional IP may be used by system administrators to perform various “tricks” with the server, enhancing its performance in certain cases or enabling operations unavailable with one IP to make it more efficient. If you are looking for a VPS hosting that will allow you to have additional IP, check out vps hosting debian offer by HostZealot – they will provide you with up to 5 additional IP addresses depending on the plan. Thank you for your attention! Take care!
Learn more:
https://www.greenarrowemail.com/blog/multiple-ip-addresses-many
https://www.quora.com/What-is-the-point-of-having-two-IP-addresses-on-one-computer
https://serverfault.com/questions/312221/can-a-single-network-card-have-2-ip-addresses