@@ -27,7 +27,7 @@ function del_routers {
2727}
2828
2929function router_add_port_as_gateway { # $3 network number #$4 bridge name
30- polycubectl router $1 ports add to_$2 ip=10.0.$3 .254 netmask=255.255.255.0
30+ polycubectl router $1 ports add to_$2 ip=10.0.$3 .254/24
3131 if [[ $# -eq 4 ]] ; then
3232 polycubectl simplebridge $4 ports add to_$1
3333 polycubectl connect $4 :to_$1 $1 :to_$4
@@ -38,30 +38,30 @@ function router_add_port_as_gateway { #$3 network number #$4 bridge name
3838
3939}
4040
41- function router_add_port { # $3 ip $4 netmask
42- polycubectl router $1 ports add $2 ip=$3 netmask= $4
41+ function router_add_port { # $3 ip
42+ polycubectl router $1 ports add $2 ip=$3
4343}
4444
4545function connect_router_p_to_p { # $1 router name 1, $2 router name 2, $3 network point to point connection
46- polycubectl router $1 ports add to_$2 ip=10.$3 .0.1 netmask=255.255.255.252
47- polycubectl router $2 ports add to_$1 ip=10.$3 .0.2 netmask=255.255.255.252
46+ polycubectl router $1 ports add to_$2 ip=10.$3 .0.1/30
47+ polycubectl router $2 ports add to_$1 ip=10.$3 .0.2/30
4848 polycubectl connect $1 :to_$2 $2 :to_$1
4949}
5050
5151function connect_router_secondary_p_to_p { # $1 router name 1, $2 router name 2, $3 network point to point connection
52- polycubectl router $1 ports to_$2 secondaryip add 10.$3 .0.1 255.255.255.252
53- polycubectl router $2 ports to_$1 secondaryip add 10.$3 .0.2 255.255.255.252
52+ polycubectl router $1 ports to_$2 secondaryip add 10.$3 .0.1/30
53+ polycubectl router $2 ports to_$1 secondaryip add 10.$3 .0.2/30
5454 polycubectl connect $1 :to_$2 $2 :to_$1
5555}
5656
5757
5858
5959function router_add_secondary {
60- polycubectl router $1 ports to_$2 secondaryip add $3 $4
60+ polycubectl router $1 ports to_$2 secondaryip add $3
6161}
6262
6363function router_add_secondary_as_gateway {
64- polycubectl router $1 ports to_$2 secondaryip add 10.0.$3 .254 255.255.255.0
64+ polycubectl router $1 ports to_$2 secondaryip add 10.0.$3 .254/24
6565 if [[ $# -eq 4 ]] ; then
6666 polycubectl simplebridge $4 ports add to_$1
6767 polycubectl connect $4 :to_$1 $1 :to_$4
@@ -72,10 +72,10 @@ polycubectl router $1 ports to_$2 secondaryip add 10.0.$3.254 255.255.255.0
7272
7373function router_add_route {
7474
75- if [[ $# -eq 5 ]] ; then
76- polycubectl router $1 route add $2 $3 $4 pathcost=$5
75+ if [[ $# -eq 4 ]] ; then
76+ polycubectl router $1 route add $2 $3 pathcost=$4
7777 else
78- polycubectl router $1 route add $2 $3 $4
78+ polycubectl router $1 route add $2 $3
7979 fi
8080
8181}
0 commit comments