Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. sudo mn --topo=single,3 --controller=none --mac
  2.  
  3. sh sudo ovsdb-client listdbs
  4.  
  5. sh ovs-ofctl add-flow s1 action=normal
  6.  
  7. sh ovs-ofctl dump-flows s1
  8.  
  9. sh ovs-ofctl del-flows s1
  10.  
  11. sh ovs-ofctl add-flow s1 priority=500,in_port=2,actions=output:1
  12.  
  13. sh ovs-ofctl add-flow s1 priority=32768,in_port=2,actions=drop:1
  14.  
  15. sh ovs-ofctl add-flow s1 dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,actions=output:2
  16. sh ovs-ofctl add-flow s1 dl_src=00:00:00:00:00:02,dl_dst=00:00:00:00:00:01,actions=output:1
  17.  
  18. sh ovs-ofctl add-flow s1 dl_type=0x806,actions=flood
  19.  
  20. sh ovs-ofctl add-flow s1 dl_type=0x800,priority=500,nw_src=10.0.0.0/24,nw_dst=10.0.0.0/24,actions=normal
  21.  
  22. sh ovs-ofctl add-flow s1 priority=800,ip,nw_src=10.0.0.3,actions=mod_nw_tos:184,normal
  23.  
  24. sh ovs-ofctl add-flow s1 dl_type=0x806,nw_dst=10.0.0.1,actions=output:1
  25. sh ovs-ofctl add-flow s1 dl_type=0x806,nw_dst=10.0.0.2,actions=output:2
  26. sh ovs-ofctl add-flow s1 dl_type=0x806,nw_dst=10.0.0.3,actions=output:3
  27.  
  28. h3 python -m SimpleHTTPServer 80 &
  29.  
  30. sh ovs-ofctl add-flow s1 priority=500,dl_type=0x800,nw_proto=6,tp_dst=80,actions=output:3
  31.  
  32. sh ovs-ofctl add-flow s1 priority=500,ip,nw_src=10.0.0.3,nw_dst=10.0.0.1,actions=output:1
  33. sh ovs-ofctl add-flow s1 priority=500,ip,nw_src=10.0.0.3,nw_dst=10.0.0.2,actions=output:2
  34.  
  35. h1 route add default gw 10.0.0.254 h1-eth0
  36. h1 arp -s 10.0.0.254 00:00:00:00:11:11
  37. h2 route add default gw 10.0.0.254 h2-eth0
  38. h2 arp -s 10.0.0.254 00:00:00:00:11:11
  39. h3 route add default gw 10.0.0.254 h3-eth0
  40. h3 arp -s 10.0.0.254 00:00:00:00:11:11
  41.  
  42. h3 ifconfig h3-eth0 30.0.0.3 netmask 255.255.255.0
  43.  
  44.  
  45. ========= ZADANIE 5 ==========
  46.  
  47.  
  48.  
  49. table=0,ip,nw_src=10.0.0.0/24,nw_dst=10.0.0.0/24,actions=resubmit(,1)
  50. table=0,dl_type=0x806,nw_src=10.0.0.0/24,nw_dst=10.0.0.0/24,actions=resubmit(,1)
  51. table=0,dl_type=0x806,nw_src=10.0.0.1,nw_dst=30.0.0.3,actions=resubmit(,1)
  52. table=0,dl_type=0x800,nw_proto=6,tp_dst=80,nw_src=10.0.0.1,nw_dst=30.0.0.3,actions=resubmit(,1)
  53. table=0,nw_dst=30.0.0.3,actions=resubmit(,1)
  54. table=0,actions=drop
  55.  
  56. table=1,ip,nw_src=10.0.0.1,nw_dst=30.0.0.3,actions=mod_nw_src=5.5.5.5,resubmit(,2)
  57. table=1,ip,nw_src=30.0.0.3,nw_dst=5.5.5.5,actions=mod_nw_dst=10.0.0.1,resubmit(,2)
  58. table=1,actions=resubmit(,2)
  59.  
  60. table=2,dl_type=0x806,nw_src=10.0.0.2,nw_dst=10.0.0.1,actions=output:1
  61. table=2,dl_type=0x806,nw_src=10.0.0.1,nw_dst=10.0.0.2,actions=output:2
  62. table=2,ip,nw_dst=10.0.0.1,actions=output:1
  63. table=2,ip,nw_dst=10.0.0.2,actions=output:2
  64. table=2,ip,nw_dst=30.0.0.3,actions=output:3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement