Cisco IOS Tips and Tricks

Cisco IOS Tips and Tricks

So, I’m sure these have been posted almost on every networking blog under the sun, but who knows, right? Here are a few tips and tricks to help you move around the IOS a bit faster, find information faster, and locate problems… faster.

Keyboard Shortcuts

If you’re anything like me, having to switch between the keyboard mouse feels like such a waste of time. If I can do it from the keyboard I will! I’m still waiting for a way to use photoshop 100% from the keyboard.. but I digress. These are the keyboard shortcuts I find myself using the most.

CommandAction
Ctrl+AMove cursor to the beginning of the line
Ctrl+EMove cursor to the end of the line
UpRetrieve last command from history
DownRetrieve last command from history
Ctrl+WErase previous word
Ctrl+UErase the entire line
Ctrl+CExit configuration mode
Ctrl+ZApply the current command and exit configuration mode

Modifying output

You may of seen the | symbol listed as an option when using IOS help, but have you ever used it? You will now. The options for filtering include begin, section, exclude and include.

Begin filters everything until the first instance of your specified pattern.

Router# show run | begin bgp
router bgp 65500
 no synchronization
...
!
end

Section includes only the section of the config you specify

Router# show run | section int
interface FastEthernet0/0
 no ip address
 shutdown
 speed auto
 duplex auto
interface FastEthernet0/1
 no ip address
 shutdown
 speed auto
 duplex auto

Exclude filters lines that match your pattern

Router# show run | exclude !
Building configuration...

Current configuration : 754 bytes
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
hostname Router
boot-start-marker
boot-end-marker
no aaa new-model
...
end

Include only includes lines that match your pattern. I realized that until now I have only included output from show run, and I have yet to mention that your pattern can contain regular expressions. So I will show you two examples of this being used.

Router# show run | inc ^interface|ip address
interface FastEthernet0
 ip address 192.168.0.1 255.255.255.0
interface FastEthernet1
 ip address 192.168.1.1 255.255.255.0
 ip address 10.1.1.1 255.255.255.0 secondary

Here is a second example that shows what interfaces have ACLs applied. In a future post I will dive deeper into regular expressions.

Router# sh ip int | inc line protocol|access list is [^ ]+$
FastEthernet0 is up, line protocol is up
  Inbound access list is deny10
FastEthernet1 is up, line protocol is up
  Inbound access list is 11
FastEthernet2 is up, line protocol is up

I hope some of these tips will help you out, in the future I will continue to publish more tidbits that will help you optimize your configurations. If you think I’ve left anything out, please comment below!

Tags :
comments powered by Disqus

Related Posts

NEC and ProgrammableFlow Switching

NEC and ProgrammableFlow Switching

NEC is currently the only Vendor that is shipping an OpenFlow enabled product today. So naturally, their presentation led off with a message about what they’re bringing to the …

Read More
Installing VMware tools on Cisco ACS

Installing VMware tools on Cisco ACS

As of ACS v5.4 Cisco has finally included VMware tools for their ADE OS. Unfortunately, when you upgrade, they do not get installed automatically as the installation is triggered …

Read More
Forward Networks – A forward approach to formal verification

Forward Networks – A forward approach to formal verification

Forward Networks has stepped out of the shadows to announce their Network Assurance platform, and I was fortunate enough to be a delegate for Networking Field Day 13 to see their …

Read More