Loading all initial configs to the router & fast config swapping...

I am using R&S WB5, WEB-IOU and the official initial configurations.  As WB5 allows you to start any task independantly (i.e. not having to complete the previous tasks for it to work), you can end up copying/loading configs a lot in one study session.  A lot of time messing around that could be used better... i.e. studying!!

I was tired of this and created a TCL script that goes off to download EVERY initial config for all tasks to the router in one go.

You can then select the lab of your choice by using the following command as an example (thanks to Brian for this!):

# config replace unix:basic.bgp.routing.cfg

This means that you can swap out all configs on all routers very, very quickly.  No need to shutdown/reload etc

Also, if you make a mess of your lab, just issue the same command and get the initial config back to clean for that particular lab.

The TCL script:

Requirements:

1. WEB-IOU VM has a NIC bridged to the real local LAN (http://www.routereflector.com/cisco/cisco-iou-web-interface/connecting-iou-web-to-external-networks/)

2. A TFTPServer on your real local LAN.  Mine so happens to be 10.4.10.4

3. Unzip the initial-config.zip (or similar name) in your TFTP root.

4. Create VLAN 999 on SW1 (to allow the virtual router access to your real LAN) - making the bridging work.  I bridged e4/0 on SW1 to the CLOUD that I setup in #1 - I needed to remove the TRUNK configuration and convert to an ACCESS port on VLAN 999.

 

Script:

----------------------------------------------------------

tclsh

 

set hostname [info hostname]

set hostnumber [string trim
$hostname "R>

set tftpserver
"10.4.10.4"

 

ios_config "interface
e0/1.999" "encap dot1q 999" "ip address
dhcp" "no shutdown"
"end"

ios_config "file prompt
quiet"

 

foreach labname {

authenticating.bgp.peerings

authenticating.bgp.peerings

basic.bgp.routing

basic.bgp.routing.with.aggregation

basic.eigrp.routing

basic.ip.addressing

basic.layer.2.switching

basic.ospf.routing

basic.rip.routing

bgp.confederation

bgp.disable.connected.check

bgp.full

bgp.next.hop.processing.manual.modification

bgp.next.hop.processing.next.hop.self

bgp.over.gre

bgp.redistribute.internal

bgp.remove.private.as

bgp.update.source

catalyst.multicast

dhcp.advanced.initial

dhcp.information.option.initial

dhcp.ppp.initial

dmvpn

ebgp.multihop

ebgp.with.r9.to.r10

eigrpv6.basic

eigrpv6.initial

ibgp.route.reflection

ibgp.synchronization

initial.bgp

initial.bgp.base

initial.dhcp.authorized.arp

initial.dhcp.information.option

initial.eigrp

initial.multicast

initial.ospf

initial.rip

inter.domain.multicast

inter.domain.multicast.msdp

ip.services.initial

ipsec.vpn

ipv6.global.initial

ipv6.initial

ipv6.multicast.initial

ipv6.nbma.initial

ipv6.redistribution.initial

lan.switching.initial.spanning.tree

lan.switching.initial.vtp

large.scale.ibgp.route.reflection

mpls.bgp.soo.attribute

mpls.eigrp.site.of.origin

mpls.internet.access

mpls.label.filtering

mpls.ldp

mpls.mp.bgp.prefix.filtering

mpls.mp.bgp.vpnv4

mpls.ospf.sham.link

mpls.pe.ce.routing.with.bgp

mpls.pe.ce.routing.with.eigrp

mpls.pe.ce.routing.with.ospf

mpls.pe.ce.routing.with.rip

mpls.vpn.performance.tuning

mpls.vrf.lite

object.tracking.initial

ospfv3.basic

ospfv3.initial

qos.initial

ripng.initial

security.initial

system.management.initial

 

} { copy
tftp://$tftpserver/$labname/$hostname.txt unix:$labname.cfg }

----------------------------------------------------------

Comments

  • The gotchas are:

    1. In the WEB-IOU, in the NETMAP section, you need to create a new link for your "CLOUD" (aka local LAN, NIC bridge) and SW1 e4/0.

    I chose SW1 e4/0, but any spare interface would work.

    2. Some of the configs show warnings when you "config replace", but should be ok.  The original configs were saved from CSR's and some of the config commands don't "take" in IOL.  Nothing too much to worry about.

    3. Some of the BGP configs require new VLANs on SW1-4.  I think a couple of the labs peer between R2 - R10 via VRF_254.  You many need to create VLAN 109 and 210 on SW1-4 to allow the L2 VLAN.

    Hope this works for people.  It has saved my probably 30 minutes per night by not messing around.

  • Just wanted you to know that this script was awesome! I changed a few settings for my topology but it pulled down the configs into the flash beautifully.

     

    Thanks again.

  • I'm wondering, from where can i get these initial configs for WEB-IOU

  • You can download the configs from the INE site when you log in, go to the dashboard and go to the workbooks...

    The configs are all based from CSR VMs and area all GigabitEthernet, but you can use the following script to change them all to ethernet interfaces so that IOU can use them.

    grep -rl 'GigabitEthernet1' ./ | xargs sed -i 's/GigabitEthernet1/eth0/1/g'

     

  • How will it work with CSR1000v ESXi?

     

     

  • Great Script. Thanks.

     

    Some of the WB configurations dont have the 'no shutdown' command under the interface configs (i.e. BGP.FULL). I wouuld you apply this configuration. For the BGP.FULL example, do you first issue the 'Config replace unix:initial.bgp' command and then once the initial.bgp config is loaded you issue the 'copy unix:bgp.full running-config' command? Is there a simpler way to do this?

    Thanks

Sign In or Register to comment.