Where does a Cisco IOS switch store VLAN info?

2 questions, actually:

I've got a 2960 switch running IOS 12.2(25).  It has an access point connected to it but guests were unable to connect to one of the wireless networks the AP provides.

One of my techs looked into it and said that VLAN 12 was not configured on the switch; VLAN 12 is the VLAN the guest wireless network uses.  He just did "vlan 12" at a conf t prompt and it all woke up.  He didn't add any interfaces to VLAN 12.  So question 1 is this: VLAN 12 exists on the AP, and the switch port the AP is on is configured to trunk.  Why was it necessary to create VLAN 12 on the switch?  None of the resources accessed by users of the guest wifi are on that switch, they just need to use its backbone to our internet router, which is also configured to trunk.

Now I can see VLAN 12 in there when I do a "sho vlan", but I can't see the command that creates VLAN 12 in the running config.  So question 2 is, when the switch reboots or whatever, how does it know to re-create VLAN 12?  Is the info stored somewhere other than the running-config?

Asking because I can envision a time when the switch dies and we go to swap in a replacement by throwing a copy of the old config on it, then sit around scratching our heads because "everything should be identical" when really the VLAN is not being created.
UnclePerkyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

giltjrCommented:
The actual vlan info is kept in a file called vlan.dat  .  Depending on the device this is normally in nvram.

What is kept in the startup-config file related to VLAN's are the layer 3 definitions for the svi if you have any.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
giltjrCommented:
Oh.  There can be two parts of a VLAN definition.  The VLAN itself, which is what is in the vlan.dat file I referenced early.  This allows the vlan to exist as a layer 2 resource.  

Then there is the svi, which is the virtual interface which is required if you want that vlan to exist at the layer 3 level.    A layer 3 interface for the vlan is not always required.
UnclePerkyAuthor Commented:
I guess I'm confused as to why the switch would need to know about VLAN 12 at all.  There are no interfaces on the switch in VLAN 12, so all I want is for VLAN 12-tagged frames to head out over the trunk toward the other devices which _do_ have interfaces in VLAN 12.  I'm not understanding why the switch the AP is attached to needs to know about VLAN 12...shouldn't the AP be tagging the appropriate frames for VLAN 12, and then shouldn't the switch see them and just shoot them down the trunk?  Will a trunked port only pass frames tagged for VLANs it knows about?

I feel like I'm probably missing something very basic here and will be embarassed once the light comes on.
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

giltjrCommented:
What VTP mode is that switch in?  It could have been pruned.
mikebernhardtCommented:
Set the switch's vtp domain to "transparent"
conf t
vtp mode transparent
end

When you do this the vlans will be stored in the config. I hate VTP...
giltjrCommented:
True, but you have to add them to that switch if it needs to know about it.

VTP has its advantages if you have a large number of switches and a large number of VLAN's.
mikebernhardtCommented:
In a well-designed network you would push the Layer 3 outward and never have a lot of switches with the same vlans. So VTP is a tool to manage a badly-designed network. Even when I've had to push vlans to a number of switches, I prefer to manage it manually- because when VTP isn't used correctly (i.e. the default "server" mode is left in place on all switches), removing a vlan on one switch removes it everywhere!

And yes, you have to add the vlans to the switch, but that had to be done anyway. Setting VTP to transparent means that the vlan configuration is stored as part of the regular config where it can easily be recreated on a replacement switch.
Don JohnstonInstructorCommented:
I guess I'm confused as to why the switch would need to know about VLAN 12 at all.  There are no interfaces on the switch in VLAN 12, so all I want is for VLAN 12-tagged frames to head out over the trunk

There's your answer. :-)

While the switch may not have any access ports that are members of VLAN 12, it does have trunk ports carrying VLAN 12 traffic. For that reason, VLAN 12 must exist on the switch.
UnclePerkyAuthor Commented:
So any time a port is set to trunk, it should be SOP to make sure all VLANs which the trunk will need to carry exist in the VLAN database on the switch that has the trunk port.  VLANs can be added to the database either manually through a "VLAN 12" command, or by VTP if that's being used.  Do I have that right?

Last (I think) question: aside from concerns about filling up available space, are there any cons to setting VTP to transparent?
Don JohnstonInstructorCommented:
So any time a port is set to trunk, it should be SOP to make sure all VLANs which the trunk will need to carry exist in the VLAN database on the switch that has the trunk port.  VLANs can be added to the database either manually through a "VLAN 12" command, or by VTP if that's being used.  Do I have that right?
That's correct.

Last (I think) question: aside from concerns about filling up available space, are there any cons to setting VTP to transparent?
I don't know about the "filling up available space" part, but personally, I don't use VTP.  It's a nice feature, but it's really easy to shoot yourself in the foot with it.  I like to explain that it's like a chainsaw: An excellent tool. Saves lots of time, etc.  But if you don't understand it and exercise caution, you can have a very bad day.  A "bad day" being introducing a new switch that wipes out every VLAN on every switch.
UnclePerkyAuthor Commented:
I don't know about the "filling up available space" part, but personally, I don't use VTP.  It's a nice feature, but it's really easy to shoot yourself in the foot with it.  I like to explain that it's like a chainsaw: An excellent tool. Saves lots of time, etc.  But if you don't understand it and exercise caution, you can have a very bad day.  A "bad day" being introducing a new switch that wipes out every VLAN on every switch.

So "vtp mode transparent" almost looks like a good thing to set by default if you don't intend VTP to be in use, no?  Because regardless of where the VLAN database is stored, the switch won't advertise VLAN changes made to it, or accept changed from others via VTP, when it's in transparent mode?
Don JohnstonInstructorCommented:
Yes. Early on (and even now with some platforms and IOS versions) there was no way to truly disable VTP. Transparent mode was the method to accomplish that goal.
mikebernhardtCommented:
That's correct. I always set VTP to transparent, or off if possible.

I actually experienced donjohnston's "bad day" when someone I worked with installed some switches in a facility, all left at the default "server" despite our SOPs stating that it should be set to transparent. Later they decided that certain vlans were not required in one of the wiring closets, deleted them, and POOF! they were gone in the whole building.
Don JohnstonInstructorCommented:
Yep. Anyone who has been around Cisco switches long enough has seen that dreaded CLE (Career Limiting Event).  If it's bad enough, it becomes a CEE (Career Ending Event) or an RJE (Resume Generating Event).

:-D
mikebernhardtCommented:
It did contribute to that individual's RJE a month or so later...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Switches / Hubs

From novice to tech pro — start learning today.