On 28/gen/2010, at 23.40, LJ wrote: > I have just made an example on how to automate the process > of getting all the config files dynamips ready. I tested it and it > works as I thought (tested on my mabook). > See attachments.
I have made a script too, some parts are cut&paste found on forums, HTH (see attachment).
ipxlabfix
Description: Binary data
I'm doing Vol1 labs so before each lab I'm adding lines to the script to make
it change the configs correctly.
Usage:
1) apply script to config files
2) start cat and create vlans on catalyst/nm-16 modules (see below)
3) start routers
4) verify connectivity
*NOTE
vlan numbering on catalys/nm16 modules are modified due to config limitations
on nm16.
*** IPX2DYN CONFIG ***
sed -i 's/half-duplex/duplex full/' *
sed -i 's/duplex auto/full-duplex/' *
sed -i 's/speed auto/speed 100/' *
sed -i 's/frame-relay lmi-type cisco/frame-relay lmi-type ansi/' R*.txt
sed -i 's/FastEthernet0/FastEthernet1/' Cat*.txt
sed -i '/interface FastEthernet1\/9/d' Cat1*
sed -i 's/interface FastEthernet1\/11/interface FastEthernet1\/9/' Cat1*
sed -i 's/interface FastEthernet1\/12/interface FastEthernet1\/2/' Cat2*
sed -i 's/interface FastEthernet1\/13/interface FastEthernet1\/3/' Cat2*
sed -i 's/switchport mode trunk/switchport mode dynamic desirable/' Cat*.txt
sed -i 's/2200/22/' Cat*.txt
sed -i 's/2300/23/' Cat*.txt
sed -i 's/2567/25/' Cat*.txt
sed -i 's/3434/34/' Cat*.txt
sed -i 's/no ip http server/ip http server/' *
sed -i 's/ip http server/no ip http server/' *
sed -i 's/no ip http secure-server/ip http secure-server/' *
sed -i 's/ip http secure-server/no ip http secure-server/' *
sed -i '/password 7/d' *
sed -i '/enable secret/d' *
sed -i '/^!/d' *
sed -i '/^banner motd/d' *
sed -i '/^sh run/d' *
sed -i '/^Building configuration/d' *
sed -i '/^Current configuration/d' *
sed -i '/^$/d' *
sed -i '/^R\S#/d' R*
sed -i '/^Cat\S*#/d' Cat*
sed -i '/^scheduler/d' *
sed -i '/^interface GigabitEthernet0/d' Cat*
sed -i '/^interface FastEthernet1\/16/d' Cat*
sed -i '/^interface FastEthernet1\/17/d' Cat*
sed -i '/^interface FastEthernet1\/18/d' Cat*
sed -i '/^interface FastEthernet1\/19/d' Cat*
sed -i '/^interface FastEthernet1\/20/d' Cat*
sed -i '/^interface FastEthernet1\/21/d' Cat*
sed -i '/^interface FastEthernet1\/22/d' Cat*
sed -i '/^interface FastEthernet1\/23/d' Cat*
sed -i '/^interface FastEthernet1\/24/d' Cat*
sed -i '$!N; /^\(.*\)\n\1$/!P; D' Cat*
sed -i 's/Serial0\/2\/0/Serial2\/0/' R9.txt
sed -i 's/Serial0\/2\/1/Serial2\/1/' R9.txt
sed -i 's/Serial0\/2\/0/Serial2\/0/' R6.txt
sed -i 's/Serial0\/2\/1/Serial2\/1/' R6.txt
sed -i 's/Serial0\/0\/0/Serial0\/0/' R*.txt
sed -i 's/Serial0\/1\/0/Serial0\/1/' R*.txt
sed -i 's/Serial0\/2\/0/Serial0\/2/' R*.txt
sed -i 's/Serial0\/3\/0/Serial0\/3/' R*.txt
*** TO RUN ON CAT ***
ena
conf t
vtp file nvram:/vlan.dat
inte range f1/0 - 15
speed 100
dup full
end
ena
vlan database
vlan 12
vlan 15
vlan 64
vlan 98
vlan 7
vlan 721
vlan 40
vlan 100
vlan 200
vlan 240
vlan 300
vlan 567
vlan 240
vlan 22
vlan 75
vlan 23
vlan 25
vlan 34
apply
exit
conf t
interface range fa1/10 - 15
description TRUNK_SWITCHES
switchport mode trunk
end
Gian Paolo
www.ifconfig.it_______________________________________________ For more information regarding industry leading CCIE Lab training, please visit www.ipexpert.com
