ryu控制器不转发数据包

时间:2016-07-22 15:00:34

标签: python python-2.7 sdn ryu

我试图用ryu和openVswitch创建一个简单的sdn网络,但我的ryu控制器似乎无法正常工作。
我只是试图ping两台主机,但是当我执行命令时 ryu-manager simple_switch_13.py
(这是一个预先构建的脚本)控制器什么都不做,数据包不会被数据路径转发,它甚至不会泛洪它们。

当我停止ryu-manager时,它会给出这个追溯:

  Traceback (most recent call last):
  File "/usr/bin/ryu-manager", line 9, in <module>
load_entry_point('ryu==3.19', 'console_scripts', 'ryu-manager')()
  File "/usr/lib/python2.7/dist-packages/ryu/cmd/manager.py", line 99, in main
hub.joinall(services)
  File "/usr/lib/python2.7/dist-packages/ryu/lib/hub.py", line 89, in joinall
t.wait()
  File "/usr/lib/python2.7/dist-packages/eventlet/greenthread.py", line 175, in wait
return self._exit_event.wait()
  File "/usr/lib/python2.7/dist-packages/eventlet/event.py", line 121, in wait
return hubs.get_hub().switch()
  File "/usr/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line 294, in switch
return self.greenlet.switch()
  File "/usr/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line 346, in run
self.wait(sleep_time)
  File "/usr/lib/python2.7/dist-packages/eventlet/hubs/poll.py", line 85, in wait
presult = self.do_poll(seconds)
  File "/usr/lib/python2.7/dist-packages/eventlet/hubs/epolls.py", line 62, in do_poll
return self.poll.poll(seconds)

我认为问题出在代码中,因为simple_switch_13.py是一个预建的脚本。有谁知道我做错了什么? 您可以找到simple_switch_13.py here的示例。

如果我想念一些话,请问我,谢谢。

1 个答案:

答案 0 :(得分:0)

最后我解决了这个问题,我认为这是我在数据路径配置中遗漏的东西,因为我没有更改代码。如果有人需要,我会在这里发布:

ifconfig eth0 add FC00:1::2/64 up
ifconfig eth1 10.0.0.2/24 up
ifconfig eth2 add FC02:1::2/64 up

/etc/init.d/openvswitch-switch start

ovs-vsctl add-br br1
ovs-vsctl add-port br1 eth1
ovs-vsctl set-controller br1 tcp:10.0.0.1:6633