TFTP, IOS and boot.

Answered Question
May 8th, 2007
User Badges:

All


I am confused - hence the post here. I am endeavouring to get a switch to pull its configuration from a TFTP server when the switch is powered up. So far I have managed to get the switch to pull the config over, but only after I have assigned an IP address to VLAN1 on the switch - then it pulls the conf file off the TFTP server.


What I am looking to achieve is the sitaution where a switch is plugged in out of the box, and it pulls down all its conf from the server - for example when a switch dies and needs to be replaced.


Is there a way to achieve this - and if so is it possible for a switch to automatically pull its IOS image from a server as well.

Correct Answer by voiper_99 about 10 years 1 month ago

If you would like more information, take a look at this page;


http://www.cisco.com/en/US/products/sw/iosswrel/ps1831/products_command_reference_chapter09186a00800d9837.html#19560


It gives you information on how this command works and how it can be used.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.5 (2 ratings)
Loading.
Joe Clarke Tue, 05/08/2007 - 06:32
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

Assuming the switch has no configuration (i.e. out-of-the-box or after a write erase), and you boot it up, it should request an IP address from the DHCP server, then look for network-config, switch-config, or cisconet.cfg.


This will also happen if "service config" is enabled. With that command enabled, and a valid NVRAM, the switch will look for HOSTNAME-config.

mohammedmahmoud Tue, 05/08/2007 - 08:00
User Badges:
  • Green, 3000 points or more

Hi,


Couldn't reply better than Joe, only one thing that i want to stress on, the switch must initially have an IP to communicate with, so it should be manually configured with this IP, or you shall depend upon the DHCP server giving it an IP.


HTH, please do rate all helpful replies,

Mohammed Mahmoud.

Paul Williams Wed, 05/09/2007 - 07:03
User Badges:

Thanks for the reply, just to clarify - this is a proof of concept prior to presenting the results to my manager.


So for the test I have a Cisco 801 router connected to a 2924XL switch. The router is et up for DHCP and the configuration of the switch is clean (i.e. no config).


When I power up the switch I do get an IP address from the DHCP server (as well as the gateway address), and the switch then display a "Continue with configuration dialog? [yes/no]:" prompt and I enter NO.


This leaves me at a > prompt. I then have to type enable and wr m to start the TFTP pull of the image.


It seems that the conf pulled from TFTP goes straight to the startup-conf, which means I then have to do a copy start run to get the image into the right place...


What I want to do is plug the switch into the router, and everything be done automatically so that the tftp image is pulled from the tftp server and written straight to the running conf (the IP address pulled from DHCP is not the IP I want to use on the switch).


Also,in your reply you indicate there are various conf files that can be used i.e. network-config, switch-config, or cisconet.cfg, and also ""service config" is enabled" - where can I find information about using these.


I guess what I want is a step by step, hand holding guide on how to do what I am trying to do - especially the automatic configuration.


The eventual aim is to have all the confs for all our switches (approximately 1500) on our LMS server so that if a switch fails, anybody can patch it in and it will be up and running.


We are a retail organisation with 150 stores across the UK and we do not have technical staff in each store to do this so if a person with a bit of intelligence can be talked through patching it in it would save us a lot of time and effort.


thanks

Joe Clarke Wed, 05/09/2007 - 10:50
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

You're probably not wating long enough (i.e. for spanning tree to finish up). Yes, you will get the autoinstall menu, but if you give it a few seconds, the switch will send a DHCP discover. When it gets an offer, it will autoconfig itself, then you will see it start to request the configs. Once it finds one of the matching configs on the network, it will autoconfig itself, then the autoinstall will terminate, and you will be back at the switch prompt.


The switch will request, besides its IP address, the TFTP server (option 66) and the boot file name (option 67). So I configured my DHCP server to advertise the correct TFTP server and a boot file of "nms-3750-b.cfg" (as a test), and like magic, I had an automatically configured switch out-of-the-box.

ccardon Wed, 10/17/2007 - 23:22
User Badges:

Hello NetPros,


I came across two problems with autoinstall:


We have two servers, each running DHCP and TFTP services.


1. When using Option 150 with two TFTP IP addresses, the router/switch use only the first IP address. Therefore if your first TFTP service is down, the router/switch will not try to use the second one.


2. When using Autoinstall for switch, the configuration of vlan cannot be made from the configuration downloaded from the TFTP server.


If you have overcome these problems I would really appreciate an explanation.


Thank you in advance.


Best regards,

Christophe

Actions

This Discussion