Hello,
I am trying to configure network with cloud-init.
I've prepared template with cloud-init with the following option:
cloudinit-vendor.yml:
I expect that my network interface will work with DHCP.
Can someone help me please ?
I am trying to configure network with cloud-init.
I've prepared template with cloud-init with the following option:
Code:
qm set 8000 --cicustom "user=local:snippets/userconfig.yaml,vendor=local:snippets/cloudinit-vendor.yml"
cloudinit-vendor.yml:
Code:
cat cloudinit-vendor.yml
#cloud-config
manage_etc_hosts: true
#
network:
version: 2
ethernets:
ens18:
dhcp4: true
# locale: de_DE.UTF-8
timezone: Europe/Warsaw
package_update: true
package_upgrade: true
package_reboot_if_required: true
packages:
- qemu-guest-agent
- nfs-common
# - postfix
- ntp
# - landscape-client
- apt-transport-https
- mc
Code:
ubuntu@ubuntu:~$ cat /etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
Code:
ubuntu@ubuntu:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens18: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 7e:f5:25:f2:93:66 brd ff:ff:ff:ff:ff:ff
altname enp0s18
I expect that my network interface will work with DHCP.
Can someone help me please ?
PVE Virtual Environment 7.2-11
cloud-init --version
/usr/bin/cloud-init 22.2-0ubuntu1~22.04.3
Last edited: