577174b025
When using networks without DHCP enabled and "flat_injected" set to True, the interfaces template is injected in the associated instances or included in the config drive metadata. The template includes the interface name, based on a progressive numbering (eth0, eth1, etc). In case of multiple nics, there's no clear way to identify the interfaces in the guest OS if the actual interface naming differs, this is especially valid for Windows instances. Since the MAC address (hardware address) assigned to each vNIC identifies uniquely the interface, providing the mac address during the template generation solves the issue. Change-Id: Id82db6d83caedf0e95f882d909b77ea9b98b2547 Closes-Bug: #1400080
45 lines
1.2 KiB
Plaintext
45 lines
1.2 KiB
Plaintext
# Injected by Nova on instance boot
|
|
#
|
|
# This file describes the network interfaces available on your system
|
|
# and how to activate them. For more information, see interfaces(5).
|
|
|
|
# The loopback network interface
|
|
auto lo
|
|
iface lo inet loopback
|
|
{% for ifc in interfaces %}
|
|
|
|
auto {{ ifc.name }}
|
|
iface {{ ifc.name }} inet static
|
|
hwaddress ether {{ ifc.hwaddress }}
|
|
address {{ ifc.address }}
|
|
netmask {{ ifc.netmask }}
|
|
broadcast {{ ifc.broadcast }}
|
|
{% if ifc.gateway %}
|
|
gateway {{ ifc.gateway }}
|
|
{% endif %}
|
|
{% if ifc.dns %}
|
|
dns-nameservers {{ ifc.dns }}
|
|
{% endif %}
|
|
{% if use_ipv6 %}
|
|
{% if libvirt_virt_type == 'lxc' %}
|
|
{% if ifc.address_v6 %}
|
|
post-up ip -6 addr add {{ ifc.address_v6 }}/{{ifc.netmask_v6 }} dev ${IFACE}
|
|
{% endif %}
|
|
{% if ifc.gateway_v6 %}
|
|
post-up ip -6 route add default via {{ ifc.gateway_v6 }} dev ${IFACE}
|
|
{% endif %}
|
|
{% else %}
|
|
iface {{ ifc.name }} inet6 static
|
|
hwaddress ether {{ ifc.hwaddress }}
|
|
address {{ ifc.address_v6 }}
|
|
netmask {{ ifc.netmask_v6 }}
|
|
{% if ifc.gateway_v6 %}
|
|
gateway {{ ifc.gateway_v6 }}
|
|
{% endif %}
|
|
{% if ifc.dns_v6 %}
|
|
dns-nameservers {{ ifc.dns_v6 }}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|