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 | |
| 4 | # fabricbridge between physical bond and virtual interfaces for VTN |
| 5 | auto fabricbridge |
| 6 | iface fabricbridge inet manual |
| 7 | pre-up ip link add fabricbridge type bridge |
| 8 | bridge_ports fabricbond vethfabric0 |
| 9 | |
| 10 | # fabric bond of physical interfaces for VTN |
| 11 | auto fabricbond |
| 12 | iface fabricbond inet manual |
| 13 | pre-up ip link add fabricbond type bond |
| 14 | pre-up ip link set fabricbond up |
| 15 | bond-miimon 100 |
| 16 | bond-slaves none |
| 17 | bond-mode active-backup |
| 18 | post-down ip link del fabricbond |
| 19 | |
| 20 | {% if fabric_net_interfaces %} |
| 21 | # physical network members of fabricbond |
| 22 | {% for fab_int in fabric_net_interfaces %} |
| 23 | auto {{ fab_int }} |
| 24 | iface {{ fab_int }} inet manual |
| 25 | pre-up ip link set {{ mgmt_int }} master fabricbond |
| 26 | bond-master fabricbond |
| 27 | bond-mode active-backup |
| 28 | bond-primary {{ management_net_interfaces | join(' ') }} |
| 29 | post-down ip link set dev {{ mgmt_int }} nomaster |
| 30 | |
| 31 | {% endfor %} |
| 32 | {% endif %} |
| 33 | |
| 34 | # vethfabric0/vethfabric1 interfaces connect from VTN br-int to fabricbridge |
| 35 | # vethfabric0: connected to fabricbridge |
| 36 | auto vethfabric0 |
| 37 | iface vethfabric0 inet manual |
| 38 | pre-up ip link add vethfabric0 type veth peer name vethfabric1 |
| 39 | pre-up ip link set vethfabric0 up |
| 40 | post-up ip link set dev vethfabric0 master fabricbridge |
| 41 | pre-down ip link set dev vethfabric0 nomaster |
| 42 | post-down ip link del vethfabric0 |
| 43 | |
| 44 | # vethfabric1: becomes a part of br-int, which takes over the IP address |
| 45 | {% set vtn_veth_ip = ( vtn_net_public_cidr | ipaddr(node.ipv4_last_octet) | ipaddr('address')) %} |
| 46 | auto vethfabric1 |
| 47 | iface vethfabric1 inet static |
| 48 | address {{ vtn_veth_ip }} |
| 49 | network {{ vtn_net_public_cidr | ipaddr('network') }} |
| 50 | netmask {{ vtn_net_public_cidr | ipaddr('netmask') }} |
| 51 | gateway {{ vtn_net_public_cidr | ipaddr('1') | ipaddr('address') }} |
| 52 | broadcast {{ vtn_net_public_cidr | ipaddr('broadcast') }} |
| 53 | hwaddress ether {{ ( vtn_net_public_hwaddr_prefix ~ ( vtn_veth_ip | ip4_hex )) | hwaddr('unix') }} |
| 54 | |
| 55 | {% if use_addresspool_vsg %} |
| 56 | # vSG public gateway |
| 57 | {% set ap_vsg_veth_ip = ( addresspool_vsg_cidr | ipaddr(node.ipv4_last_octet) | ipaddr('address')) %} |
| 58 | auto vethfabric1:0 |
| 59 | iface vethfabric1:0 inet static |
| 60 | address {{ ap_vsg_veth_ip }} |
| 61 | network {{ addresspool_vsg_cidr | ipaddr('network') }} |
| 62 | netmask {{ addresspool_vsg_cidr | ipaddr('netmask') }} |
| 63 | gateway {{ addresspool_vsg_cidr | ipaddr('1') | ipaddr('address') }} |
| 64 | broadcast {{ addresspool_vsg_cidr | ipaddr('broadcast') }} |
| 65 | hwaddress ether {{ ( addresspool_vsg_hwaddr_prefix ~ ( ap_vsg_eth_ip | ip4_hex )) | hwaddr('unix') }} |
| 66 | |
| 67 | {% endif %} |
| 68 | |
| 69 | {% if use_addresspool_public %} |
| 70 | # public network gateway |
| 71 | {% set ap_pub_veth_ip = ( addresspool_public_cidr | ipaddr(node.ipv4_last_octet) | ipaddr('address')) %} |
| 72 | auto vethfabric1:1 |
| 73 | iface vethfabric1:1 inet static |
| 74 | address {{ ap_pub_veth_ip }} |
| 75 | network {{ addresspool_public_cidr | ipaddr('network') }} |
| 76 | netmask {{ addresspool_public_cidr | ipaddr('netmask') }} |
| 77 | gateway {{ addresspool_public_cidr | ipaddr('1') | ipaddr('address') }} |
| 78 | broadcast {{ addresspool_public_cidr | ipaddr('broadcast') }} |
| 79 | hwaddress ether {{ ( addresspool_public_hwaddr_prefix ~ ( ap_pub_veth_ip | ip4_hex )) | hwaddr('unix') }} |
| 80 | |
| 81 | {% endif %} |
| 82 | {% endfor %} |
| 83 | |