blob: d3666600dd05cac38e9c6ea9e4eea09c3a1bbb67 [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') }}
Zack Williams6e1d8162018-01-31 15:29:55 -070014 hwaddress ether {{ ( vtn_net_management_host_hwaddr_prefix ~ ( mgmtbr_ip | ip4_hex )) | hwaddr('linux') }}
Zack Williams6dc2d452017-12-20 17:50:49 -070015 dns-search {{ site_suffix }}
16 dns-nameservers {{ dns_servers | join(" ") }}
Zack Williams2f5f2bd2017-12-01 15:04:22 -070017 post-down ip link del mgmtbridge
Zack Williams6dc2d452017-12-20 17:50:49 -070018
19# management bond of physical interfaces
20auto mgmtbond
21iface mgmtbond inet manual
22 pre-up ip link add mgmtbond type bond
23 pre-up ip link set mgmtbond up
24 bond-slaves none
25 bond-mode active-backup
26 bond-miimon 100
27 post-down ip link del mgmtbond
28
29{% if management_net_interfaces %}
30# physical network members of mgmtbond
31{% for mgmt_int in management_net_interfaces %}
32auto {{ mgmt_int }}
33iface {{ mgmt_int }} inet manual
34 pre-up ip link set {{ mgmt_int }} master mgmtbond
35 bond-master mgmtbond
36 bond-mode active-backup
37 bond-primary {{ management_net_interfaces | join(' ') }}
38 post-down ip link set dev {{ mgmt_int }} nomaster
39
40{% endfor %}
41{% endif %}
42
43# veth interfaces for VTN MANAGEMENT_HOST
44# vethmgmt0: connected to mgmtbond
45auto vethmgmt0
46iface vethmgmt0 inet manual
47 pre-up ip link add vethmgmt0 type veth peer name vethmgmt1
48 pre-up ip link set vethmgmt0 up
49 pre-up ip link set vethmgmt1 up
50 post-up ip link set dev vethmgmt0 master mgmtbridge
51 pre-down ip link set dev vethmgmt0 nomaster
52 post-down ip link del vethmgmt0
53
54# vethmgmt1: connected to VTN as hostManagementIface, if enabled
55# Brought up by vethmgmt0
56
57{% endfor %}
58