Feature request: MAC address derived from container name

Nov 4, 2020
7
1
8
25
I've been juggling with containers a lot these days and been bitten quite a few times by the fact that MAC addresses change or stay the same at inconvenient moments so that I end up with conflicts in IP addresses or DNS names.

For me it is really useful if a MAC address stays the same when a new container has the same name. In fact, I implemented a Perl script that uses the API to clone a CT from a template and sets the MAC to an address derived from the container name. That way I can stop the old container with the same name and start the new one within seconds with the new container taking the place of the new one seamlessly.

Perhaps such an feature would be useful in general when implemented as a GUI option.

sub hashed_mac { my $hostname = shift; my $mac_nic = substr(md5_hex($hostname), 0, 6); my $mac = '02:00:00:' . join(':', $mac_nic =~ /(..)/g); return uc( $mac ); }
 

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!