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

Binary Metal Guitar

Binary Metal Guitar

Thank you Ed for sharing the video the led me to find this video. It's a national treasure for those of us that appreciate binary. And if you appreciate metal, or music in …

Read More
Ixia Vision ONE – Tap the Planet

Ixia Vision ONE – Tap the Planet

Whenever I start talking about network visibility and aggreagation taps I can’t help but think of The Matrix. Millions of packets flowing through your network every minute of every …

Read More
Stop using 192.168.1.0/24: A Contrarian Guide to Home Network Addressing

Stop using 192.168.1.0/24: A Contrarian Guide to Home Network Addressing

If you’re a contractor, consultant, or anyone who VPNs into multiple client networks, you’ve experienced the pain. You connect to a Client’s VPN, and suddenly you …

Read More