Monday 23 August 2010

Modifications to my underlying Lab Config

I have patched up my home lab to resemble the IPExpert topology - it's not a 100% mapping due to the switches I'm using (3750s interfaces are named FastEthernet1/0/1 rather than FastEthernet0/1 to accomodate the stacking capability) and that I am using simulated 7200s which will have slightly different serial interface numbers (for some reason when I use 3700s I cannot see the switches via CDP but its fine with a 7200) so I will rely on some sed based scripts that will rework the configs to suit the environment.

The main change to my logical configuration is that rather than using the ethernet switch within dynamips to provide dot1qtunnelling with the usual Mr Paul Configuration I have taken the concept from 21500 where the outer VLANs are directly defined on the linux system with dynamips router interfaces terminating directly onto the linux VLAN interfaces.

The reason I did this was that this way I could actually run virtual hosts on my linux box and terminate them onto local VLAN interfaces that can drop out of my breakout switch (With the 3 virtual hosts, I am now using 24 fastethernet ports on my 3550 breakout switch)

On My Ubunutu Box
eth1 is the management interface on my home lan
eth0 is the interface facing CatB (The breakout switch)

to /etc/modules I added the line "8021q" which then enabled native 802.1q support

"sudo apt-get install bridge-utils" to install the bridging utilities so we can create bridge interfaces (much like a BVI on a cisco router)


In the interface configuration definition below, the interfaces I want to use (eth0.x) are enabled via pre-up vconfig add statements in order for the vlans to go operational when the main interface comes up.  Since we haven't applied an IP config on eth0, we need a cheat to bring the interface up automatically (done with pre-up ifconfig eth0 up)

The management IP interface is br0 which is attached to eth1.  It was done this way so devices that use TAP interfaces can be added as ports attached to bridge br0 for internet access if they need it.


start of /etc/network/interfaces

# The loopback network interface
auto lo
iface lo inet loopback

# CatB Facing Interface
auto eth0
iface eth0 inet manual
        # Set the vlan naming to be interface.vlanid
        pre-up vconfig set_name_type DEV_PLUS_VID_NO_PAD
        vlan-raw-device eth0
        pre-up vconfig add eth0 101
        pre-up vconfig add eth0 102
        pre-up vconfig add eth0 201
        pre-up vconfig add eth0 202
        pre-up vconfig add eth0 203
        pre-up vconfig add eth0 401
        pre-up vconfig add eth0 402
        pre-up vconfig add eth0 501
        pre-up vconfig add eth0 502
        pre-up vconfig add eth0 601
        pre-up vconfig add eth0 602
        pre-up vconfig add eth0 701
        pre-up vconfig add eth0 702
        pre-up vconfig add eth0 801
        pre-up vconfig add eth0 802
        pre-up vconfig add eth0 901
        pre-up vconfig add eth0 902
        pre-up vconfig add eth0 11
        pre-up vconfig add eth0 22
        pre-up vconfig add eth0 33
        pre-up ifconfig eth0 up
        post-down vconfig rem eth0.101
        post-down vconfig rem eth0.102
        post-down vconfig rem eth0.201
        post-down vconfig rem eth0.202
        post-down vconfig rem eth0.203
        post-down vconfig rem eth0.401
        post-down vconfig rem eth0.402
        post-down vconfig rem eth0.501
        post-down vconfig rem eth0.502
        post-down vconfig rem eth0.601
        post-down vconfig rem eth0.602
        post-down vconfig rem eth0.701
        post-down vconfig rem eth0.702
        post-down vconfig rem eth0.801
        post-down vconfig rem eth0.802
        post-down vconfig rem eth0.901
        post-down vconfig rem eth0.902
        post-down vconfig rem eth0.11
        post-down vconfig rem eth0.22
        post-down vconfig rem eth0.33
        mtu 1540

# The primary network interface
auto eth1
iface eth1 inet manual
        pre-up ifconfig eth1 up

#server management/internet access
auto br0
iface br0 inet static
        address 192.168.1.248
        netmask 255.255.255.0
        broadcast 129.168.1.255
        gateway 192.168.1.254
        bridge_ports eth1
        bridge_maxwait 0
        bridge_fd 0
        bridge_stp off

end of /etc/network/interfaces

CatB will make use of the VLANs defined above to split out to feed to Cat1, Cat2, Cat3 and Cat4 as well as VLANs 97, 98 and 99 which will be created on demand for extra hosts.

start of CatB Config

