我有这样一个虚拟网络:
该交换机是一个Open VSwitch,整个网络由Big Switch Floodlight控制器控制 .
我想设置两个流程到switch1:
1)捕获从h1到h2的任何数据包,并将其dst-IP和dst-MAC -addresses更改为h3 .
2)捕获从h3到h1的任何数据包,并将其src-IP和src-MAC -addresses更改为h2 .
(检查问题的底部是否有确切的Floodlight REST API请求)
因此,当我从h1 ping h2时,ping应该转到h3并返回,但到目前为止我还没有成功 .
可以这样做吗?如果是这样,我错过了什么?提前致谢!
Mininet设置:
sudo mn --topo single,3 --controller remote
Floodlight REST API请求:
查找IP和MAC地址并使用jq解析:
curl localhost:8080/wm/device/ | jq '.[]|{mac,ipv4}'
设置第一个流程(注意,如果您自己尝试,MAC地址可能不同):
curl -d '{"switch": "00:00:00:00:00:00:00:01", "name":"redirection", "src-ip":"10.0.0.1", "dst-ip":"10.0.0.2", "src-mac":"7a:b9:87:ee:d2:b7","dst-mac":"a6:77:bf:8f:c4:db", "ether-type":"0x0800","active":"true","actions":"set-dst-ip=10.0.0.3,set-dst-mac=c2:65:e3:d3:6c:11"}' localhost:8080/wm/staticflowentrypusher/json
设置第二个流程:
curl -d '{"switch": "00:00:00:00:00:00:00:01", "name":"redirection2", "src-ip":"10.0.0.3", "dst-ip":"10.0.0.1", "src-mac":"c2:65:e3:d3:6c:11","dst-mac":"7a:b9:87:ee:d2:b7", "ether-type":"0x0800","active":"true","actions":"set-src-ip=10.0.0.2,set-src-mac=a6:77:bf:8f:c4:db"}' http://localhost:8080/wm/staticflowentrypusher/json