+# Enable only non vlan interfaces first.
+if [ -e ./labconfig.json ]; then
+ if [ $SUBNETDATA_CIDR ]; then
+ EXTNET=`cat labconfig.json | jq --raw-output '.lab.racks[0].nodes[].nics[] | select(.spaces[]=="data")'.ifname | sort -u`
+ i="0"
+ while [ ! -z "${EXTNET[i]}" ];
+ do
+ if ([ -z $VLAN ] || [ "$VLAN" == "null" ]); then
+ enableautomode ${EXTNET[i]} AUTO $SUBNETDATA_CIDR || true
+ fi
+ i=$[$i+1]
+ done
+ fi
+ if [ $SUBNETPUB_CIDR ]; then
+ EXTNET=`cat labconfig.json | jq --raw-output '.lab.racks[0].nodes[].nics[] | select(.spaces[]=="public")'.ifname | sort -u`
+ i="0"
+ while [ ! -z "${EXTNET[i]}" ];
+ do
+ if ([ -z $VLAN ] || [ "$VLAN" == "null" ]); then
+ enableautomode ${EXTNET[i]} AUTO $SUBNETPUB_CIDR || true
+ fi
+ i=$[$i+1]
+ done
+ fi
+ if [ $SUBNETSTOR_CIDR ]; then
+ EXTNET=`cat labconfig.json | jq --raw-output '.lab.racks[0].nodes[].nics[] | select(.spaces[]=="storage")'.ifname | sort -u`
+ i="0"
+ while [ ! -z "${EXTNET[i]}" ];
+ do
+ if ([ -z $VLAN ] || [ "$VLAN" == "null" ]); then
+ enableautomode ${EXTNET[i]} AUTO $SUBNETSTOR_CIDR || true
+ fi
+ i=$[$i+1]
+ done
+ fi
+ if [ $SUBNETFLOAT_CIDR ]; then
+ EXTNET=`cat labconfig.json | jq --raw-output '.lab.racks[0].nodes[].nics[] | select(.spaces[]=="floating")'.ifname | sort -u`
+ i="0"
+ while [ ! -z "${EXTNET[i]}" ];
+ do
+ if ([ -z $VLAN ] || [ "$VLAN" == "null" ]); then
+ enableautomode ${EXTNET[i]} link_up $SUBNETFLOAT_CIDR || true
+ fi
+ i=$[$i+1]
+ done
+ fi
+fi