Recently in IOS Foundations Category

Random Shortcut: Copy R S

| 13 Comments

I recently stumbled on this...If you try to shortcut copy running-config startup-config with anything shorter than copy run start you'll get an ambiguous command error (ex: copy ru st). However, the Cisco IOS does allow you to type copy r s as a shortcut. Who knew?

...Yes...I still like wr better too.

Thanks to JW for this one...

The bigger and bigger your configuration grows, the longer you have to wait for a "show run" output. This is because each time the show run command is executed, the router queries each interface to find the individual commands entered. To save you some wait time, Cisco introduced a command to cache your configuration in memory (for a measly 15K memory sacrifice):

Router(config)#parser config cache interface

Reduced the "show run" time on my 3640 router from 8 seconds down to 3. Nice! Keep in mind that you must execute the "show run" command once after issuing this in order to cache the configuration.

If you're interested, here's all the info:

http://www.cisco.com/en/US/docs/ios/12_3t/12_3t7/feature/guide/gtinvgen.html

Don't ya love it when you attempt to Telnet or SSH from a Cisco device to an unreachable IP address? You're guaranteed wait time is 30 seconds...and there's no CTRL-SHIFT-6 breaking out of it. Here's a command-of-the day for you:

Router(config)#ip tcp synwait-time 5

This reduces the time the router waits for a reply SYN-ACK message to 5 seconds (from 30 seconds default) for all TCP sessions (including Telnet/SSH) coming from the router.

While I'm sure there could be an argument made that some networks may be delayed enough to have more than I five second delay from a SYN to a SYN-ACK...I'd say...fix your network.

Handy Tip from the Cisco Wiki

| 5 Comments

Direct from the Cisco Wiki, a handy tip which allows you to show the complete configuration of Cisco devices without the breaks or pauses:

1. Type term len 0 in privileged mode to set your terminal to display without any breaks.
2. Type show run or show start to show the applicable config. The config will display without any breaks or pauses.

To display the config without lengthy certificate data, use show run brief.

This is useful for capturing the complete config for documentation purposes, especially if you do not have access via TFTP or the like.

Ivan Pepelnjak of Cisco IOS Hints and Tricks blog came up with even a more concise use of show ip interface brief:

To display IP addresses assigned to router's interfaces (excluding interfaces with no IP address) use show ip interface brief | exclude unassigned command.

Here is a sample printout:

C1#show ip int brief | excl unassigned  
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 172.16.0.1 YES NVRAM up up
Serial1/0 10.0.7.17 YES NVRAM up up
Loopback0 10.0.1.1 YES NVRAM up up
Tunnel0 192.168.0.1 YES manual up up

You could define an alias to create a new IOS command generating this printout, for example, alias exec ipconfig show ip interface brief | exclude unassigned.

Very nice...


My New Favorite IOS Command

| 7 Comments

I know I mentioned this command in passing a few posts ago, but this command has become so valuable to me, it needs its own post. It's the show run | section command. This allows you to define any "major heading" from the IOS configuration and it will filter the running configuration down to just those sections. This is very similar to how the ASA "show run" command works.

For example, I'm working on a book focused around CallManager Express (CME) right now. In CME, you create "ephones" which represent the IP Phones on your network. If I wanted to see the configuration for all my ephones, I can just type:

CME_Voice#show run | s ephone
max-ephones 24
ephone-dn 1
number 1000
ephone-dn 2 dual-line
number 1001
ephone-dn 3 dual-line
number 1003
ephone-dn 10 dual-line
number 1010
huntstop channel
ephone-dn 11
number 1010
preference 1
ephone 1
device-security-mode none
mac-address 0014.1C48.E71A
button 1:10
ephone 2
device-security-mode none
mac-address 0019.D122.DCF3
button 1:11
ephone 3
device-security-mode none
mac-address 0014.A89E.F845
button 1:1 2:2 3:3
ephone 4
device-security-mode none

(FYI - "s" is short for "section") As you can see, this shows all the sections of running-config that start with "ephone", which is all my ephones and ephone-dns (their directory numbers). Gotta love it!

Cisco Command Reference

| 10 Comments

Handy tip from Cisco TAC - if you've ever wanted to generate a command guide for your router, you can use the show parser dump command. Just type show parser dump <mode> where <mode> is the config mode of the router you'd like to see. For example:

CAT3550#show parser dump interface
Mode Name :interface

