I am new to mininet and trying to figure it out. I am trying to use a remote controller and was checking how to do on https://github.com/mininet/mininet/wiki/Introduction-to-Mininet . Here is my mininet code:
#!/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()
When I try to run my scrip with command sudo python script.py
I get like this:
*** 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>
What am I doing wrong?