Skip to content

Instantly share code, notes, and snippets.

@hwchiu
Last active August 29, 2015 13:56
Show Gist options
  • Save hwchiu/9062966 to your computer and use it in GitHub Desktop.
Save hwchiu/9062966 to your computer and use it in GitHub Desktop.
Openflow Controller redirect icmp
  1. Controller:sudo java -jar target/floodlight.jar

  2. Mininet:sudo mn --mac --controller=remote,ip=127.0.0.1 --topo tree,2

  3. Controller:curl -d '{"switch": "00:00:00:00:00:00:00:02", "name":"flow-mod-1", "priority":"32768", "ingress-port":"1" , "src-mac":"00:00:00:00:00:01", "dst-mac":"00:00:00:00:00:02", "active":"true","actions":"set-dst-ip=10.0.0.4,set-dst-mac=00:00:00:00:00:04,output=3"}' http://127.0.0.1:8080/wm/staticflowentrypusher/json

  4. Mininet:h1 ping h2

Result:
mininet> h1 ping h2
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.4: icmp_req=1 ttl=64 time=24.0 ms
64 bytes from 10.0.0.4: icmp_req=2 ttl=64 time=0.255 ms
64 bytes from 10.0.0.4: icmp_req=3 ttl=64 time=0.033 ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment