How to Configure a Floating IP in a VPS (Hetzner)

Posted on November 4, 2020 at 10:56 am

First create a Hetzner VPS and attach a floating IP to it.

I followed this guide to make sure the floating IP is persistent:

How to Make Floating IP Persistent (Hetzner)

In short, the procedure is like this:

1) Create a file named 60-my-floating-ip.cfg:

vi /etc/network/interfaces.d/60-my-floating-ip.cfg

2) Paste the following configuration for IPv4:

 auto eth0:1
 iface eth0:1 inet static
     address Your.Floating.IP
     netmask 32

3) Restart the network service:

service networking restart

4) Type “ifconfig” and it should output:

eth0:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet Your.Floating.IP  netmask 255.255.255.255  broadcast 0.0.0.0
        ether 94:00:00:6b:3e:1d  txqueuelen 1000  (Ethernet)

If you use more than one floating IP, eth0:1 will be increased (e.g eth0:2).

Receive updates via email

Other Posts

Updated Posts