hostname CatB-3550
aaa new-model
aaa authentication login default none
aaa authentication enable default none
aaa authorization exec default none
vtp mode transparent
vlan 11,22,33,97-99,101-102,201-203,401-402,501-502,601-602,701-702,801-802
vlan 901-902
interface FastEthernet0/1
 description R1 Fa0/0 to Cat1 Fa1/0/1
 switchport access vlan 101
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/2
 description R1 Fa0/1 to Cat2 Fa1/0/1
 switchport access vlan 102
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/3
 description R2 Fa0/0 (Gi0/0 RJ45) to Cat1 Fa1/0/2
 switchport access vlan 201
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/4
 description R2 Fa1/0 (Gi0/0 SFP) to Cat1 Fa1/0/12 (Gi0/2)
 switchport access vlan 202
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/5
 description R2 Fa0/1 (Gi0/1 RJ45) to Cat2 Fa1/0/2
 switchport access vlan 203
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/6
 description R4 Fa0/0 to Cat1 Fa1/0/4
 switchport access vlan 401
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/7
 description R4 Fa0/1 to Cat3 Fa0/4
 switchport access vlan 402
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/8
 description R5 Fa0/0 to Cat1 Fa1/0/5
 switchport access vlan 501
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/9
 description R5 Fa0/1 to Cat3 Fa0/5
 switchport access vlan 502
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/10
 description R6 Fa0/0 to Cat2 Fa1/0/6
 switchport access vlan 601
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/11
 description R6 Fa0/1 to Cat4 Fa0/6
 switchport access vlan 602
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/12
 description R7 Fa0/0 to Cat 2 Fa1/0/7
 switchport access vlan 701
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/13
 description R7 Fa0/1 to Cat4 Fa0/7
 switchport access vlan 702
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/14
 description R8 Fa0/0 to Cat 2 Fa1/0/8
 switchport access vlan 801
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/15
 description R8 Fa0/1 to Cat 4 Fa0/8
 switchport access vlan 802
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/16
 description R9 Fa0/0 to Cat2 Fa1/0/9
 switchport access vlan 901
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/17
 description R9 Fa0/1 to Cat4 Fa0/9
 switchport access vlan 902
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/18
 description BB1 Fa0/0 to Cat1 Fa1/0/11
 switchport access vlan 11
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/19
 description BB2 Fa0/0 to Cat2 Fa0/12
 switchport access vlan 22
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/20
 description BB3 Fa0/0 to Cat2 Fa1/0/13
 switchport access vlan 33
 switchport mode dot1q-tunnel
 l2protocol-tunnel cdp
 no cdp enable
 spanning-tree portfast trunk
!
interface FastEthernet0/21
 description Host1 eth0 to Cat2 Fa1/0/15
 switchport access vlan 97
 switchport mode access
 no cdp enable
 spanning-tree portfast
!
interface FastEthernet0/22
 description Host2 eth0 to Cat2 Fa1/0/16
 switchport access vlan 98
 switchport mode access
 no cdp enable
 spanning-tree portfast
!
interface FastEthernet0/23
 description NMS eth0 to Cat2 Fa0/14
 switchport access vlan 99 
 switchport mode access 
 no cdp enable
 spanning-tree portfast
!
interface FastEthernet0/24
 description To Router Simulator Trunk
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 11,22,33,97-99,101,102,201-203,401,402,501,502
 switchport trunk allowed vlan add 601,602,701,702,801,802,901,902
 switchport mode trunk
 l2protocol-tunnel cdp
 spanning-tree portfast trunk

End of CatB Config
 
To give an example as to how one of the virtual hosts on my routersim would be called into existence. I have a qemu virtual pc setup and ready to go.

I invoke it by typing:
sudo qemu nms.img -m 64 -curses -net nic,macaddr=00:aa:00:60:01:01 -net tap,ifname=tap99,script=/etc/qemu-ifup-nms


eth0 will be attached to the interface tap99 - when we call the script /etc/qemu-ifup-nms it will create the bridge br99 which will have tap99 and eth0.99 as member ports which will allow the NMS to be presented via CatB Fa0/23

 
Start of /etc/qemu-ifup-nms
#!/bin/sh
sudo /sbin/vconfig add eth0 99
sudo /usr/sbin/brctl addbr br99
sudo /usr/sbin/brctl addif br99 eth0.99
sudo /usr/sbin/brctl stp br99 off
sudo /sbin/ifconfig eth0.99 up
sudo /usr/sbin/brctl addif br99 $1
sudo /sbin/ifconfig $1 up
sudo /sbin/ifconfig br99 up
sleep 2
End of /etc/qemu-ifup-nms

Similar configurations are set up for Host1 (tap97, br97, eth0.97 - CatB Fa0/21) and Host2 (tap98, br98, eth0.98 - CatB Fa0/22)

Below is my current incarnation of the IPExpert topology. Rather than using the internal Frame Switch, I have set up a router to act in that role.

