blob: 566116b29f7c895d2109c4957872f00abff27b95 [file] [log] [blame]
Zack Williams6dc2d452017-12-20 17:50:49 -07001# Created by platform-install: interface-config/templates/fabric.cfg.j2
2{% for node in physical_node_list if node.name == ansible_hostname %}
3
Zack Williams2f5f2bd2017-12-01 15:04:22 -07004{% if fabric_net_interfaces %}
5# physical network members of fabricbond
6{% for fab_int in fabric_net_interfaces %}
7auto {{ fab_int }}
8iface {{ 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 Williams6dc2d452017-12-20 17:50:49 -070013
Zack Williams2f5f2bd2017-12-01 15:04:22 -070014{% endfor %}
15{% endif %}
16
17{% if node.name == headnode %}
18# fabricbond of physical interfaces on head node
Zack Williams6dc2d452017-12-20 17:50:49 -070019auto fabricbond
20iface 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 Williams2f5f2bd2017-12-01 15:04:22 -070028# fabricbridge
29{% set vtn_ip = ( vtn_net_public_cidr | ipaddr(node.ipv4_last_octet) | ipaddr('address')) %}
30auto fabricbridge
31iface fabricbridge inet static
32 pre-up ip link add fabricbridge type bridge
33 bridge_ports fabricbond
34 address {{ vtn_ip }}
Zack Williams6dc2d452017-12-20 17:50:49 -070035 network {{ vtn_net_public_cidr | ipaddr('network') }}
36 netmask {{ vtn_net_public_cidr | ipaddr('netmask') }}
Zack Williams6dc2d452017-12-20 17:50:49 -070037 broadcast {{ vtn_net_public_cidr | ipaddr('broadcast') }}
Zack Williams3e520902018-02-06 17:59:34 -070038 hwaddress ether {{ fabric_gateway_hwaddr }}
Zack Williams2f5f2bd2017-12-01 15:04:22 -070039 post-down ip link del fabricbridge
Zack Williams6dc2d452017-12-20 17:50:49 -070040
41{% if use_addresspool_vsg %}
42# vSG public gateway
Zack Williams2f5f2bd2017-12-01 15:04:22 -070043{% set ap_vsg_ip = ( addresspool_vsg_cidr | ipaddr(node.ipv4_last_octet) | ipaddr('address')) %}
44auto fabricbridge:0
45iface fabricbridge:0 inet static
46 address {{ ap_vsg_ip }}
Zack Williams6dc2d452017-12-20 17:50:49 -070047 network {{ addresspool_vsg_cidr | ipaddr('network') }}
48 netmask {{ addresspool_vsg_cidr | ipaddr('netmask') }}
Zack Williams6dc2d452017-12-20 17:50:49 -070049 broadcast {{ addresspool_vsg_cidr | ipaddr('broadcast') }}
Zack Williams6dc2d452017-12-20 17:50:49 -070050{% endif %}
51
52{% if use_addresspool_public %}
53# public network gateway
Zack Williams2f5f2bd2017-12-01 15:04:22 -070054{% set ap_pub_ip = ( addresspool_public_cidr | ipaddr(node.ipv4_last_octet) | ipaddr('address')) %}
55auto fabricbridge:1
56iface fabricbridge:1 inet static
57 address {{ ap_pub_ip }}
Zack Williams6dc2d452017-12-20 17:50:49 -070058 network {{ addresspool_public_cidr | ipaddr('network') }}
59 netmask {{ addresspool_public_cidr | ipaddr('netmask') }}
Zack Williams6dc2d452017-12-20 17:50:49 -070060 broadcast {{ addresspool_public_cidr | ipaddr('broadcast') }}
Zack Williams6dc2d452017-12-20 17:50:49 -070061{% endif %}
Zack Williams2f5f2bd2017-12-01 15:04:22 -070062{% 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')) %}
65auto fabricbond
66iface 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 Williams6e1d8162018-01-31 15:29:55 -070073 hwaddress ether {{ ( vtn_net_public_hwaddr_prefix ~ ( vtn_ip | ip4_hex )) | hwaddr('linux') }}
Zack Williams2f5f2bd2017-12-01 15:04:22 -070074 bond-miimon 100
75 bond-slaves none
76 bond-mode active-backup
77 post-down ip link del fabricbond
78{% endif %}
79
Zack Williams6dc2d452017-12-20 17:50:49 -070080{% endfor %}
81