blob: 930cd3752f7acce9f22f0ae79b4ac60ffd2d0be7 [file] [log] [blame]
Thomas Vachuska3f06e082014-11-21 11:58:23 -08001#!/usr/bin/python
2
3import sys
4
5from mininet.net import Mininet
6from mininet.cli import CLI
7from mininet.log import setLogLevel
8from mininet.node import RemoteController
9from mininet.link import TCLink
10
11from attmpls import AttMplsTopo
12
13setLogLevel( 'info' )
14
15def run(controllers=[ '127.0.0.1' ]):
16 net = Mininet( topo=AttMplsTopo(), link=TCLink, build=False, autoSetMacs=True )
17 ctrl_count = 0
18 for controllerIP in controllers:
19 net.addController( 'c%d' % ctrl_count, RemoteController, ip=controllerIP )
20 net.build()
21 net.start()
22 CLI( net )
23 net.stop()
24
25if __name__ == '__main__':
26 if len( sys.argv ) > 1:
27 controllers = sys.argv[ 1: ]
28 else:
29 print 'Usage: att-onos.py <c0 IP> <c1 IP> ...'
30 exit( 1 )
31 run( controllers )