Beruflich Dokumente
Kultur Dokumente
Contents Keyboard shortcuts Filter output Skip through the configuration Do the do Insert question marks Disable domain lookup on typos Synchronous logging Revert a configuration to its default Show only applied access lists Speed up running-config display Changing the break character to Ctrl+C Show running configuration with all defaults Reload command Decrypting type-7 passwords in house on a device
Keyboard shortcuts
These shortcuts can be used to speed up operating with the CLI: Ctrl+B or Left Ctrl+F or Right Esc, B Esc, F Ctrl+A Ctrl+E Ctrl+P or Up Ctrl+N or Down Ctrl+T Ctrl+W Ctrl+U Ctrl+K Ctrl+X Ctrl+L Ctrl+C Ctrl+Z Move the cursor one character to the left Move the cursor one character to the right Move the cursor one word to the left Move the cursor one word to the right Move cursor to the beginning of the line Move cursor to the end of the line Retrieve last command from history Retrieve next command from history Swap the current character with the one before it Erase one word Erase the entire line Erase all characters from the current cursor position to the end of the line Erase all characters from the current cursor position to the beginning of the line Reprint the line Exit configuration mode Apply the current command and exit configuration mode
Filter output
Most show commands support filtering with the pipe (|) character, allowing a user to display only the information he's looking for. Switch# show interface status | include notconnect Gi1/0/7 notconnect 1 Gi1/0/9 notconnect 1 Gi1/0/22 notconnect 1
Filter options are include, exclude, and begin. The remaining characters after one of these filter types is processed as a regular expression, which could be a simple string (as in the example above) or something a bit more complex. The example below demonstrates filtering for interface numbers and any assigned IP addresses. http://packetlife.net/wiki/ios-tips/ Page 1
Switch# show run | include interface|ip address interface FastEthernet0 ip address 192.168.0.1 255.255.255.0 interface FastEthernet1 interface FastEthernet2 ip address 192.168.1.1 255.255.255.0 ip address 192.168.2.1 255.255.255.0 secondary interface FastEthernet3 You can also filter by section. Thanks to Carl Baccus to reminding me to include this. R1# show run | section bgp router bgp 100 no synchronization redistribute connected neighbor 172.16.0.2 remote-as 200 neighbor 172.16.0.9 remote-as 300 no auto-summary
Do the do
Exec commands can be issued from within configuration mode via the do command. This can be handy for double-checking the current configuration before applying any changes.
http://packetlife.net/wiki/ios-tips/
Page 2
Switch(config-if)# do show run int f0 Building configuration... Current configuration : 31 bytes ! interface FastEthernet0 description Internal LAN ip address 172.16.0.1 255.255.0.0 end
Synchronous logging
http://packetlife.net/wiki/ios-tips/
Page 3
When logging to the console is enabled, a Cisco device will often dump messages directly to the screen. This can become irritating when it interrupts you in the midst of typing a command. (FYI, you can continue typing normally and the command will still take, but this still throws some people off.) Synchronous logging can be enabled to "clean up" the CLI when this happens, outputting a fresh prompt below the message, along with any partially completed command. Switch(config)# line Switch(config-line)# Switch(config)# line Switch(config-line)# con 0 logging synchronous vty 0 15 logging synchronous
http://packetlife.net/wiki/ios-tips/
Page 4
Reload command
One of the classic mistakes is to incorrectly update an access-list on an interface when you are connected to the device remotely. And suddenly, the Telnet connection is dropped to the router because of a forgotten list entry that would permit your incoming connection. When you are doing something tricky, you can use the following feature of the reload command, which causes the router to reboot in a certain number of minutes. For example, let's tell the router to reboot in three minutes. Router# reload in 3 Reload scheduled in 3 minutes Proceed with reload? [confirm] Now, we have three minutes to do what we need to do. Let's say we are applying an access-list to serial0. Router# config terminal Enter configuration commands, one per line. Router(config)# interface serial0 Router(config-if)# ip access-group 110 in Router(config-if)# ^Z
We made the change and everything still works. (Well, at least our connection wasn't dropped.) Now all we have to do cancel the impending reload with the following command: Router# reload cancel If the reload is not canceled, all the changes made will be discarded since they only exist in the running configuration.
http://packetlife.net/wiki/ios-tips/
Page 5
then
Router(config)# key chain TEST Router(config-keychain)# key 1 Router(config-keychain-key)# key-string 7 06160E325F1F1E161713 Router(config-keychain-key)#sh key chain TEST Key-chain TEST: key 1 -- text "pass1word" accept lifetime (always valid) - (always valid) [valid now] send lifetime (always valid) - (always valid) [valid now]
http://packetlife.net/wiki/ios-tips/
Page 6