Learn how to configure a block of public IP addresses for use with the vRack.
As well as private IP addressing, the vRack also allows you to route public IP traffic through your server’s vRack port using a public IP address block.
Requirements
- a public block of IP addresses in your account, with a minimum of four addresses
- your chosen private IP address range
- a vRack-compatible server
- a vRack service activated in your account
- access to the OVHcloud Control Panel
Instructions
/etc/network/interfaces
. The equivalent file on your server may be located somewhere else, depending on your operating system. The file content may also be different. If you encounter any difficulties, please refer to the official documentation for your distribution.Add the IP block to the vRack
This setup allows you to configure IPs of the same block on multiple servers, provided that these servers are all in the same vRack as the IP block. The IP block must have at least two usable IPs or more for this to be possible.
In your OVHcloud Control Panel, go to the Bare Metal Cloud
section and click on Network
. Next, open the vRack
menu.
Select your vRack from the list to display the list of eligible services. Click the IP block you wish to add to the vRack and click on the Add
button.
Configure a usable IP address
For vRack purposes, the first, penultimate, and last addresses in any given IP block are always reserved for the network address, network gateway, and network broadcast respectively. This means that the first useable address is the second address in the block, as shown in the example below:
To configure the first usable IP address, we need to edit the network configuration file /etc/network/interfaces
, as shown below. We will also need to use a subnet mask (255.255.255.XXX).
Your subnet mask may differ depending on the size of your block. When you purchase your IP block, you’ll receive an email telling you which subnet mask to use.
To configure the private networking between other servers in the vRack (optional):
Configure the first usable IP in the first IP block on the private interface:
Use the vRack routing rule for the private interface and configure the default gateway. This only needs to be done the first time:
Configure the first usable IP in the second IP block on the private interface:
Configure a second usable IP in the second IP block on the private interface:
Use the vRack routing rule for the private interface without reconfiguring the default gateway.
Create a new IP routing table
First, we need to download and install iproute2, which is a package that will enable us to manually configure IP routing on the server.
Establish an SSH connection to your server and run the following command from the command line. This will download and install iproute2.
Next, we need to create a new IP route for the vRack. We will be adding a new traffic rule by amending the file, as shown below:
Amend the network configuration file
/etc/network/interfaces
. The equivalent file on your server may be located somewhere else, depending on your operating system.Finally, we must amend the network configuration file to account for the new traffic rule and route the vRack traffic through the network gateway.
Now reboot your server to apply the changes.
Go further
For more information and tutorials, please see our other Server Administration support guides or explore the guides for other OVHcloud products and services.