Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 1 | # 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 |
Zack Williams | b61ca26 | 2018-01-29 17:01:21 -0700 | [diff] [blame] | 5 | {% set mgmtbridge_ip = ( vtn_net_management_host_cidr | ipaddr(node.ipv4_last_octet) | ipaddr('address')) %} |
| 6 | auto {{ management_net_bridge }} |
| 7 | iface {{ management_net_bridge }} inet static |
| 8 | pre-up ip link add {{ management_net_bridge }} type bridge |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 9 | bridge_ports mgmtbond vethmgmt0 |
Zack Williams | b61ca26 | 2018-01-29 17:01:21 -0700 | [diff] [blame] | 10 | address {{ mgmtbridge_ip }} |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 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 Williams | b61ca26 | 2018-01-29 17:01:21 -0700 | [diff] [blame] | 14 | hwaddress ether {{ ( vtn_net_management_host_hwaddr_prefix ~ ( mgmtbridge_ip | ip4_hex )) | hwaddr('linux') }} |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 15 | dns-search {{ site_suffix }} |
| 16 | dns-nameservers {{ dns_servers | join(" ") }} |
Zack Williams | b61ca26 | 2018-01-29 17:01:21 -0700 | [diff] [blame] | 17 | post-down ip link del {{ management_net_bridge }} |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 18 | |
| 19 | # management bond of physical interfaces |
| 20 | auto mgmtbond |
| 21 | iface 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 %} |
| 32 | auto {{ mgmt_int }} |
| 33 | iface {{ 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 |
| 45 | auto vethmgmt0 |
| 46 | iface 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 |
Zack Williams | b61ca26 | 2018-01-29 17:01:21 -0700 | [diff] [blame] | 50 | post-up ip link set dev vethmgmt0 master {{ management_net_bridge }} |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 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 | |