0 exit
0 help
15 description
15 switchport access vlan Number
15 switchport access vlan dynamic
15 switchport host
15 switchport mode access
15 switchport mode trunk
15 switchport mode dynamic auto
15 switchport mode dynamic desirable
15 switchport mode dot1q-tunnel
15 switchport trunk allowed vlan add
15 switchport trunk allowed vlan remove
15 switchport trunk allowed vlan except
15 switchport trunk allowed vlan all
15 switchport trunk allowed vlan none
15 switchport trunk allowed vlan
15 switchport trunk encapsulation isl
15 switchport trunk encapsulation dot1q
15 switchport trunk encapsulation negotiate
...

Generates a list of all commands from interface configuration mode. You can even see all the sub-commands and syntax description by typing show parser dump <mode> extend.

A list of commands you can use to filter output on a Cisco router:

show run | include <word>
show run | interface <interface>
show run | begin <word>
show run | section include <word>

The "section" command is my newest discovery. For example, if I want to see the configuration of ALL FastEthernet interfaces on my lab router, I could type:

PE1-T1#sh run | section include FastEthernet
interface FastEthernet1/0
description connection to PE1 Internet Router
ip address 51.88.99.2 255.255.255.252
speed 100
full-duplex
interface FastEthernet1/1
no ip address
shutdown
duplex auto
speed auto
interface FastEthernet2/0
no ip address
shutdown
duplex auto
speed auto
interface FastEthernet2/1
ip address 10.7.255.100 255.255.0.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
interface FastEthernet3/0
no ip address
shutdown
duplex auto
speed auto
interface FastEthernet3/1
no ip address
shutdown
duplex auto
speed auto

The folks over at NIL have put together an excellent article on using a Cisco router as a central DNS server for your organization. They also include a new feature called DNS Views - it allows you to configure your Cisco router for split-DNS: giving private addresses to servers accessible to internal users but public addresses to anyone else asking from the Internet. Nice!!!

Click here for the full story.

Configuration Replacement

| 3 Comments

The group over at NIL have written an nice article on the configure replace command. I've seen this command a couple times, but never used it. It allows you to replace the running configuration with a copy of the startup configuration (or some other config you have on a TFTP server). Previously, this was only possible by rebooting the router or using a ton of "no" commands to back all your configuration out. The router can even list what commands will be negated as it replaces the running configuration! Nice!

The command to pull it off is this:

Router#configure replace nvram:startup-config list

The "list" command on the end will list the syntax the router is adding or removing as it goes...very nice! The entire write-up on this can be found here.

Show Interface Description

| 9 Comments

Where on earth have I been?!? I'm teaching a CCNA class this week and one of my students showed me the command show interface description. Until now, I thought the only way to see the description of an interface was to do a "show run" or "show interface" command. This command is SWEET! Talk about a quick way to see your connections.

Here's a sample from the Cat. 3500 I use at home:


CAT_3550#show interface description
Interface                      Status         Protocol Description
Vl1                            up             up       
Vl50                           up             up       
Vl100                          up             up       SERVER VLAN
Vl200                          up             up       LAN CLIENT VLAN
Vl300                          up             up       WIRELESS CLIENT VLAN
Vl400                          up             up       EXIT VLAN
Vl600                          up             up       VOICE VLAN
Fa0/1                          up             up       CONNECTION TO QWEST ISP
Fa0/2                          down           down     CONNECTION TO 2801 OUTSIDE INTERFACE
Fa0/3                          up             up       VONAGE LINKSYS ROUTER
Fa0/4                          up             up       NETGEAR WPA-PSK WIRELESS
Fa0/5                          down           down     CONNECTION TO 2801 INSIDE INTERFACE

For years, I have been relying on outside tools to tack changes in running configurations on Cisco devices. One of my favorite (cheaper) tools has been Kiwi CatTools. However, recently, someone turned me on to the fact that this functionality is BUILT-IN to the Cisco IOS! Here's the basics:

The feature is called Configuraton Change Notification and Logging. It has been available since IOS 12.3(4)T/12.2(25)S (it has really gone mainstream in 12.4).

For each configuration command that is executed, the following information will be logged:

• The command that was executed
• The configuration mode in which the command was executed
• The name of the user that executed the command
• The time at which the command was executed
• A configuration change sequence number
• Parser return codes for the command

This information is here primarily for my reference at customer sites; for some odd reason, I seem to be recovering IOS images through ROMMON quite a bit lately. These are the minimum fields to get this going through TFTP rather than XModem.

rommon 1 > ...
IP_ADDRESS=192.168.1.100
IP_SUBNET_MASK=255.255.255.0
DEFAULT_GATEWAY=192.168.1.1
TFTP_SERVER=192.168.1.50
TFTP_FILE=c2600-adventerprisek9-mz.124-5a.bin
tftpdnld (this command kicks off the tftp download)

About this Archive

This page is an archive of recent entries in the IOS Foundations category.

Hardware is the previous category.

QoS is the next category.

Find recent content on the main index or look in the archives to find all content.