def setupControlPlane(): cmd.lxcStart('router1') cmd.lxcStart('router2') cmd.ovsOpenflowd('dp0', '127.0.0.1', 6633, 'rfovs') cmd.ifconfig('dp0', 'up') cmd.ovsOpenflowd('br0', '127.0.0.1', 6363) cmd.ifconfig('br0', 'up', '192.168.1.1', '255.255.255.0') dp0Interface = ['router1.1', 'router1.2', 'router2.1', 'router2.2'] for interface in dp0Interface: cmd.ovsDpctl('dp0', interface) br0Interface = ['router1.0', 'router2.0'] for interface in br0Interface: cmd.ovsDpctl('br0', interface)
cmd.createDaemons(lxc,topology["nodes"][lxc]["attrs"]["protocol"]) if(topology["nodes"][lxc]["attrs"]["protocol"]=="rip"): cmd.createRipd(lxc,vmInterfaceList,vmInterfaceDict) elif(topology["nodes"][lxc]["attrs"]["protocol"]=="ospf"): cmd.createOspf(lxc,vmInterfaceList,vmInterfaceDict,address) address+=1 #else #start rf cmd.startNox("switch","6363") cmd.startNox("routeflowc","6666") cmd.startRf() for lxc in lxcList: cmd.lxcStart(lxc) cmd.ovsOpenflowd('dp0', '127.0.0.1', 6666, 'rfovs') cmd.ifconfig('dp0', 'up') cmd.ovsOpenflowd('br0', '127.0.0.1', 6363) cmd.ifconfig('br0', 'up', '192.168.1.1', '255.255.255.0') for lxc in lxcList: vmInterfaceList=topology["nodes"][lxc]["interface"].keys() for vmInterface in vmInterfaceList: cmd.ovsDpctl("dp0",vmInterface) for lxc in lxcList: cmd.ovsDpctl("br0",lxc+".0")