I use the script below, to build a VM for my OpenWRT VM in proxmox, which covers 80% of the job. However, since I have cable modem service, I do not want to set new vmbr0/vmbr1 VM NIC mac addresses, which would force me to reboot the cable modem to grab the new WAN mac. How can I set static mac's on vmbr0 and vmbr1 in this script? I know I can change the MAC's in the proxmox VE gui, but I just want to knock out any extra steps if possible.
#!/bin/bash
# Define variables
VM_ID=203
VM_NAME="OpenWRT-Prox-Snap"
VM_MEMORY=1024
VM_CPU=4
VM_DISK_SIZE="900M"
VM_NET="model=virtio,bridge=vmbr1"
STORAGE_NAME="TB_VM"
VM_IP="192.168.1.1"
PROXMOX_NODE="PVE"
# Create new VM
qm create $VM_ID --name $VM_NAME --memory $VM_MEMORY --net0 $VM_NET --cores $VM_CPU --ostype l26 --sockets 1
# Remove default hard drive
qm set $VM_ID --scsi0 none
# Lookup the latest stable version number
#regex='<strong>Current Stable Release - OpenWrt ([^/]*)<\/strong>'
#response=$(curl -s https://openwrt.org)
#[[ $response =~ $regex ]]
#stableVersion="${BASH_REMATCH[1]}"
# Rename the extracted img
rm /mnt/pve/TB_VM/images/openwrt.raw
mv /mnt/pve/TB_VM/openwrt_images/snap/openwrt-x86-64-generic-ext4-combined.img /mnt/pve/TB_VM/images/openwrt.raw
# Increase the raw disk to 1024 MB
qemu-img resize -f raw /mnt/pve/TB_VM/images/openwrt.raw $VM_DISK_SIZE
# Import the disk to the openwrt vm
qm importdisk $VM_ID /mnt/pve/TB_VM/images/openwrt.raw $STORAGE_NAME
# Attach imported disk to VM
qm set $VM_ID --virtio0 $STORAGE_NAME:vm-$VM_ID-disk-0.raw
# Set boot disk
qm set $VM_ID --bootdisk virtio0
# Start the VM
#qm start $VM_ID