Purchasing and Using IPv4 & IPv6 Address Ranges
This guide explains how to purchase and configure a complete IPv4 or IPv6 address range for use with your Xenyth Cloud VM.
Step 1: Purchase Your VM and IP Range
First, you need to acquire a Virtual Machine (VM) and the desired IP address range from the Xenyth Cloud portal.
- Navigate to the "Order" section in the Xenyth Cloud dashboard.
- Select and provision the VM that meets your performance requirements.
- Also purchase the IPv4 or IPv6 range you need.
Note: We can support you via BGP on your own ASN, or via Static Route on Our ASN (AS62513). Just let us know in the ticket!
Step 2: Link the IP Range to Your VM
Once you have both the VM and the IP range, you must request to have them linked.
- Open a new support ticket from your Xenyth Cloud dashboard.
- In the ticket, clearly state that you would like to have your recently purchased IP range routed to your VM. Include the identifiers for both the VM and the IP range. Make sure to include if you want BGP with your Own ASN, or if you need us to route it for you.
- Our support team will handle the backend network configuration and will notify you once the range is connected to your VM.
Step 3: Configure The IP Range on Your VM
After the support team confirms that the IP range is connected, you need to configure it on your VM's operating system.
Configure the Range with Netplan
Xenyth Cloud VMs use netplan for network configuration by default. You will need to create a new configuration file to define your IP range.
Create a new file, for example, /etc/netplan/60-loopback.yaml, and add the following configuration.
network:
version: 2
renderer: networkd
ethernets:
lo:
addresses:
- 192.0.2.1/24 # Your IPv4 range here
- "2001:db8::1/48" # Your IPv6 range here
routes:
- to: 192.0.2.0/24 # Your IPv4 range here
type: local
- to: 2001:db8::/48 # Your IPv6 range here
type: local
Replace the example IP ranges with your actual purchased ranges. You can add multiple IPv4 and IPv6 ranges.
After creating the file, apply the new network configuration:
sudo netplan apply
Enable Non-Local Binding
Your server needs to be able to bind to IP addresses that are not physically assigned to a network interface. This is crucial for services that need to use addresses from your routed range.
To enable this, edit /etc/sysctl.conf and add the following lines for both IPv4 and IPv6:
net.ipv4.ip_nonlocal_bind = 1
net.ipv6.ip_nonlocal_bind = 1
Apply the change immediately without rebooting:
sudo sysctl -p
Verify Local Routes and Addresses
Finally, ensure that your system recognizes the new range and has the correct local routes.
Check the IP addresses:
ip addr show
You should see the IP range assigned to the loopback interface (lo).
Check the routing table:
ip route show
You should see a route for your IP range pointing to the loopback interface.
Your services can now bind to any IP address within your purchased range.