You have ordered new IP addresses, then chose the server at the same location, yet you still cannot ping it? That is because the IP is not configured on your server's network interface yet. There are various ways to do that, some are better than others, thus we will show you a simplest approach.
In this example we will use subnet of
22.214.171.124/32 which is assigned to a Kronos Cloud TestServer2 server at Frankfurt using CentOS 7 v2.0.4.
Note: do not forget to stop and then start the Kronos Cloud server after assigning the additional IPs to the server (thank you, our clients, for pointing this out!).
Firstly, to configure the IP, you have to connect to the server, for that you will need the connection details: main IP, user and password or SSH key, depending on the way your server is configured. To get this info, go to Terminal > Kronos Cloud, then select the server.
To connect to the server we will use PuTTY.
Copy the password before actually logging to the server, then type root for user, for password just press the right mouse button and press enter (the password will be pasted automatically).
Let's check the current configurations of network interfaces, to do that type
ip a .
Furthermore, we need the name of our network interface. In the picture above we can see that it is eth0 and that our main IP is already configured. Now we can add our secondary IP to the interface as alias. We can check that secondary IP is not configured or used by pinging it.
To add the IP as an interface alias, we will use this command:
ip addr add 126.96.36.199/32 dev eth0:0
After this, we can check whether it is pinging:
We can also inspect the network interface on the server using
ip a command again:
However, there is a downside to this approach - after restart of this server, this configuration is dropped.
On the other hand, we can easily overcome this problem using rc.local script, which is traditionally executed after all the normal system services have started. To edit it, you can use any available editor, in this example, we will use NANO editor. If you do not have it, you can easily install nano with command
sudo apt-get install nano for Debian and Ubuntu systems, or use
yum install nano for CentOS systems.
Now, go to /etc using command
cd /etc , then type
nano rc.local . Paste the commands you want to keep after restart to the file (remember, you can paste in PuTTY by pressing right mouse button) and save it using shortcut CTRL+X. After that, make sure to remember to type
chmod +x /etc/rc.d/rc.local and
chmod +x /etc/rc.local so that your script is executable.
The next step is not necessary, but you can check whether your configurations are saved after restart. To do that, just type
sudo reboot , reconnect to the server, then again use
ip a to inspect the configuration.
If your configuration is not saved, most frequently users omit the step of making the script executable, thus make sure not to forget that.
Another problem you might face using this approach is that there is no rc.local script - some new distributions have it disabled. You can find information about enabling it here.