Cisco 3750 Script vlan issue

Associate
Joined
7 Aug 2012
Posts
949
Hi All,

I've currently got a script working for a Cisco 3750 switch.

When I restore the script, everything comes across apart from creating the vlans.

In the Show Running config it shows my VLANs as having an IP however they're not in the vlan database.

I've added the vlans manually into the vlan database, saved the config, deleted the vlans and restored the config and they don't go back into the database.

Am I doing something wrong, or is there a config I need to run so that the vlans get stored into the database?

Cheers

Swain90
 
Hi,

The Vlans are stored in a seperate file on the device outside of the config, believe its called vlan.dat?
So I think that if they aren't there, they can be configured but don't actually exist until someone enters
Conf t
vlan 120
name printers


for example.

Then I believe it is entered into the database, and actually exists.
 
Hi,

The Vlans are stored in a seperate file on the device outside of the config, believe its called vlan.dat?
So I think that if they aren't there, they can be configured but don't actually exist until someone enters
Conf t
vlan 120
name printers


for example.

Then I believe it is entered into the database, and actually exists.


Thanks for the reply.

The thing I don't understand is that as part of the config, we actually define each vlan by having the below listed at the top of the script;

interface vlan 100
interface vlan 101
interface vlan 102

Annoyingly they don't go in, however all the other parameters which we define which you would need to go into config t for do actually get configured.

Is it just that the vlans that must be entered in manually and not through a config script?

Cheers

Swain90
 
Last edited:
Thanks for the reply.

The thing I don't understand is that as part of the config, we actually define each vlan by having the below listed at the top of the script;

interface vlan 100
interface vlan 101
interface vlan 102

Annoyingly they don't go in, however all the other parameters which we define which you would need to go into config t for do actually get configured.

Is it just that the vlans that must be entered in manually and not through a config script?

Cheers

Swain90
You need to do this first:

Conf t
Vlan 100
name Whateveryouwannacallit
Vlan 101
name Whateveryouwannacallit2
Vlan 102
name Whateveryouwannacallit
exit

conf t
interface vlan 100
interface vlan 101
interface vlan 102

Until you have gone into the settings at the start, the vlans don't really exist, are not in vlan.dat, and will not show up in "show vlan" output.
After you have done that command and given them a name, they will do and you will be able to configure them properly
 
You need to do this first:

Conf t
Vlan 100
name Whateveryouwannacallit
Vlan 101
name Whateveryouwannacallit2
Vlan 102
name Whateveryouwannacallit
exit

conf t
interface vlan 100
interface vlan 101
interface vlan 102

Until you have gone into the settings at the start, the vlans don't really exist, are not in vlan.dat, and will not show up in "show vlan" output.
After you have done that command and given them a name, they will do and you will be able to configure them properly

Thanks again for your reply. Looks like the normal backup/restore menthod using tftp wouldn't work for the vlan stuff so I've used your examples above and sent a text file with the specific commands in and everything is working fine. Plus using Hyperterminal and the text file is one less thing for someone to set up!

Cheers
 
The vlans will absolutely appear in the running /startup config. You just have to disable VTP in order for this to happen "vtp mode transparent". VTP last time I checked defaults as server which hides them in the VLAN.dat file.

Also you only need "int vlan ***" if you are using layer 3/SVI's. "vlan ***" creates a new layer 2 domain.
 
Thanks again for your reply. Looks like the normal backup/restore menthod using tftp wouldn't work for the vlan stuff so I've used your examples above and sent a text file with the specific commands in and everything is working fine. Plus using Hyperterminal and the text file is one less thing for someone to set up!

Cheers
Glad its working :)
 
Back
Top Bottom