X-Git-Url: https://git.josue.xyz/?p=vsorcdistro%2F.git;a=blobdiff_plain;f=scripts%2Frouterflows.sh;h=b145ba5c5dbb5325aba68c8be34ba2be57a154b3;hp=ed21cbc725040efaf0a53b89edda9307ce093fa7;hb=741ddd9f014681c0f1a5ea3448067f7dafbb2c0c;hpb=ed976c4422af98e88167ca566701fc385fb1b1a8 diff --git a/scripts/routerflows.sh b/scripts/routerflows.sh index ed21cbc..b145ba5 100755 --- a/scripts/routerflows.sh +++ b/scripts/routerflows.sh @@ -1,18 +1,38 @@ #!/bin/bash -#Setting address +: ' +Este script hace peticiones HTTP POST a la API REST del codigo que debe estar corriendo +en el controlador,llamado rest_router.py. + +Written by: Felix Tejada & Oscar Rodriguez +' +echo "Setting address to the routers..." +echo curl -X POST -d '{"address":"172.16.10.1/24"}' http://localhost:8080/router/0000000000000002 +echo curl -X POST -d '{"address": "172.16.30.1/24"}' http://localhost:8080/router/0000000000000002 +echo curl -X POST -d '{"address": "192.168.10.1/24"}' http://localhost:8080/router/0000000000000002 +echo curl -X POST -d '{"address":"172.16.20.1/24"}' http://localhost:8080/router/0000000000000001 +echo curl -X POST -d '{"address": "172.16.30.30/24"}' http://localhost:8080/router/0000000000000001 +echo curl -X POST -d '{"address": "192.168.30.1/24"}' http://localhost:8080/router/0000000000000003 +echo curl -X POST -d '{"address": "192.168.10.20/24"}' http://localhost:8080/router/0000000000000003 - +echo #Setting default routes +echo "Setting default routes..." +echo curl -X POST -d '{"gateway": "172.16.30.1"}' http://localhost:8080/router/0000000000000001 +echo curl -X POST -d '{"gateway": "172.16.30.30"}' http://localhost:8080/router/0000000000000002 +echo curl -X POST -d '{"gateway": "192.168.10.1"}' http://localhost:8080/router/0000000000000003 - +echo #Setting static routes +echo "Setting a static route to the router 2" +echo curl -X POST -d '{"destination": "192.168.30.0/24", "gateway": "192.168.10.20"}' http://localhost:8080/router/0000000000000002 - +echo +echo "Done"