Changes between Version 2 and Version 3 of HowTo/ConfigureOVSStaticRouteMirroringNoController
- Timestamp:
- 06/19/17 10:29:30 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
HowTo/ConfigureOVSStaticRouteMirroringNoController
v2 v3 25 25 We want our switch to act without a seperate controller thus setting it to operate as standalone. 26 26 27 {{{ 27 28 sudo ovs-vsctl set-fail-mode br0 standalone 29 }}} 28 30 29 31 Trust but verify. You can verify your OVS settings by issuing the following: 30 32 33 {{{ 31 34 sudo ovs-vsctl show 32 35 }}} 33 36 == Testing the connectivity between host1, host2 and host3 == 34 37 35 38 Initially the OVSwitch is setup to act like an L2 learning switch. We want to disable this behavior 36 39 except for specific IP addresses 37 40 {{{ 38 41 sudo ovs-ofctl del-flows br0 39 42 }}} 40 43 From host1 44 {{{ 41 45 ping -c 10 host2 42 46 }}} 43 47 From host2 48 {{{ 44 49 ping -c 10 host1 45 50 }}} 46 51 From host3 52 {{{ 47 53 ping -c 10 host2 48 54 }}} 49 55 Each of these should be unreachable. 50 56 … … 56 62 First we will add rules to allow the OVS switch to behave like a normal switch for IP traffic between 57 63 the two hosts 58 64 {{{ 59 65 sudo ovs-ofctl add-flow br0 priority=500,ip,nw_src=10.10.1.1,nw_dst=10.10.1.2,actions=normal 60 66 sudo ovs-ofctl add-flow br0 priority=500,ip,nw_src=10.10.1.2,nw_dst=10.10.1.1,actions=normal 61 67 }}} 62 68 ARP traffic will also need to be able to flow in order for the routes to each host to be learned. 63 69 {{{ 64 70 sudo ovs-ofctl add-flow br0 "priority=500,arp,nw_dst=10.10.1.1 actions=normal" 65 71 sudo ovs-ofctl add-flow br0 "priority=500,arp,nw_dst=10.10.1.2 actions=normal" 66 72 }}} 67 73 The connectivity can then be tested with: 68 74 69 75 From host1 76 {{{ 70 77 ping -c 10 host2 71 78 }}} 72 79 From host2 80 {{{ 73 81 ping -c 10 host1 74 82 }}} 75 83 From host3 84 {{{ 76 85 ping -c 10 host2 77 86 }}} 78 87 Pings between host1 and host2 should succeed whereas pings from host3 will fail. 79 88 … … 84 93 independent of the previous steps if only mirroring is of interest 85 94 to the user. 86 95 {{{ 87 96 ovs-vsctl -- set Bridge br0 mirrors=@m \ 88 97 -- --id=@ethX get Port ethX \ … … 90 99 -- --id=@ethZ get Port ethZ \ 91 100 -- --id=@m create Mirror name=mymirror select-dst-port=@ethX,@ethY select-src-port=@ethX,@ethY output-port=@ethZ 92 101 }}} 93 102 Where ethX and ethY are the names of the interfaces connected to host1 and host2 on the OVS node. 94 103 ethZ is the interface on the OVS node that connects to host3 … … 100 109 101 110 In one terminal ssh into host1 and execute 102 111 {{{ 103 112 nc -ul 24565 104 113 }}} 105 114 In one terminal ssh into host2 and execute 106 115 {{{ 107 116 nc -u host1 24565 108 117 }}} 109 118 110 119 In one terminal ssh into host3 and execute 111 120 {{{ 112 121 sudo tcpdump -i eth1 -vv -X 113 122 }}} 114 123 In the terminal with host2 type a message and hit return 115 124 {{{ 116 125 A message 117 126 }}} 118 127 Observe that the message is received on host1. On host3 the packet was also 119 128 received and we can observe the message "A message" inside of the packet.