[SOLVED] Modify hwaddr/MAC of LXC

promoxer

Member
Apr 21, 2023
207
20
18
Code:
# more /etc/pve/lxc/123.conf
...
...
net0: name=eth0,hwaddr=77:88:99:00:AA:BB,type=veth
...
...
# pct set 123 -net0 hwaddr=11:22:33:44:55:66
400 Parameter verification failed.
net0: invalid format - format error
net0.name: property is missing and it is not optional

pct set <vmid> [OPTIONS]
# pct set 123 -net0 name=eth0,hwaddr=11:22:33:44:55:66
Use of uninitialized value in string ne at /usr/share/perl5/PVE/LXC/Config.pm line 1580.
Use of uninitialized value in string ne at /usr/share/perl5/PVE/LXC/Config.pm line 1580.
Use of uninitialized value $bridge in concatenation (.) or string at /usr/share/perl5/PVE/Network.pm line 125.
Use of uninitialized value $bridge in concatenation (.) or string at /usr/share/perl5/PVE/Network.pm line 126.
bridge '' does not exist
# pct set 123 -net0 name=eth0,hwaddr=11:22:33:44:55:66,type=veth
Use of uninitialized value $bridge in concatenation (.) or string at /usr/share/perl5/PVE/Network.pm line 125.
Use of uninitialized value $bridge in concatenation (.) or string at /usr/share/perl5/PVE/Network.pm line 126.
bridge '' does not exist
#

I just want to automate changing the hwaddr and I have no idea what the other values should be. Any ideas?
 
Last edited:
Ok, nevermind, despite the errors `pct set 123 -net0 hwaddr=11:22:33:44:55:66` changes the MAC address.
 
Last edited:
That network device won't function. You may have trouble even starting the LXC.

If you try:
Code:
pct set 123 -net0 name=eth0,bridge=vmbr0,hwaddr=11:22:33:44:55:66,type=veth
You should get no error.

(IDW your bridge setup in PVE, but I used the standard vmbr0. Change according to your setup/requirements).
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!