当floodlightdefault.properties配置文件中加载了转发模块(net.floodlightcontroller.forwarding.Forwarding).则连接在交换机上的PC机是可以互相ping通的.floodlight中没有加载此模块时,须要用使添加流表来控制流向.下面介绍一下从控制器端对openflow交换机添加与删除流表.
添加流表:
[controller@host ]# curl -d '{"switch": "00:00:00:00:00:00:00:01", "name":"flow-mod-1", "cookie":"0", "priority":"2232", "ingress-port":"1","active":"true", "actions":"output=2"}' http://:8080/wm/staticflowentrypusher/json
[controller@host ]# curl -d '{"switch": "00:00:00:00:00:00:00:01", "name":"flow-mod-2", "cookie":"0", "priority":"2232", "ingress-port":"2","active":"true", "actions":"output=1"}' http://:8080/wm/staticflowentrypusher/json
这两条流表为1号端口的流向2号接口,2号端口的流向1号接口.
连接在这两个接口上的PC机可以互相通信.
可变参数