summaryrefslogtreecommitdiff
path: root/nova/virt/interfaces.template
blob: ee78a1fc6036447196294b82215b52fdee24dab6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# 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 %}