blob: 87029496880675789360b43b282def82b9c39960 [file] [log] [blame]
Charles Chan38240872019-10-23 02:05:05 -07001#!/bin/bash
2
3# Select topology to emulate
4TOPO=${TOPO:-trellis}
5ONOS_HOST=${ONOS_HOST:-localhost}
6
7# Resolve ONOS IP
8ONOS_IP=`getent hosts $ONOS_HOSTNAME | awk '{ print $1 }'`
9
10# Start and configure OVS
11# Avoid using Linux service since it will attempt but fail the kernel module check
12/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd --no-monitor --system-id=random start
13/usr/sbin/ovs-vswitchd --detach
14ovs-vsctl set Open_vSwitch . other_config:vlan-limit=2
15
Charles Chan38240872019-10-23 02:05:05 -070016cd routing/trellis
hwchiufce80ad2019-10-24 16:39:25 -070017NETCFG=${EXTERNAL_VOLUME}/${NETCFG_FILE}
18echo "Check custom config, ${NETCFG}"
19
20# Use custom file if ${NETCFG_FILE} be set
21if [[ ${NETCFG_FILE} ]]; then
22 if [ -f ${NETCFG} ]; then
23 echo "Detected custom cfg ${NETCFG}, use it"
24 onos-netcfg ${ONOS_IP} ${NETCFG} || exit 0
25 else
26 echo "${NETCFG} does not exist"
27 exit 0
28 fi
29fi
Charles Chan38240872019-10-23 02:05:05 -070030
31# Start mininet
32./${TOPO}.py -c ${ONOS_IP}