blob: bb3c1e6fd4ec777999e59e10ffa16678ce24778c [file] [log] [blame]
Zack Williams6dc2d452017-12-20 17:50:49 -07001# Created by platform-install: interface-config/templates/management.cfg.j2
2{% for node in physical_node_list if node.name == ansible_hostname %}
3
4# management bridge between physical and virtual interfaces for VTN
5{% set mgmtbr_ip = ( vtn_net_management_host_cidr | ipaddr(node.ipv4_last_octet) | ipaddr('address')) %}
6auto mgmtbridge
7iface mgmtbridge inet static
8 pre-up ip link add mgmtbridge type bridge
9 bridge_ports mgmtbond vethmgmt0
10 address {{ mgmtbr_ip }}
11 network {{ vtn_net_management_host_cidr | ipaddr('network') }}
12 netmask {{ vtn_net_management_host_cidr | ipaddr('netmask') }}
13 broadcast {{ vtn_net_management_host_cidr | ipaddr('broadcast') }}
14 hwaddress ether {{ ( vtn_net_management_host_hwaddr_prefix ~ ( mgmtbr_ip | ip4_hex )) | hwaddr('unix') }}
15 dns-search {{ site_suffix }}
16 dns-nameservers {{ dns_servers | join(" ") }}
17
18# management bond of physical interfaces
19auto mgmtbond
20iface mgmtbond inet manual
21 pre-up ip link add mgmtbond type bond
22 pre-up ip link set mgmtbond up
23 bond-slaves none
24 bond-mode active-backup
25 bond-miimon 100
26 post-down ip link del mgmtbond
27
28{% if management_net_interfaces %}
29# physical network members of mgmtbond
30{% for mgmt_int in management_net_interfaces %}
31auto {{ mgmt_int }}
32iface {{ mgmt_int }} inet manual
33 pre-up ip link set {{ mgmt_int }} master mgmtbond
34 bond-master mgmtbond
35 bond-mode active-backup
36 bond-primary {{ management_net_interfaces | join(' ') }}
37 post-down ip link set dev {{ mgmt_int }} nomaster
38
39{% endfor %}
40{% endif %}
41
42# veth interfaces for VTN MANAGEMENT_HOST
43# vethmgmt0: connected to mgmtbond
44auto vethmgmt0
45iface vethmgmt0 inet manual
46 pre-up ip link add vethmgmt0 type veth peer name vethmgmt1
47 pre-up ip link set vethmgmt0 up
48 pre-up ip link set vethmgmt1 up
49 post-up ip link set dev vethmgmt0 master mgmtbridge
50 pre-down ip link set dev vethmgmt0 nomaster
51 post-down ip link del vethmgmt0
52
53# vethmgmt1: connected to VTN as hostManagementIface, if enabled
54# Brought up by vethmgmt0
55
56{% endfor %}
57