One of the commands, that I found interesting which I don't think was specifically mentioned in any of the material I've examined so far (but is there for the looking in the config guide) introduced in one of the tasks is the "switchport protected" command. It is basically a cut-down version of private-vlans. The scope of function is switch wide and it basically enables "isolated ports" on the same VLAN - any port or SVI that is not specifically "switchport protected" is basically a promiscuous port.
With the lab exercises, usually initial configurations for LAN switches and Routers are provided which are designed to work on the Proctor Labs equipment and I don't have the same setup which means I need to modify the configs a little.
Below is a pretty simple bash script that uses sed to modify the configs to suit my equipment.
#!/bin/bash
# This script modifies the IPexpert initial configs to match my hardware
# Cat1 + Cat2 = 3750
# Cat3 + Cat4 = 3550
# R1 - R9 = 7200
# BB1 - BB3 = 2611
TEMPFILE="/tmp/rework.sed"
if [ -f $TEMPFILE ]
then
rm $TEMPFILE
fi
# IPexpert's R2 has Gigabit Ethernet Interfaces - our R2 only has FastEthernet
# Comment out the media-type line
if [ -f R2.txt ]
then
sed -e 's/GigabitEthernet0/FastEthernet0/g' \
-e 's/media-type/! media-type/g' \
R2.txt > $TEMPFILE
mv $TEMPFILE R2.txt
fi
# Change the Interface numbers to match with my 3750
# Gi0/2 will eventually become a copper SFP but at present we will map it to Fa1/0/12
if [ -f Cat1.txt ]
then
sed -e 's/FastEthernet0\//FastEthernet1\/0\//g' \
-e 's/GigabitEthernet0\/2/FastEthernet1\/0\/12/g' \
-e 's/GigabitEthernet0\//GigabitEthernet1\/0\//g' \
Cat1.txt > $TEMPFILE
mv $TEMPFILE Cat1.txt
fi
# Change the Interface numbers to match with my 3750
if [ -f Cat2.txt ]
then
sed -e 's/FastEthernet0\//FastEthernet1\/0\//g' \
-e 's/GigabitEthernet0\//GigabitEthernet1\/0\//g' \
Cat2.txt > $TEMPFILE
mv $TEMPFILE Cat2.txt
fi
# Change the Serial Interfaces to match the emulated routers
for R in R*.txt
do
sed -e 's/memory-size/! memory-size/g' \
-e 's/Serial0\/0\/0/Serial2\/0/gI' \
-e 's/Serial0\/1\/0/Serial2\/1/gI' \
-e 's/Serial0\/2\/0/Serial2\/2/gI' \
-e 's/Serial0\/2\/1/Serial2\/3/gI' \
-e 's/S0\/0\/0/Serial2\/0/gI' \
-e 's/S0\/1\/0/Serial2\/1/gI' \
-e 's/S0\/2\/0/Serial2\/2/gI' \
-e 's/S0\/2\/1/Serial2\/3/gI' \
$R > $TEMPFILE
mv $TEMPFILE $R
done
No comments:
Post a Comment