CCIE Pursuit Blog

September 6, 2008

Lab Tip: Get List Of All Configured VLANs

Filed under: Cisco,Cisco Certification,IOS,Lab Tips,Switching — cciepursuit @ 4:59 pm
Tags: , , ,

You have your VTP domain set up and all of your VLANs are built and propagated.  Then you run across a task like this:

“Configure sw4 as the spanning-tree root for all configured VLANs.”

Here’s a quick and dirty way to do this if your switch is running in VTP client or server mode (if you’re in transparent mode then you just need to do steps 2 and 3):

1) Set your VTP mode to “transparent”

sw4(config)#vtp mode trans
Setting device to VTP TRANSPARENT mode.

2) Issue “do show run | i vlan”

sw4(config)#do sh run | i vlan
vlan internal allocation policy ascending
vlan 7-8,28,34,46,53,58,100 <-this is what you’re looking for
 switchport access vlan 34

3) Configure your switch as the STP root for that list of VLANs (cut and paste) – ask the proctor if you should include VLAN 1:

sw4(config)#span vlan 1,7-8,28,34,46,53,58,100 root prim

4) Return your switch to the correct VTP mode:

sw4(config)#vtp mode server
Setting device to VTP SERVER mode

Voila!

sw4(config)#do sh run | i priority
spanning-tree vlan 1,7-8,28,34,46,53,58,100 priority 24576

sw4(config)#do sh span | i VLAN|root|Address
VLAN0001
             Address     000a.8a1c.c400
             This bridge is the root
             Address     000a.8a1c.c400
VLAN0007
             Address     000a.8a1c.c400
             This bridge is the root
             Address     000a.8a1c.c400
VLAN0008
             Address     000a.8a1c.c400
             This bridge is the root
             Address     000a.8a1c.c400
VLAN0028
             Address     000a.8a1c.c400
             This bridge is the root
             Address     000a.8a1c.c400

<—output truncated—>

sw4(config)#do sh span root

                                        Root    Hello Max Fwd
Vlan                   Root ID          Cost    Time  Age Dly  Root Port
—————- ——————– ——— —– — —  ————
VLAN0001         24577 000a.8a1c.c400         0    2   20  15
VLAN0007         24583 000a.8a1c.c400         0    2   20  15
VLAN0008         24584 000a.8a1c.c400         0    2   20  15
VLAN0028         24604 000a.8a1c.c400         0    2   20  15
VLAN0034         24610 000a.8a1c.c400         0    2   20  15
VLAN0046         24622 000a.8a1c.c400         0    2   20  15
VLAN0053         24629 000a.8a1c.c400         0    2   20  15
VLAN0058         24634 000a.8a1c.c400         0    2   20  15
VLAN0100         24676 000a.8a1c.c400         0    2   20  15

Advertisements

1 Comment »

  1. great info thanks a lot for this

    Comment by nassim — September 8, 2008 @ 5:35 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: