Blog Posts in April 2007
b2#show ip route
Default gateway is 192.168.0.5
Host Gateway Last Use Total Uses Interface
22.214.171.124 192.168.0.10 0:00 13 FastEthernet0/0
Disabling IP routing on a router makes perfect sense if you use it as a (reverse) terminal server or telnet-to-X.25 gateway.
The show output can be redirected to a local filename (in flash, on usb token or even in NVRAM) or sent to a remote server (currently only FTP and TFTP servers are supported). For example, the show ip interface brief | redirect ftp://student:[email protected]/ifstatus command will store the current interface status to an FTP server.
Note: the append (or tee /append) operation only works on destinations that support the file append operation: class-C flash file systems, local disks, USB tokens and NVRAM.
Embedded Event Manager (EEM) solves this issue as well. You just configure an applet that triggers on syslog message SYS-5-RESTART and reapplies the necessary configuration commands.
To change the login prompts when using RADIUS servers, use the aaa authentication [banner|fail-message|password-prompt|username-prompt] text configuration command.
Recent IOS releases are more lenient: router with a change in summary address requests a resync (logged as graceful-restart on adjacent routers). A lot of updates and queries are still sent, but the adjacencies themselves are preserved:
- When configuring a summary route, all more specific prefixes on downstream routers enter active state.
- When a summary is removed, only the summary prefix itself enters active state and the affected router sends queries to all its neighbors, while the more specific prefixes are sent as regular EIGRP updates to the neighbors across the affected interface.
- Before starting the ping, set the line escape character to something you can generate from your keyboard (otherwise you won't be able to stop end the command). For example, terminal escape 3 will set the escape character to Ctrl-C.
- Start the ping with the ping ip destination repeat very-large-value command. For example, ping ip 10.0.0.1 repeat 1000000 will ping the target host longer than you'll be willing to wait.
event manager applet ClearAllYou can trigger this applet with the event manager run ClearAll command or you could configure a command alias, for example alias exec cleanup event manager run ClearAll.
action 1.0 cli command "clear ip route *"
action 2.0 cli command "clear ip bgp *"
Note: this article is part of You've asked for it series.
The theory behind warm reload is simple: the router saves initial data (as stored in IOS image) in a separate memory region and reuses saved data together with IOS code already residing in RAM to restart IOS. Of course, the IOS code (depending on platform's memory management capabilities) or saved data could get corrupted, therefore the warm reload cannot be used continuously (and the router falls back to traditional reload if the router crashes before a specified time interval).
Warm reload is configured with the warm-reboot count number uptime minutes configuration commands. After it has been configured, a router reload (or power-up) is needed to initialize the saved data region. When the warm reboot is operational (as verified with the show warm-reboot command), you can use reload warm command to start it.
When pinging a directly-attached host (end-station) from a router, it's quite common to lose the first reply, as shown in the following example (the same symptom might occur when pinging a remote host that has been inactive).
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.10, timeout is 2 seconds:
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/4 ms
Actually, it's not the reply that was lost, the request was never sent out. Whenever a router has to send a packet to the next-hop (or directly attached destination) that has no entry in the ARP table, the ARP request is sent out, but the original packet is unconditionally dropped.
In a previous post, I’ve described how to execute a Tcl file with the tclsh command.
You can do even more than that: you can pass parameters to the executed file. Every word you enter after the file name in the tclsh command line is passed as a parameter to the Tcl code you execute. To get these parameters in Tcl, use Tcl commands similar to the code below:
One of my readers has asked an interesting question: can you reload a router when pinging a specific IP address from it fails? While there are other ways of dealing with stuck interfaces or routing processes, sometimes such a drastic measure is the only workaround, so here's how you do it:
- When the router is reloaded, ROMMON reads the router configuration and tries to start the required image
- If ROMMON cannot load the image specified in the boot system command, it starts the default image (usually whatever is stored in on-board flash)
- When the first IOS image loads (after being copied and decompressed in most cases), it discovers that it's not the correct image
- The now-operational IOS image loads the new image in RAM (in our case from usbflash1:), decompresses it and transfers the control to it
The Tcl procedures used to execute IOS commands in Embedded Event Manager (cli_open, cli_write …) don’t work when you start Tcl shell from command line interface. To execute IOS commands in this context, use:
- exec command to execute an exec-level command, for example exec “show ip route”
- ios_config mode command to configure the router
If the first parameter of the ios_config command is a global configuration command, you shall omit the second parameter (for example, ios_config “hostname router”). To configure a parameter in one of the sub-configuration modes (for example, interface state), use the first parameter to specify the configuration mode and the second parameter as the actual configuration command (for example, ios_config “interface loop 0” “no shutdown”).