Commit 955cf7cf authored by root's avatar root
Browse files

Main issue with length of variable *NUM* if the value is greater than 1 was solved

parent beea7935
......@@ -5,6 +5,14 @@
# Vlozit cislo pro ID routeru
# echo "Router ID"
nr=0
# Issue when the length of var *NUM* is greater than 1
if (( ${#NUM} == 1 )); then
var1="$NUM$nr"
elif (( ${#NUM} > 1 )); then
var1="$NUM"
fi
#echo "192.168.$NUM.1"
#echo "192.168.$((NUM-1)).1"
#echo 192.168."$NUM$nr".1
......@@ -38,17 +46,17 @@ protocol kernel kernel6 {
protocol static static4 {
ipv4;
# Editovat promenne v *route*
route 10."$NUM$nr".0.0/24 via 192.168.$NUM.2;
# route 10."$num0".1.0/24 via 192.168.$num.$num;
# route 10."$num0".0.0/24 via 192.168.$num.$num;
route 10."$var1".0.0/24 via 192.168.$NUM.2;
# route 10."$var1".0.0/24 via 192.168.$NUM.$NUM;
# route 10."$var1".0.0/24 via 192.168.$NUM.$NUM;
}
protocol static static6 {
ipv6;
# Editovat promenne v *route*
route 2001:db8:"$NUM$nr":10::/64 via 2001:db8:$NUM:1::10;
# route 2001:db8:50:2::/64 via 2001:db8:$num:1::10;
# route 2001:db8:50:10::/64 via 2001:db8:$num:1::10;
route 2001:db8:"$var1":10::/64 via 2001:db8:$NUM:1::10;
# route 2001:db8:50:2::/64 via 2001:db8:$NUM:1::10;
# route 2001:db8:50:10::/64 via 2001:db8:$NUM:1::10;
}
protocol ospf v3 ospf4 {
......
......@@ -25,7 +25,12 @@ for ((i=2;i<=number_devs;i++)); do
NETLAB_NODES="$NETLAB_NODES m$i"
# Init part
# Issue with higher len of *m* than 1
if (( ${#NUM} == 1 )); then
DUMMY=$DUMMY"if_dummy \$m$i ve0 192.168.$i 2001:db8:"0$i":1"$'\n'
elif (( ${#NUM} > 1 )); then
DUMMY=$DUMMY"if_dummy \$m$i ve0 192.168.$i 2001:db8:"$i":1"$'\n'
fi
# veth part
if (( $i < $number_devs )); then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment