Hetzner is a server provider based in Germany, offering cost-effective and high-performance server solutions. It is widely preferred throughout Europe, especially with its Hetzner Cloud Dedicated service. In this article, we will explain step by step how to assign IP addresses on Hetzner servers.
Also, keep in mind that similar IP management requirements may exist on Turkey Location VPS servers.
Requirements Before Assigning an IP Address in Hetzner
-
Your server must be active
-
The IP address must be added to the server in the Hetzner Robot or Cloud panel
-
You must have root (administrator) privileges on your server
-
Your distribution system (Ubuntu, Debian, AlmaLinux, etc.) must be prepared according to the IP configuration
Assigning Additional IP from Hetzner Robot Panel
-
Log in to your Hetzner Robot account.
-
Select your server from the "Server" section.
-
Click on the "IPs" tab.
-
Request a new IP by clicking "Order Additional IP Addresses".
-
Once the IP address is approved, you can define it on the server with the following steps.
Assigning IP Address to Server (Ubuntu/Debian)
-
Connect to your server via SSH.
-
Run the following command to see your IP addresses:
ip addr show
-
Open the /etc/network/interfaces file:
sudo nano /etc/network/interfaces
-
Add the new IP under the existing configuration. Example:
auto eth0:0
iface eth0:0 inet static
address 192.168.1.100
netmask 255.255.255.255
gateway 192.168.1.1
Note: In Hetzner, the netmask is usually 255.255.255.255
.
-
Restart the network:
sudo systemctl restart networking
Assigning IP Address to Server (CentOS / AlmaLinux)
-
Connect to your server via SSH.
-
Go to your network settings folder:
cd /etc/sysconfig/network-scripts/
-
Copy the existing network file:
cp ifcfg-eth0 ifcfg-eth0:0
-
Edit the new file:
nano ifcfg-eth0:0
-
Set the content as follows:
DEVICE=eth0:0
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.1.100
NETMASK=255.255.255.255
GATEWAY=192.168.1.1
-
Restart the network service:
systemctl restart network
To Make IP Settings Permanent
To prevent the settings from being lost after your server is rebooted, you must have permanently configured the above files.
Things to Consider When Setting Up IP on Hetzner Servers
-
The additional IP address is not assigned to another MAC address. The default NIC is used.
-
To avoid "ARP" problems on the server, proxy_arp or similar network management settings should be checked.
-
If firewall settings are to be made on an IP basis, new IPs should be added.
Frequently Asked Questions (FAQ)
How long does it take for an IP address to become active in Hetzner?
The additional IP you ordered usually becomes active within 5-15 minutes.
Why is the IP address not pinging?
If the necessary network settings are not made on the server or if there is a firewall block, it may not be possible to ping.
Can I also assign an IPv6 address?
Yes, you can request IPv6 blocks through the Hetzner Cloud panel.
Can I add more than one IP address?
Yes. You can use multiple IPs by allocating IP blocks such as /29, /28.
Are additional IPs mandatory when setting up a Proxy or VPN server?
Yes. It may be necessary to define a separate IP address for each user for Proxy/VPN.
In this article, we have explained in detail how to assign IP addresses on Hetzner servers. If you want to get more information or need a server, you can check our Turkey Location VPS or Hetzner Cloud options.