| 243 | As our last exercise, instead of diverging the traffic to a different server running on the same host, we will diverge the traffic to a server running on a different host and on a different port. |
| 244 | |
| 245 | Under the `ext` directory there are two files Proxy.py and myProxy.py that are similar like the previous exercise. Both of these controllers are configured by a configuration file at `ext/proxy.config`. |
| 246 | |
| 247 | 1. On the terminal of `host3` run a netcat server: |
| 248 | {{{ |
| 249 | nc -l 7000 |
| 250 | }}} |
| 251 | 2. On your OVS host open the server_deflection.py file, and edit it to implement a controller that will diverge traffic destined for `host2` to `host3`. Before you start implementing think about what are the side effects of diverging traffic to a different host. |
| 252 | * Is it enough to just change the IP address? |
| 253 | * Is it enough to just modify the TCP packets? |
| 254 | If you want to see the solution, its in file server_deflection_sol.py file. |
| 255 | 3. To test your controller run: |
| 256 | {{{ |
| 257 | ./pox.py --verbose myProxy.py |
| 258 | }}} |
| 259 | 6. Go back to the terminal of `host1` and try to connect to `host2` port 5000 |
| 260 | {{{ |
| 261 | nc 10.10.1.2 5000 |
| 262 | }}} |
| 263 | If your controller works correctly you should see your text showing up on the terminal of `host3`. |