Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 1 | # Created by platform-install: interface-config/templates/fabric.cfg.j2 |
| 2 | {% for node in physical_node_list if node.name == ansible_hostname %} |
| 3 | |
Zack Williams | 2f5f2bd | 2017-12-01 15:04:22 -0700 | [diff] [blame] | 4 | {% if fabric_net_interfaces %} |
| 5 | # physical network members of fabricbond |
| 6 | {% for fab_int in fabric_net_interfaces %} |
| 7 | auto {{ fab_int }} |
| 8 | iface {{ fab_int }} inet manual |
| 9 | pre-up ip link set {{ fab_int }} master fabricbond |
| 10 | bond-master fabricbond |
| 11 | bond-primary {{ fabric_net_interfaces | join(' ') }} |
| 12 | post-down ip link set dev {{ fab_int }} nomaster |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 13 | |
Zack Williams | 2f5f2bd | 2017-12-01 15:04:22 -0700 | [diff] [blame] | 14 | {% endfor %} |
| 15 | {% endif %} |
| 16 | |
| 17 | {% if node.name == headnode %} |
| 18 | # fabricbond of physical interfaces on head node |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 19 | auto fabricbond |
| 20 | iface fabricbond inet manual |
| 21 | pre-up ip link add fabricbond type bond |
| 22 | pre-up ip link set fabricbond up |
| 23 | bond-miimon 100 |
| 24 | bond-slaves none |
| 25 | bond-mode active-backup |
| 26 | post-down ip link del fabricbond |
| 27 | |
Zack Williams | 2f5f2bd | 2017-12-01 15:04:22 -0700 | [diff] [blame] | 28 | # fabricbridge |
| 29 | {% set vtn_ip = ( vtn_net_public_cidr | ipaddr(node.ipv4_last_octet) | ipaddr('address')) %} |
| 30 | auto fabricbridge |
| 31 | iface fabricbridge inet static |
| 32 | pre-up ip link add fabricbridge type bridge |
| 33 | bridge_ports fabricbond |
| 34 | address {{ vtn_ip }} |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 35 | network {{ vtn_net_public_cidr | ipaddr('network') }} |
| 36 | netmask {{ vtn_net_public_cidr | ipaddr('netmask') }} |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 37 | broadcast {{ vtn_net_public_cidr | ipaddr('broadcast') }} |
Zack Williams | 553f140 | 2018-02-06 17:59:34 -0700 | [diff] [blame] | 38 | hwaddress ether {{ fabric_gateway_hwaddr }} |
Zack Williams | 2f5f2bd | 2017-12-01 15:04:22 -0700 | [diff] [blame] | 39 | post-down ip link del fabricbridge |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 40 | |
| 41 | {% if use_addresspool_vsg %} |
| 42 | # vSG public gateway |
Zack Williams | 2f5f2bd | 2017-12-01 15:04:22 -0700 | [diff] [blame] | 43 | {% set ap_vsg_ip = ( addresspool_vsg_cidr | ipaddr(node.ipv4_last_octet) | ipaddr('address')) %} |
| 44 | auto fabricbridge:0 |
| 45 | iface fabricbridge:0 inet static |
| 46 | address {{ ap_vsg_ip }} |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 47 | network {{ addresspool_vsg_cidr | ipaddr('network') }} |
| 48 | netmask {{ addresspool_vsg_cidr | ipaddr('netmask') }} |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 49 | broadcast {{ addresspool_vsg_cidr | ipaddr('broadcast') }} |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 50 | {% endif %} |
| 51 | |
| 52 | {% if use_addresspool_public %} |
| 53 | # public network gateway |
Zack Williams | 2f5f2bd | 2017-12-01 15:04:22 -0700 | [diff] [blame] | 54 | {% set ap_pub_ip = ( addresspool_public_cidr | ipaddr(node.ipv4_last_octet) | ipaddr('address')) %} |
| 55 | auto fabricbridge:1 |
| 56 | iface fabricbridge:1 inet static |
| 57 | address {{ ap_pub_ip }} |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 58 | network {{ addresspool_public_cidr | ipaddr('network') }} |
| 59 | netmask {{ addresspool_public_cidr | ipaddr('netmask') }} |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 60 | broadcast {{ addresspool_public_cidr | ipaddr('broadcast') }} |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 61 | {% endif %} |
Zack Williams | 2f5f2bd | 2017-12-01 15:04:22 -0700 | [diff] [blame] | 62 | {% else %} |
| 63 | # Compute nodes only have a fabricbond, which is put into br-int by VTN |
| 64 | {% set vtn_ip = ( vtn_net_public_cidr | ipaddr(node.ipv4_last_octet) | ipaddr('address')) %} |
| 65 | auto fabricbond |
| 66 | iface fabricbond inet static |
| 67 | pre-up ip link add fabricbond type bond |
| 68 | pre-up ip link set fabricbond up |
| 69 | address {{ vtn_ip }} |
| 70 | network {{ vtn_net_public_cidr | ipaddr('network') }} |
| 71 | netmask {{ vtn_net_public_cidr | ipaddr('netmask') }} |
| 72 | broadcast {{ vtn_net_public_cidr | ipaddr('broadcast') }} |
Zack Williams | 6e1d816 | 2018-01-31 15:29:55 -0700 | [diff] [blame] | 73 | hwaddress ether {{ ( vtn_net_public_hwaddr_prefix ~ ( vtn_ip | ip4_hex )) | hwaddr('linux') }} |
Zack Williams | 2f5f2bd | 2017-12-01 15:04:22 -0700 | [diff] [blame] | 74 | bond-miimon 100 |
| 75 | bond-slaves none |
| 76 | bond-mode active-backup |
| 77 | post-down ip link del fabricbond |
| 78 | {% endif %} |
| 79 | |
Zack Williams | 6dc2d45 | 2017-12-20 17:50:49 -0700 | [diff] [blame] | 80 | {% endfor %} |
| 81 | |