lxc-containers: allow fixed hwaddr
This commit is contained in:
parent
04f28303ec
commit
0d99dc4d56
|
@ -37,6 +37,8 @@ containers:
|
||||||
type: veth
|
type: veth
|
||||||
up1:
|
up1:
|
||||||
type: phys
|
type: phys
|
||||||
|
# Change (eg. auto-generation) requires reboot of the cable modem
|
||||||
|
hwaddr: 00:23:74:D7:2D:7C
|
||||||
|
|
||||||
upstream2:
|
upstream2:
|
||||||
interfaces:
|
interfaces:
|
||||||
|
|
|
@ -14,7 +14,11 @@ lxc.kmsg = 0
|
||||||
{%- for net, conf in container['interfaces'].items() %}
|
{%- for net, conf in container['interfaces'].items() %}
|
||||||
lxc.network.type={{ conf['type'] }}
|
lxc.network.type={{ conf['type'] }}
|
||||||
lxc.network.flags=up
|
lxc.network.flags=up
|
||||||
|
{%- if conf.get('hwaddr') %}
|
||||||
|
lxc.network.hwaddr={{ conf['hwaddr'] }}
|
||||||
|
{%- else %}
|
||||||
lxc.network.hwaddr={{ hwaddr_prefix }}:{{ n.__str__().rjust(2, '0') }}
|
lxc.network.hwaddr={{ hwaddr_prefix }}:{{ n.__str__().rjust(2, '0') }}
|
||||||
|
{%- endif %}
|
||||||
{%- if conf['type'] == 'veth' %}
|
{%- if conf['type'] == 'veth' %}
|
||||||
lxc.network.veth.pair={{ id }}-{{ net }}
|
lxc.network.veth.pair={{ id }}-{{ net }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
Loading…
Reference in New Issue