Skip to main content

Attach (private) IPv4 address to a running VM

  • Issue: IPv4 addresses are not pingable / usable out of the box after they are attached to a running VM. The netplan config needs to be changed aswell. The same applies to private IPv4 addresses.

  • Solution:

  1. Login to the VM where you want to add the (private) IPv4 address

  2. Navigate to the netplan config under “/etc/netplan”

  3. As root, open the “50-cloud-init.yaml” file with your preferred text editor

  4. Replace the existing configuration with the following:

CODE
network:
  ethernets:
    enp1s0:
      addresses:
        - < VM public IPv6 address eg. 2a11:cc81:0:2a::1/64 >
        - < VM public IPv4 address eg. 176.56.139.33/32 >
        - < VM private IPv4 address eg. 192.168.1.1/24 >
      dhcp4: false
      dhcp6: false
      nameservers:
        addresses:
          - 2001:4860:4860::8888
          - 2001:4860:4860::8844
        routes:
          - on-link: true
            to: 0.0.0.0/0
            via: 169.254.1.1
          - on-link: true
            to: ::/0
            via: fe80::1
  version: 2
  1. Save the configuration

  2. Apply the netplan configuration with “sudo netplan apply”

  3. Opt. repeat the upper steps for other VM’s in the same network

  4. Test connection with ping

  • Note:

    • Private IPs should be in the same network/subnet

    • Private IPs created in Boden VM and Lefdal VM, even when in the same subnet, won’t be reachable among each other

    • Public IPv4 and IPv6 are reachable from everywhere

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.