Final prep for my home lab

So now that I’ve got all the real equipment, it’s time to deploy everything.

As noted before, this is the way that I’ll be working: http://mellowd.co.uk/ccie/?p=1516

This is currently how the physical stuff actually looks like:


Now there were a couple of things I noticed when trying to get InternetworkExpert’s topologies onto my lab. Firstly I need to hard-code both my emulated routers and my real switches ethernet interfaces to 100Mb/full. Some of the interface names have also changed (s0/1/0 becomes s0/1, ethernet becomes fastethernet, etc) – Having to go through all the configs and doing it manually would take forever. Thankfully Daniel (http://lostintransit.se/) created a script to modify his startup configs. I’ve taken that script and modified it a bit more to come up with the following script:

#!/bin/sh
# Shell script to convert INE vol1 configs to Dynamips format
# Changes interface names
# Created by Daniel Dib @ http://http://lostintransit.se/
# Modified by Darren @ http://mellowd.co.uk/ccie

#Check if configs exist
for config in r1 r2 r3 r4 r5 r6 sw1 sw2 sw3 sw4
do
  if [ ! -r "$config.txt" ]; then
    doerror "Configuration file $config.txt does not exist"
  fi
done

echo "Files exist, continuing script..."

echo "Correcting configurations..."

echo "Starting with r1-r6..."

sed "
/FastEthernet0\/0/a \ speed 100\n duplex full
" r1.txt > r1.cfg

sed "
/FastEthernet0\/0/a \ speed 100\n duplex full
" r2.txt > r2.cfg

sed "
/FastEthernet0\/0/a \ speed 100\n duplex full
/FastEthernet0\/1/a \ speed 100\n duplex full
" r3.txt > r3.cfg

sed "
s/Serial0\/0\/0/Serial0\/0/g
s/Serial0\/1\/0/Serial0\/1/g
/FastEthernet0\/0/a \ speed 100\n duplex full
/FastEthernet0\/1/a \ speed 100\n duplex full
" r4.txt > r4.cfg

sed "
s/Serial0\/0\/0/Serial0\/0/g
s/Serial0\/1\/0/Serial0\/1/g
/FastEthernet0\/0/a \ speed 100\n duplex full
/FastEthernet0\/1/a \ speed 100\n duplex full
" r5.txt > r5.cfg

sed "
s/Serial0\/0\/0/Serial0\/0/g
/FastEthernet0\/0/a \ speed 100\n duplex full
/FastEthernet0\/1/a \ speed 100\n duplex full
" r6.txt > r6.cfg

echo "Routers done, starting with switches..."

sed "
s/switchport host/switchport mode access/g
/FastEthernet0\/1/a \ speed 100\n duplex full
/FastEthernet0\/2/a \ speed 100\n duplex full
/FastEthernet0\/3/a \ speed 100\n duplex full
/FastEthernet0\/4/a \ speed 100\n duplex full
/FastEthernet0\/5/a \ speed 100\n duplex full
/FastEthernet0\/6/a \ speed 100\n duplex full
/FastEthernet0\/7/a \ speed 100\n duplex full
/FastEthernet0\/8/a \ speed 100\n duplex full
/FastEthernet0\/9/a \ speed 100\n duplex full
/FastEthernet0\/10/a \ speed 100\n duplex full
/FastEthernet0\/11/a \ speed 100\n duplex full
/FastEthernet0\/12/a \ speed 100\n duplex full
/FastEthernet0\/13/a \ speed 100\n duplex full
/FastEthernet0\/14/a \ speed 100\n duplex full
/FastEthernet0\/15/a \ speed 100\n duplex full
/FastEthernet0\/16/a \ speed 100\n duplex full
/FastEthernet0\/17/a \ speed 100\n duplex full
/FastEthernet0\/18/a \ speed 100\n duplex full
/FastEthernet0\/19/a \ speed 100\n duplex full
/FastEthernet0\/20/a \ speed 100\n duplex full
/FastEthernet0\/21/a \ speed 100\n duplex full
/FastEthernet0\/22/a \ speed 100\n duplex full
/FastEthernet0\/23/a \ speed 100\n duplex full
/FastEthernet0\/24/a \ speed 100\n duplex full
" sw1.txt > sw1.cfg

sed "

s/switchport host/switchport mode access/g
/FastEthernet0\/1/a \ speed 100\n duplex full
/FastEthernet0\/2/a \ speed 100\n duplex full
/FastEthernet0\/3/a \ speed 100\n duplex full
/FastEthernet0\/4/a \ speed 100\n duplex full
/FastEthernet0\/5/a \ speed 100\n duplex full
/FastEthernet0\/6/a \ speed 100\n duplex full
/FastEthernet0\/7/a \ speed 100\n duplex full
/FastEthernet0\/8/a \ speed 100\n duplex full
/FastEthernet0\/9/a \ speed 100\n duplex full
/FastEthernet0\/10/a \ speed 100\n duplex full
/FastEthernet0\/11/a \ speed 100\n duplex full
/FastEthernet0\/12/a \ speed 100\n duplex full
/FastEthernet0\/13/a \ speed 100\n duplex full
/FastEthernet0\/14/a \ speed 100\n duplex full
/FastEthernet0\/15/a \ speed 100\n duplex full
/FastEthernet0\/16/a \ speed 100\n duplex full
/FastEthernet0\/17/a \ speed 100\n duplex full
/FastEthernet0\/18/a \ speed 100\n duplex full
/FastEthernet0\/19/a \ speed 100\n duplex full
/FastEthernet0\/20/a \ speed 100\n duplex full
/FastEthernet0\/21/a \ speed 100\n duplex full
/FastEthernet0\/22/a \ speed 100\n duplex full
/FastEthernet0\/23/a \ speed 100\n duplex full
/FastEthernet0\/24/a \ speed 100\n duplex full
" sw2.txt > sw2.cfg

sed "

s/switchport host/switchport mode access/g
/FastEthernet0\/1/a \ speed 100\n duplex full
/FastEthernet0\/2/a \ speed 100\n duplex full
/FastEthernet0\/3/a \ speed 100\n duplex full
/FastEthernet0\/4/a \ speed 100\n duplex full
/FastEthernet0\/5/a \ speed 100\n duplex full
/FastEthernet0\/6/a \ speed 100\n duplex full
/FastEthernet0\/7/a \ speed 100\n duplex full
/FastEthernet0\/8/a \ speed 100\n duplex full
/FastEthernet0\/9/a \ speed 100\n duplex full
/FastEthernet0\/10/a \ speed 100\n duplex full
/FastEthernet0\/11/a \ speed 100\n duplex full
/FastEthernet0\/12/a \ speed 100\n duplex full
/FastEthernet0\/13/a \ speed 100\n duplex full
/FastEthernet0\/14/a \ speed 100\n duplex full
/FastEthernet0\/15/a \ speed 100\n duplex full
/FastEthernet0\/16/a \ speed 100\n duplex full
/FastEthernet0\/17/a \ speed 100\n duplex full
/FastEthernet0\/18/a \ speed 100\n duplex full
/FastEthernet0\/19/a \ speed 100\n duplex full
/FastEthernet0\/20/a \ speed 100\n duplex full
/FastEthernet0\/21/a \ speed 100\n duplex full
/FastEthernet0\/22/a \ speed 100\n duplex full
/FastEthernet0\/23/a \ speed 100\n duplex full
/FastEthernet0\/24/a \ speed 100\n duplex full
" sw3.txt > sw3.cfg

sed "

s/switchport host/switchport mode access/g
/FastEthernet0\/1/a \ speed 100\n duplex full
/FastEthernet0\/2/a \ speed 100\n duplex full
/FastEthernet0\/3/a \ speed 100\n duplex full
/FastEthernet0\/4/a \ speed 100\n duplex full
/FastEthernet0\/5/a \ speed 100\n duplex full
/FastEthernet0\/6/a \ speed 100\n duplex full
/FastEthernet0\/7/a \ speed 100\n duplex full
/FastEthernet0\/8/a \ speed 100\n duplex full
/FastEthernet0\/9/a \ speed 100\n duplex full
/FastEthernet0\/10/a \ speed 100\n duplex full
/FastEthernet0\/11/a \ speed 100\n duplex full
/FastEthernet0\/12/a \ speed 100\n duplex full
/FastEthernet0\/13/a \ speed 100\n duplex full
/FastEthernet0\/14/a \ speed 100\n duplex full
/FastEthernet0\/15/a \ speed 100\n duplex full
/FastEthernet0\/16/a \ speed 100\n duplex full
/FastEthernet0\/17/a \ speed 100\n duplex full
/FastEthernet0\/18/a \ speed 100\n duplex full
/FastEthernet0\/19/a \ speed 100\n duplex full
/FastEthernet0\/20/a \ speed 100\n duplex full
/FastEthernet0\/21/a \ speed 100\n duplex full
/FastEthernet0\/22/a \ speed 100\n duplex full
/FastEthernet0\/23/a \ speed 100\n duplex full
/FastEthernet0\/24/a \ speed 100\n duplex full
" sw4.txt > sw4.cfg

The BB1, BB2 and BB3 routers also need to be changed, but as the config never changes in any of the labs you can just download the fixed versions of all 3 from here:

I also need a script on my dynamips box that will up all the interfaces on the NICs and then run dynamips. This is my start script:

#!/bin/bash
#Bring interfaces up
ifconfig eth1 up
ifconfig eth2 up
ifconfig eth3 up
ifconfig eth4 up
ifconfig eth5 up
ifconfig eth6 up
ifconfig eth7 up
ifconfig eth8 up
ifconfig eth9 up
ifconfig eth10 up
ifconfig eth11 up
ifconfig eth12 up

#Start Hypervisor
dynamips -H 7200 &

Finally, my actual dynagen .net file I use on my laptop looks like so:

 autostart = false

[10.20.30.12:7200]
 workingdir = /data/dynamips/working

[[3725]]
 image = /data/dynamips/ios/3725/c3725-adventerprisek9-mz.124-15.T14.UNCOMPRESSED.bin
 ram = 142
 idlepc = 0x6026be14
 ghostios = True
 mmap = True

[[ROUTER r1]]
        model = 3725
        console = 2001
        f0/0 = nio_linux_eth:eth4
        s0/0 = FRAME 1

[[ROUTER r2]]
        model = 3725
        console = 2002
        f0/0 = nio_linux_eth:eth5
        s0/0 = FRAME 2

[[ROUTER r3]]
        model = 3725
        console = 2003
        slot1 = NM-4T
        f0/0 = nio_linux_eth:eth8
        f0/1 = nio_linux_eth:eth12
        s1/0 = FRAME 3
        s1/1 = FRAME 13
        s1/2 = r1 s0/1
        s1/3 = r2 s0/1

[[ROUTER r4]]
        model = 3725
        console = 2004
        f0/0 = nio_linux_eth:eth7
        f0/1 = nio_linux_eth:eth11
        s0/0 = FRAME 4
        s0/1 = r5 s0/1

[[ROUTER r5]]
        model = 3725
        console = 2005
        f0/0 = nio_linux_eth:eth2
        f0/1 = nio_linux_eth:eth6
        s0/0 = FRAME 5

[[ROUTER r6]]
        model = 3725
        console = 2006
        f0/0 = nio_linux_eth:eth3
        f0/1 = nio_linux_eth:eth1
        s0/0 = FRAME 6

[[ROUTER bb1]]
        model = 3725
        console = 2007
        slot1 = NM-4T
        s1/0 = bb3 s1/0
        s1/1 = FRAME 21

[[ROUTER bb2]]
        model = 3725
        console = 2008
        f0/0 = nio_linux_eth:eth10

[[ROUTER bb3]]
        model = 3725
        console = 2009
        slot1 = NM-4T
        f0/0 = nio_linux_eth:eth9

[[FRSW FRAME]]

  #
  # R1 to FRSW
  #
  1:102 = 2:201
  1:103 = 3:301
  1:113 = 13:311
  1:104 = 4:401
  1:105 = 5:501
  #
  # R2 to FRSW
  #
  2:203 = 3:302
  2:213 = 13:312
  2:204 = 4:402
  2:205 = 5:502
  #
  # R3 to FRSW
  #
  3:304 = 4:403
  3:305 = 5:503
  13:314 = 4:413
  13:315 = 5:513
  #
  # R4 to FRSW
  #
  4:405 = 5:504
  #
  # R6 to FRSW
  #
  6:51 = 21:51
  6:100 = 21:100
  6:101 = 21:101
  6:201 = 21:201
  6:301 = 21:301
  6:401 = 21:401

© 2009-2020 Darren O'Connor All Rights Reserved -- Copyright notice by Blog Copyright