diff --git a/salt-pillar/lxc-containers/server1.sls b/salt-pillar/lxc-containers/server1.sls index 5a68c6c..c110797 100644 --- a/salt-pillar/lxc-containers/server1.sls +++ b/salt-pillar/lxc-containers/server1.sls @@ -37,6 +37,8 @@ containers: type: veth up1: type: phys + # Change (eg. auto-generation) requires reboot of the cable modem + hwaddr: 00:23:74:D7:2D:7C upstream2: interfaces: diff --git a/salt/lxc-containers/config b/salt/lxc-containers/config index a145be2..36e1a49 100644 --- a/salt/lxc-containers/config +++ b/salt/lxc-containers/config @@ -14,7 +14,11 @@ lxc.kmsg = 0 {%- for net, conf in container['interfaces'].items() %} lxc.network.type={{ conf['type'] }} lxc.network.flags=up +{%- if conf.get('hwaddr') %} +lxc.network.hwaddr={{ conf['hwaddr'] }} +{%- else %} lxc.network.hwaddr={{ hwaddr_prefix }}:{{ n.__str__().rjust(2, '0') }} +{%- endif %} {%- if conf['type'] == 'veth' %} lxc.network.veth.pair={{ id }}-{{ net }} {%- endif %}