我是 mininet 新手,正在尝试弄清楚它。我正在尝试使用遥控器,并正在检查如何操作 https://github.com/mininet/mininet/wiki/Introduction-to-Mininet 。这是我的迷你网代码:
#!/usr/bin/python
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.cli import CLI
from mininet.link import TCLink
from mininet.log import setLogLevel, info
from functools import partial
from mininet.node import Controller, OVSKernelSwitch, RemoteController
class Topo1( Topo ):
def __init__( self ):
# Initialize topology
Topo.__init__( self )
# Add hosts and switches
h1 = self.addHost( 'h1' )
h2 = self.addHost( 'h2' )
h3 = self.addHost( 'h3' )
s1 = self.addSwitch( 's1' )
s2 = self.addSwitch( 's2' )
s3 = self.addSwitch( 's3' )
# Add links
self.addLink( h1, s1 )
self.addLink( h2, s1 )
self.addLink( s1, s2 )
self.addLink( s2, s3 )
self.addLink( h3, s3 )
def main():
setLogLevel( 'info' )
topo = Topo1()
net = Mininet(topo=topo, link=TCLink, controller=None)
net.addController( 'c0', controller=RemoteController, ip='127.0.0.1', port=6633 )
net.start()
CLI(net)
net.stop()
if __name__ == '__main__':
main()
当我尝试使用命令运行我的脚本时
sudo python script.py
我得到这样的信息:
*** Creating network
*** Adding hosts:
h1 h2 h3
*** Adding switches:
s1 s2 s3
*** Adding links:
(h1, s1) (h2, s1) (h3, s3) (s1, s2) (s2, s3)
*** Configuring hosts
h1 h2 h3
Unable to contact the remote controller at 127.0.0.1:6633
*** Starting controller
c0
*** Starting 3 switches
s1 s2 s3 ...
*** Starting CLI:
mininet>
我做错了什么?
你找到解决办法了吗? 很抱歉将其发布为答案,如您所见,我有 1 声誉,所以我无法发表评论 我遇到了同样的问题,我想再次发布该问题将违反该平台的规则,对吗?