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.
6 Written by: Felix Tejada & Oscar Rodriguez
8 echo "Setting address to the routers..."
10 curl -X POST -d '{"address":"172.16.10.1/24"}' http://localhost:8080/router/0000000000000002
12 curl -X POST -d '{"address": "172.16.30.1/24"}' http://localhost:8080/router/0000000000000002
14 curl -X POST -d '{"address": "192.168.10.1/24"}' http://localhost:8080/router/0000000000000002
16 curl -X POST -d '{"address":"172.16.20.1/24"}' http://localhost:8080/router/0000000000000001
18 curl -X POST -d '{"address": "172.16.30.30/24"}' http://localhost:8080/router/0000000000000001
20 curl -X POST -d '{"address": "192.168.30.1/24"}' http://localhost:8080/router/0000000000000003
22 curl -X POST -d '{"address": "192.168.10.20/24"}' http://localhost:8080/router/0000000000000003
24 #Setting default routes
25 echo "Setting default routes..."
27 curl -X POST -d '{"gateway": "172.16.30.1"}' http://localhost:8080/router/0000000000000001
29 curl -X POST -d '{"gateway": "172.16.30.30"}' http://localhost:8080/router/0000000000000002
31 curl -X POST -d '{"gateway": "192.168.10.1"}' http://localhost:8080/router/0000000000000003
33 #Setting static routes
34 echo "Setting a static route to the router 2"
36 curl -X POST -d '{"destination": "192.168.30.0/24", "gateway": "192.168.10.20"}' http://localhost:8080/router/0000000000000002