2015年2月10日星期二

Booting Router from a Local TFTP server

When working with Cisco routers, many-a-times we wish to boot the router from a local TFTP server. Here is a brief description of how the router can be configured to boot from a TFTP server.
 
Step 1: Setting up required variables in ROMMON
Whenever a Cisco router boots up, it initially goes into the ROMMON mode and then boots up into the IOS from there. Now, inorder to boot up into the IOS, it obviously needs access to the IOS from ROMMON. So, inorder to boot from the TFTP server, we first need to ensure that the router has access to the TFTP server from ROMMON mode, from where it can download the IOS each time that the router needs to boot up.
There are some variables which we need to set in ROMMON mode, which will ensure that the IOS gets downloaded from TFTP.
So, here are the sequence of events that we need to carry out to set these variables.
  • Power cycle the router, and during bootup, press ctrl + break continuously so that the router goes into ROMMON mode.
  • Once in ROMMON, give the following commands:
rommon 1 > IP_ADDRESS=<ip address of router interface>
rommon 2> IP_SUBNET_MASK=<subnet mask for the above IP>
rommon 3 > DEFAULT_GATEWAY=<default gateway for router (can be same as TFTP server IP)>
rommon 4 > TFTP_SERVER=<IP address of TFTP server>
rommon 5 > TFTP_FILE=<name of IOS to be used for bootup (including the .bin extension)>
rommon 6> tftpdnld –r
(the ‘-r’ parameter ensures that when the IOS is downloaded, it is not stored in flash, but is directly decompressed into the DRAM during router bootup. So the flash is completely bypassed here.)
Once the above commands are entered, the router will start downloading the IOS from the TFTP server. After the download is complete, the router will reload automatically, and boot up into the IOS that was specified above.
The ‘show version’ output will have the following statement:
System image file is "tftp://<IP of tftp server>/<IOS image name>"
This step ensured that we have the correct variables set up in ROMMON for the router to reach the TFTP server and download the IOS from there on subsequent boot-ups.

Step 2: Changing boot variable in the IOS
Now that the router has booted successfully into the IOS and all the required variables have been set up in ROMMON, all that is left to do is to set the boot variable to point to the TFTP server in the IOS, so that the router looks for the TFTP server during bootup to find the IOS image.
This can be configured by the following command in global configuration mode:
Router(config)# boot system tftp <IOS image name> <IP of TFTP server>
Save the configurations.

We have now setup all the desired variables (in ROMMON and in the IOS) to ensure that the next time that the router boots up, it will download the IOS from the TFTP server, decompress it and then boot into the IOS.
Please note that since the IOS has to be downloaded from the TFTP server each time that the router boots up, the boot up process takes a bit of time.

It refers from:
https://supportforums.cisco.com/blog/150396/booting-cisco-router-tftp-server


没有评论:

发表评论