Name interfaces using mactab

master
LEdoian 3 years ago
parent afa4ed311b
commit ca51082938

@ -23,6 +23,7 @@ for dir in output/*/; do
interfaces /etc/network/interfaces interfaces /etc/network/interfaces
hosts /etc/hosts hosts /etc/hosts
hostname /etc/hostname hostname /etc/hostname
mactab /etc/mactab
END END
umount "$mount" umount "$mount"
losetup -d "$loop" losetup -d "$loop"

@ -29,6 +29,7 @@ class Computer:
'bird.conf', 'bird.conf',
'hosts', 'hosts',
'hostname', 'hostname',
'mactab',
] ]
context = {'c': self} context = {'c': self}

@ -1,19 +1,9 @@
auto lo auto lo
iface lo inet loopback iface lo inet loopback
{# auto {% for x in range(len(c.bridges)) %} eth{{x}} {% endfor %} #}
auto /eth*
mapping eth*
script TODO/get-mac-address.sh
{% for br in c.bridges %}
map 52:54:00:17:{{ '%02x:%02x' % (c.num, br.num) }} net_{{br.num}}
{% endfor %}
{% for br in c.bridges %} {% for br in c.bridges %}
auto net_{{ br.num }}
iface net_{{br.num}} inet static iface net_{{br.num}} inet static
address 172.23.{{ br.num }}.{{ c.num }}/24 address 172.23.{{ br.num }}.{{ c.num }}/24
{% endfor %} {% endfor %}

@ -0,0 +1,5 @@
{% for br in c.bridges %}
net_{{ br.num }} 52:54:00:17:{{ '%02x:%02x' % (c.num, br.num) }}
{% endfor %}
Loading…
Cancel
Save