我在Mininet中更新,我使用CLI命令启动了我的拓扑:" sudo mn",之后,我添加了一些主机和交换机......但我想要保存下次。 我该怎么做? 例: http://i1360.photobucket.com/albums/r653/HKati/Capture%20drsquoeacutecran%202016-04-23%20agrave%2007.08.02_zpsxcmh4u6s.png
答案 0 :(得分:1)
我不确定我是否正确地提出了您的问题,但您可以在脚本中定义拓扑:
示例my_topology.py
from mininet.topo import Topo
class MyTopo( Topo ):
def __init__( self ):
Topo.__init__( self )
# Add hosts and switches
left_host = self.addHost( 'h1' )
right_host = self.addHost( 'h2' )
left_switch = self.addSwitch( 's0' )
right_switch = self.addSwitch( 's2' )
# Add links
self.addLink( leftHost, left_switch, bw=10, delay='10ms', loss=0, max_queue_size=1000 )
self.addLink( left_switch, right_switch, bw=10, delay='10ms', loss=0, max_queue_size=1000 )
self.addLink( right_switch, rightHost, bw=10, delay='10ms', loss=0, max_queue_size=1000 )
topos = { 'mytopo': ( lambda: MyTopo() ) }
然后你可以用
开始mn --custom my_topology.py --topo mytopo --link tc,bw=10,delay=10ms