Update and rename MantenerFIFO to MantenerFIFO.md
[vsorcdistro/.git] / scripts / routerflows.sh
1 #!/bin/bash
2 : '
3 Este script hace peticiones HTTP POST a la API REST del codigo que debe estar corriendo
4 en el controlador,llamado rest_router.py.
5
6 Written by: Felix Tejada & Oscar Rodriguez
7 '
8 echo "Setting address to the routers..."
9 echo
10 curl -X POST -d '{"address":"172.16.10.1/24"}' http://localhost:8080/router/0000000000000002
11 echo
12 curl -X POST -d '{"address": "172.16.30.1/24"}' http://localhost:8080/router/0000000000000002
13 echo
14 curl -X POST -d '{"address": "192.168.10.1/24"}' http://localhost:8080/router/0000000000000002
15 echo
16 curl -X POST -d '{"address":"172.16.20.1/24"}' http://localhost:8080/router/0000000000000001
17 echo
18 curl -X POST -d '{"address": "172.16.30.30/24"}' http://localhost:8080/router/0000000000000001
19 echo
20 curl -X POST -d '{"address": "192.168.30.1/24"}' http://localhost:8080/router/0000000000000003
21 echo
22 curl -X POST -d '{"address": "192.168.10.20/24"}' http://localhost:8080/router/0000000000000003
23 echo
24 #Setting default routes
25 echo "Setting default routes..."
26 echo
27 curl -X POST -d '{"gateway": "172.16.30.1"}' http://localhost:8080/router/0000000000000001
28 echo
29 curl -X POST -d '{"gateway": "172.16.30.30"}' http://localhost:8080/router/0000000000000002
30 echo
31 curl -X POST -d '{"gateway": "192.168.10.1"}' http://localhost:8080/router/0000000000000003
32 echo
33 #Setting static routes
34 echo "Setting a static route to the router 2"
35 echo
36 curl -X POST -d '{"destination": "192.168.30.0/24", "gateway": "192.168.10.20"}' http://localhost:8080/router/0000000000000002
37 echo
38 echo "Done"