Changes

Jump to: navigation, search

VLS2VLS-Routing

769 bytes removed, 13:00, 22 March 2021
Shell Script for adding custom routes on your gateway to other's VLSs
export MY_VLS_NO=2
</pre>
* set the shell variable OTHER_VLS_NOS to the list of VLS you want to have a route to their VLS network. The following example assign the list of network numbers 32, 33, 34, 35, 41, 42, and 1 to 43 that you want to create a custom route on your gateway:
<pre>
export OTHER_VLS_NOS="32 33 34 35 41 42 `seq 1 43"`
</pre>
* If you want to add a route for each VLS network in the virtual lab, you need:<pre>export OTHER_VLS_NOS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2324 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43"</pre>The following Bash script to add 7 42 new custom routes to your gateway VM's routing table:
<pre>
#! /bin/bash
X=${MY_VLS_NO}
echo "Your Network Number is $X"
if [ -z "$OTHER_VLS_NOS" ]then echo "Please run the following command to assign the list of " >&2 echo "private VLS Networks you want to add a route on your gateway " >&2 echo "to the shell variable OTHER_VLS_NOS and run this script again." >&2 echo "The following command assign 32, 33, 34, 35, 41, 42, and 43" >&2 echo "to the variable OTHER_VLS_NOS. Please replace those number" >&2 echo "with the ones you actually wanted." >&2 echo " export OTHER_VLS_NOS=\"32 33 34 35 41 42 43\"" >&2 exit 2fiY=`echo ${OTHER_VLS_NOS}`
echo "Route to be added for the network number(s) $Y"
echo -n "Press ENTER to continue ... "
if [ "$X" -ne "$y" ]
then
nmcli con modify ens192 +ipv4.routes "192.168.${y}.0 /24 172.20.${y}.1 100"
echo "Adding route to 192.168.${y}.0 network."
fi
1,760
edits

Navigation menu