Changes

From CDOT Wiki
Jump to: navigation, search

Virtual-Lan

286 bytes removed, 19:48, 30 September 2018
m
Updating to non-deprecated commands
* Adding routes to each student's "opsnet" virtual network manually or by running the following bash script on the host OS:
#!/bin/bash
ip route add -net 192.168.1.0 netmask 255.255.255.0 gw /24 via 172.16.1.1 ip route add -net 192.168.2.0 netmask 255.255.255.0 gw /24 via 172.16.2.1 ip route add -net 192.168.3.0 netmask 255.255.255.0 gw /24 via 172.16.3.1 ip route add -net 192.168.4.0 netmask 255.255.255.0 gw /24 via 172.16.4.1
...
ip route add -net 192.168.36.0 netmask 255.255.255.0 gw /24 via 172.16.36.1
or:
if [ ${count} != ${x} ]
then
ip route add -net 192.168.${count}.0 netmask 255.255.255.0 gw /24 via 172.16.${count}.1
fi
count=$(expr ${count} + 1)
#!/bin/bash
x=10 # my network id
ip route add -net 192.168.1.0 netmask 255.255.255.0 gw /24 via 192.168.${x}.1 ip route add -net 192.168.2.0 netmask 255.255.255.0 gw /24 via 192.168.${x}.1 ip route add -net 192.168.3.0 netmask 255.255.255.0 gw /24 via 192.168.${x}.1 ip route add -net 192.168.4.0 netmask 255.255.255.0 gw /24 via 192.168.${x}.1
...
ip route add -net 192.168.36.0 netmask 255.255.255.0 gw /24 via 192.168.${x}.1 ip route add -net 172.16.0.0 netmask 255.255.0.0 gw /16 via 192.168.${x}.1
or:
if [ ${count} != ${x} ]
then
ip route add -net 192.168.${count}1.0 netmask 255.255.255.0 gw /24 via 192.168.${x}.1
fi
count=$(expr ${count} + 1)
done
ip route add -net 172.16.0.0 netmask 255.255.0.0 gw /16 via 192.168.${x}.1 
* To test your static routes, pair up with a few fellow students and try to ping their VMs in their "opsnet".
361
edits

Navigation menu