Zend certified PHP/Magento developer

Netplan – add secondary IP address and assign a label

I saw the same question here, but I can’t find it anymore. How can I add secondary IP address and assign a label to it via netplan?

I have this netplan config:

# This is the network config written by 'subiquity'
network:
  ethernets:
    eth0:
      dhcp4: false
      addresses:
      - 12.34.56.78/24
      - 98.76.54.32/24
      nameservers:
        addresses:
        - 8.8.8.8
        - 8.8.4.4
        search: []
      routes:
        - to: 0.0.0.0/0
          via: 12.34.56.1
  version: 2

ifconfig:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 12.34.56.78  netmask 255.255.255.0  broadcast 12.34.56.255
        inet6 fe80::a00:27ff:fede:7ecc  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:de:7e:cc  txqueuelen 1000  (Ethernet)
        RX packets 1656148  bytes 121855580 (121.8 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5300728  bytes 7534018953 (7.5 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1342850  bytes 259593981 (259.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1342850  bytes 259593981 (259.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I managed to add secondary IP address and assign label to it via ip addr: ip addr add 98.76.54.32/24 dev eth0 label eth0:1 and I got this:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 12.34.56.78  netmask 255.255.255.0  broadcast 12.34.56.255
        inet6 fe80::a00:27ff:fede:7ecc  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:de:7e:cc  txqueuelen 1000  (Ethernet)
        RX packets 1656148  bytes 121855580 (121.8 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5300728  bytes 7534018953 (7.5 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 98.76.54.32  netmask 255.255.255.0  broadcast 0.0.0.0
        ether 08:00:27:de:7e:cc  txqueuelen 1000  (Ethernet)

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1342850  bytes 259593981 (259.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1342850  bytes 259593981 (259.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

But how to do it via netplan?