Start of ipexpert.net
autostart = false
ghostios = true

[localhost]
        workingdir = /home/adam/cisco/work_ipexpert
        [[7200]]
                image = /opt/ios/unzipped/c7200-adventerprisek9-mz.124-24.T.bin
                npe = npe-225
                ram = 160
                idlepc = 0x6307ad74
                disk0 = 128

        [[2611]]
                image = /opt/ios/unzipped/c2600-js-mz.123-17a.bin
                ram = 64
                idlepc = 0x803266c4
        [[3725]]
                image = /opt/ios/unzipped/c3725-advsecurityk9-mz.124-15.T12.bin
                ram = 128
                disk0 = 64
                idlepc = 0x60bb28d0

        [[ROUTER R1]]
                model = 7200
                console = 2001
                slot0 = PA-C7200-IO-2FE
                f0/0 = NIO_gen_eth:eth0.101
                f0/1 = NIO_gen_eth:eth0.102

        [[ROUTER R2]]
                model = 7200
                console = 2002
                slot0 = PA-C7200-IO-2FE
                slot2 = PA-4T
                f0/0 = NIO_gen_eth:eth0.201
                f0/1 = NIO_gen_eth:eth0.203
                f1/0 = NIO_gen_eth:eth0.202
                s2/1 = FR s0/0
                s2/2 = R5 s2/2

        [[ROUTER R4]]
                model = 7200
                console = 2004
                slot0 = PA-C7200-IO-2FE
                slot2 = PA-4T
                f0/0 = NIO_gen_eth:eth0.401
                f0/1 = NIO_gen_eth:eth0.402
                s2/0 = FR s0/1

        [[ROUTER R5]]
                model = 7200
                console = 2005
                slot0 = PA-C7200-IO-2FE
                slot2 = PA-4T
                f0/0 = NIO_gen_eth:eth0.501
                f0/1 = NIO_gen_eth:eth0.502
                s2/1 = FR s0/2

        [[ROUTER R6]]
                model = 7200
                console = 2006
                slot0 = PA-C7200-IO-2FE
                slot2 = PA-4T
                f0/0 = NIO_gen_eth:eth0.601
                f0/1 = NIO_gen_eth:eth0.602
                s2/1 = FR s0/3
                s2/2 = R9 s2/2
                s2/3 = R9 s2/3

        [[ROUTER R7]]
                model = 7200
                console = 2007
                slot0 = PA-C7200-IO-2FE
                slot2 = PA-4T
                f0/0 = NIO_gen_eth:eth0.701
                f0/1 = NIO_gen_eth:eth0.702
                s2/2 = R8 s2/2

        [[ROUTER R8]]
                model = 7200
                console = 2008
                slot0 = PA-C7200-IO-2FE
                slot2 = PA-4T
                f0/0 = NIO_gen_eth:eth0.801
                f0/1 = NIO_gen_eth:eth0.802

        [[ROUTER R9]]
                model = 7200
                console = 2009
                slot0 = PA-C7200-IO-2FE
                slot2 = PA-4T
                f0/0 = NIO_gen_eth:eth0.901
                f0/1 = NIO_gen_eth:eth0.902

        [[ROUTER BB1]]
                model = 2611
                console = 2101
                e0 = NIO_gen_eth:eth0.11
                e1 = NIO_gen_eth:eth1

        [[ROUTER BB2]]
                model = 2611
                console = 2102
                e0 = NIO_gen_eth:eth0.22

        [[ROUTER BB3]]
                model = 2611
                console = 2103
                e0 = NIO_gen_eth:eth0.33

        [[ROUTER FR]]
                model = 2611
                console = 2104
                WIC0/0 = WIC-2T
                WIC0/1 = WIC-2T

End of ipexpert.net

2 comments:

  1. Hey Adam. Nice write up. I'm basically doing the exact same thing you are doing above. I have an older setup at my office on a junk 6u server and I've actually stuffed it full of 4xFE cards and I'm doing a one for one mapping to my switches. That has worked well. At home, I have a dual nic Ubuntu server and I'm trunking to a breakout switch. Setup has worked great. FYI, I had to change my serials but I pretty much managed to match all my ethernet up with the IPExpert lab diagram. The serials wouldn't work because of the card layout in the GNS3 7200s. Anyway, I'm on a similar pace studies wise and just wanted to wish you well. See you on the study lists....

    --Hammer

    ReplyDelete
  2. Cheers Hammer - I like the idea of individual physical interfaces per router interface but if I would need a motherboard that can handle quite a few cards - I originally tried to use lots of USB NIcs but they didn't work out so well and were a mess :) Best of luck with your studies as well.

    ReplyDelete