Exception: Could not find a default OpenFlow controller in Mininet

If you try to run a mininet script like this , maybe you will get this problem if you are under Ubuntu.

Exception: Could not find a default OpenFlow controller 

This is trigger because your system don't find a default controller .
To enable it just add the first line and add the controller argument to net variable like the second line:

from mininet.node import OVSController
net = Mininet(topo=topo,host=CPULimitedHost, link=TCLink,controller = OVSController)

Now, you will get the following error:

c0 Cannot find required executable ovs-controller.
Please make sure that it is installed and available in your $PATH:

ovs-controller is a legacy name. You need to be sure that you has it.

sudo apt-get install openvswitch-testcontroller
sudo cp /usr/bin/ovs-testcontroller /usr/bin/ovs-controller

If you run it again, you should kill ovs-testcontroller first to avoid this:

Exception: Please shut down the controller which is running on port 6653:
Active Internet connections (servers and established)
tcp        0      0  *               LISTEN      30215/ovs-testcontr

Now, you can run your code without problems

Enjoy it!


  1. I was having exactly the same problem in debian(Kali linux)....it got resolved. Thanks !!

  2. Yup, same problem here as well. Many thanks for the solution & great blog :D

  3. Thanks for the post. In my case (Ubuntu 16.04), I didn't have to kill the ovs-testcontroller. Somehow it worked after the copying step.


Post a Comment

Popular posts from this blog

How to fix Android when developer options are not available for this user

from: can't read /var/mail/ in Python scripts

How to fix VirtualBox error when you try to import an ova file