If you are using more than one floating IP, then the number on the interface (eth0:1) will be increased (example eth0:2).
Create the configuration file and open an editor
touch /etc/network/interfaces.d/60-my-floating-ip.cfg
nano /etc/network/interfaces.d/60-my-floating-ip.cfgIPv4:
auto eth0:1
iface eth0:1 inet static
address your.Float.ing.IP
netmask 32IPv6:
auto eth0:1
iface eth0:1 inet6 static
address one IPv6 address of the subnet, e.g. 2a01:4f9:0:2a1::2
netmask 64Now you should restart your network. Caution: This will reset your network connection
sudo service networking restartCreate the configuration file and open an editor
touch /etc/netplan/60-floating-ip.yaml
nano /etc/netplan/60-floating-ip.yamlIPv4:
network:
version: 2
ethernets:
eth0:
addresses:
- your.float.ing.ip/32IPv6:
network:
version: 2
ethernets:
eth0:
addresses:
- your.float.ing.ip/64Now you should restart your network. Caution: This will reset your network connection
sudo netplan applyCreate the configuration file and open an editor
touch /etc/sysconfig/network-scripts/ifcfg-eth0:1
vi /etc/sysconfig/network-scripts/ifcfg-eth0:1IPv4:
BOOTPROTO=static
DEVICE=eth0:1
IPADDR=your.Float.ing.IP
PREFIX=32
TYPE=Ethernet
USERCTL=no
ONBOOT=yesIPv6:
BOOTPROTO=none
DEVICE=eth0:1
ONBOOT=yes
IPV6ADDR=one IPv6 address of the subnet, e.g. 2a01:4f9:0:2a1::2/64
IPV6INIT=yesNow you should restart your network. Caution: This will reset your network connection
systemctl restart network