I have a virtual network like this:
The switch is an Open VSwitch and the whole network is controlled by the Big Switch Floodlight controller.
I am trying to set two flows to switch1:
1) Capture any packet from h1 to h2 and change their dst-IP and dst-MAC -addresses to that of h3.
2) Capture any packet from h3 to h1 and change their src-IP and src-MAC -addresses to that of h2.
(Check bottom of the question for the exact Floodlight REST API requests)
So when I ping h2 from h1 the ping should instead go to h3 and back, but so far I haven't been succesful.
Can this be done? If so, what am I missing? Thanks in advance!
Mininet setup:
sudo mn --topo single,3 --controller remote
Floodlight REST API requests:
Finding IP and MAC addresses and parsing with jq:
curl localhost:8080/wm/device/ | jq '.[]|{mac,ipv4}'
Setting the first flow (Note, if you try this by yourself, MAC addresses may be different):
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
Setting the second flow:
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