Sunday, May 1, 2011

Environment variables

Environment variables
5.2.7
This page will explain what the ROMmon environment variables are and how they are used.
The IOS can also be restored from a TFTP session. The fastest way to restore an IOS image to the router is to use TFTP from ROMmon to download the image. To do this, set the environmental variables and then use the tftpdnld command.
Since the ROMmon has very limited functions, no configuration file is loaded during boot. As a result, the router has no IP or interface configuration. The environmental variables provide a minimal configuration to allow for the TFTP of the IOS. The ROMmon TFTP transfer works only on the first LAN port so a simple set of IP parameters are set for this interface. To set a ROMmon environment variable, type the variable name, then the equal sign (=), and the value for the variable. For example, to set the IP address to 10.0.0.1, type IP_ADDRESS=10.0.0.1 at the ROMmon prompt. 
Note:
All variable names are case sensitive.
The minimum variables required to use tftpdnld are as follows:
  • IP_ADDRESS - The IP address on the LAN interface
  • IP_SUBNET_MASK - The subnet mask for the LAN interface
  • DEFAULT_GATEWAY - The default gateway for the LAN interface
  • TFTP_SERVER - The IP address of the TFTP server
  • TFTP_FILE - The IOS filename on the server
Use the set command to check the ROMmon environment variables. 
Once the variables are set for the IOS download, the tftpdnld command is entered with no arguments. The ROMmon will echo the variables and then a confirmation prompt will appear with a warning that this will erase the flash. 
As each datagram of the IOS file is received, an exclamation point (!) will be displayed. When the complete IOS file has been received, the flash will be erased and the new IOS image file written. Appropriate messages will be displayed as the process is completed.
When the new image is written into flash and the ROMmon prompt is displayed, the router can be restarted by entering the reset command or typing i. The router should now boot from the new IOS image in flash.
The next page will describe some commands that can be used to verify a router file system.

No comments:

Post a Comment