Search code examples
socketsmininetopenflowopenvswitch

ovs-ofctl doen not work - connection refused


I am following openflow tutorial on openflow tutorial. I am using mininet and ryu controller and openvswitch version 2.8.0. When I try to use command:

sudo ovs-ofctl show s1

It gives error as below:

asd@asd:~/ryu/ryu/mpls$ sudo ovs-ofctl show s1

ovs-ofctl: /var/run/openvswitch/s1.mgmt: failed to open socket (Connection refused)

As I am using sudo, I think there should not be any problem regarding permissions for opening socket connection. Not sure what is causing this error. Help is appreciated.


Solution

  • The error message is saying that ovs-vswitchd did not open the Unix socket expected at /var/run/openvswitch/s1.mgmt. This usually means that ovs-vswitchd (the daemon process for Open vSwitch) is not running.

    You can check that by running:

    $ ps aux | grep ovs-vswitchd
    root      77289  0.0  0.0  25632  4916 ?        Ss   16:05   0:00 ovsdb-server --remote=punix:/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,manager_options --private-key=db:Open_vSwitch,SSL,private_key --certificate=db:Open_vSwitch,SSL,certificate --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert --log-file=/var/log/openvswitch/ovs-vswitchd.log -vsyslog:info -vfile:info --pidfile --detach
    root      77295  100  0.2 2608140 45820 ?       Ssl  16:05   3:13 ovs-vswitchd unix:/var/run/openvswitch/db.sock --pidfile --detach --log-file=/var/log/openvswitch/ovs-vswitchd.log -vfile:info
    paul      77447  0.0  0.0  14228   968 pts/2    S+   16:08   0:00 grep --color=auto ovs-vswitchd
    

    The first process, ovsdb-server, answers to OVSDB queries. The second process, ovs-vswitchd, answers to OpenFlow queries and processes packets.