1. 程式人生 > >用python檔案建立mininet拓撲

用python檔案建立mininet拓撲

topo.py

  1. import os
  2. def mininet():
  3.     print "start"
  4.     MN_CLI = "sudo mn --custom /home/ubuntu/sdn/mininet/mininet/custom/mytopo.py --topo mytopo --mac --controller=remote,ip=115.159.213.122,port=6633"
  5.     body = os.popen(MN_CLI).readlines()
  6.     print body
  7.     return body
  8. mininet()
命令列執行 sudo python topo.py