I am trying to write a python script to be able to set a static IPv4 address to a network interface on a VM, without actually going into the VM's OS. We have a large number of machines to assign static ips to on a regular basis and don't want to have to do it manually on every single machine.
I am looking for a command through the Proxmox node shell that can do this. I have so far tried:
this puts
into the VMID.conf file, but then when I restart the virtual machine, it doesn't set the network cards to anything (which makes sense, I don't think I understand how this command works)
I have also tried to edit the
and changed
to
but proxmox doesn't like that either =
this also deletes the network card which I found funny XD
I am testing these on a Kali Linux VM, but the actual script will be used to change the ip address of the WAN side of a PF-Sense firewall running in Open-BSD VMs.
Any help is very much appreciated!
I am looking for a command through the Proxmox node shell that can do this. I have so far tried:
qm set <VMID> --ipconfig0 ip=10.10.10.50/24,gw=10.10.10.1
(the VM is on a vmbr1, which has an ip address of 10.10.10.1/24)this puts
ipconfig0: ip=10.10.10.69/24,gw=10.10.10.1
into the VMID.conf file, but then when I restart the virtual machine, it doesn't set the network cards to anything (which makes sense, I don't think I understand how this command works)
I have also tried to edit the
/etc/pve/qemu-server/<VMID>.conf
and changed
net0: virtio=BC:24:11:C3:58:B8,bridge=vmbr1,firewall=1
to
net0: virtio=BC:24:11:C3:58:B8,bridge=vmbr1,firewall=1,ip=10.10.10.69/24,gw=10.10.10.1
but proxmox doesn't like that either =
vm 631 - unable to parse value of 'net0' - format error
gw: property is not defined in schema and the schema does not allow additional properties
ip: property is not defined in schema and the schema does not allow additional properties
this also deletes the network card which I found funny XD
I am testing these on a Kali Linux VM, but the actual script will be used to change the ip address of the WAN side of a PF-Sense firewall running in Open-BSD VMs.
Any help is very much appreciated!