so u mean using cloud-init possible to assign multiple ip? can u give me example under proxmox please? in this case we only able to assign 1 ip onlyHi,
for each virtual NIC (net[n]
) you configure for the VM, you can configure the IP with the correspondingipconfig[n]
cloud-init setting. Seeman qm
for the details of the setting or theCloud-Init
panel for the VM in the UI.
Example configuration, relevant settings areso u mean using cloud-init possible to assign multiple ip? can u give me example under proxmox please? in this case we only able to assign 1 ip only
net{0,1}
and ipconfig{0,1}
:boot: c
bootdisk: scsi0
cipassword: $5$CJNhfoT0$dk7lpMTPhq2c/0MeFy.RePr9VeC7sB6K53ddU1fmpf3
ciuser: rooty
cores: 4
ide2: local:9006/vm-9006-cloudinit.qcow2,media=cdrom
ipconfig0: ip=192.168.20.155/24
ipconfig1: ip=192.168.21.155/24
memory: 4384
meta: creation-qemu=7.0.0,ctime=1663838846
name: foobar
net0: virtio=66:10:DF:FA:72:F9,bridge=vmbr0
net1: virtio=42:B9:7D:DD:53:23,bridge=vmbr1
scsi0: myzpool:vm-9006-disk-0,size=2G
scsihw: virtio-scsi-pci
serial0: socket
smbios1: uuid=d5930ac8-f28a-4f61-9900-38157358495f
vga: serial0
vmgenid: 201debc7-989c-4ed8-a567-be925793ca39
Hardware
tab first and then set the IP Config
settings in the Cloudinit
tab for the VM.You can assign one IPv4 and one IPv6 address. I don't think it's possible otherwise with the usual configuration mechanism. Why would you need that?i mean 1 eth0 but contain 2 ips.. possible?
in your tutorial it shows eth0 and eth1.
This is not possible with cloud-init. You would need to run Ansible or similar to add the second IP address.i mean 1 eth0 but contain 2 ips.. possible?
--cicustom
parameter, see section 10.8.3 of [0].how about cloud-init in proxmox? they only able to assign 1 ip address only per network ethernet...It might actually be possible with cloud-init too if the guest runs something like Netplan. Translating/Summarizing what @mira said here:
You can write a script based on the v2 network config format [1] and pass it as-is to the VM/Netplan via the--cicustom
parameter, see section 10.8.3 of [0].
[0] https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_cloud_init (10.8.3)
[1] https://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v2.html
Yes, thehow about cloud-init in proxmox? they only able to assign 1 ip address only per network ethernet...
ipconfigN
options only allow one IPv4 and IPv6 address. If you need more advanced configuration, you need to use a different mechanism.