Loading switch config issue

I have a bunch of 2950s to load configs, for which I already have the unique config files for. I put a procedure together which simply:

sets the tftp server to a 192.168.101.1 adx boot the router and say no to initial config dialog erase the startup config config vty with a password and login statements to allow tftp assign an ip adx to vlan 1 on the switch to 192.168.101.2 verify the tftp server can ping the switch copy the config to the startup config (copy tftp start) reload

The config is loaded after the switch is rebooted, but the vlans in the config file do not appear in the switch. It does however work when I do a copy run start after the copy tftp start

Why's this? I thought if you copy the config to the start-config it would be ok.

Any comments welcome.

Regards,

RB

Reply to
rb33339
Loading thread data ...

The vlan definitions are not stored as part of the startup-config file. Instead, they are kept in a separate file called vlan.dat. Unfortunately, the format of this file is not text-compatable or eye-readable, although you can manipulate it with the usual copy commands. You can maintain vlan.dat contents either in config mode or in "vlan database" mode. When you enter "vlan" commands in config mode, they cause entries to be added to vlan.dat.

If you're wiping a switch that has been previously used, you need to delete the vlan.dat file to get rid of any previously-defined vlans. Otherwise, they have to be removed one at a time. Also, it would appear from your experience that the initial load of startup-config at boot time doesn't parse out the "vlan" commands the same as when entering them in config t.

Your simplest option would probably be to add "delete vlan.dat" to your script right after erasing the startup config, and then adding "copy start run" right before the reload. If the "copy start run" doesn't catch the vlan defs, then you could try filtering out the vlan definitions from each config, and tailor the script to insert them under either a "config t" or "vlan database" command.

Reply to
Mike Dorn

Thanks for that. Weird, but at least I know how to handle it.

RB

Reply to
rb33339

If someone erased the flash file, is any other option to get back router on Router prompt istead of rommon one.

Reply to
sajjad shamsi

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.