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 |
| 5 | {% set mgmtbr_ip = ( vtn_net_management_host_cidr | ipaddr(node.ipv4_last_octet) | ipaddr('address')) %} |
| 6 | auto mgmtbridge |
| 7 | iface 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 Williams | 6e1d816 | 2018-01-31 15:29:55 -0700 | [diff] [blame] | 14 | hwaddress ether {{ ( vtn_net_management_host_hwaddr_prefix ~ ( mgmtbr_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 | 2f5f2bd | 2017-12-01 15:04:22 -0700 | [diff] [blame] | 17 | post-down ip link del mgmtbridge |
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 |
| 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 | |