The first time a dynamic _mac property is set, an UnknownConfigProperty exception is raised. When the value already exists, the MAC address can be set without this message.
$ ioc set vnet0_mac=63ECAC12D0F1 testmac
The config property 'vnet0_mac' is unknown
Jail 'foobar2' updated: vnet0_mac
$ ioc set vnet0_mac=63ECAC12D0F2 testmac
Jail 'foobar2' updated: vnet0_mac
One problem is that an error should interrupt the execution (so the value should not be updated after the message), another is that on set any _mac config property is valid. It would be possible to enforce the according interface to exist, but this would impact the order of setting them:
ioc create testmac1 vnet=on interfaces="vnet0:bridge0" vnet0_mac=63ECAC12D0F1
ioc create testmac1 vnet=on vnet0_mac=63ECAC12D0F1 interfaces="vnet0:bridge0"
A solution to work around this issue is to apply config properties in order of priority.
The first time a dynamic_mac property is set, an UnknownConfigProperty exception is raised. When the value already exists, the MAC address can be set without this message.
One problem is that an error should interrupt the execution (so the value should not be updated after the message), another is that on set any_mac config property is valid. It would be possible to enforce the according interface to exist, but this would impact the order of setting them:
A solution to work around this issue is to apply config properties in order of priority.
Thanks to @leonbayer for reporting this issue.