Another quick one. Today I’m going to cover a simple, but very useful OSPF command: “show ip ospf rib”. This command is similar to “show ip route ospf”, but goes a bit deeper.
If you’ve ever done a routing protocol migration, you know how important it can be to see each protocol’s full routing table. Much of the time AD makes this difficult. Administrative Distance (AD) is the believability of a routing protocol on a Cisco device. The default AD values are:
My “Show Run Variations” post sparked an interesting thread on Networking-Forum. I thought it would be nice to make a post with as many useful/little known commands as I can find. I might make a separate page for this depending on how much I can come up with and how frequently updates would be needed. Here we go:
show ip nbar protocol-discovery stats bit-rate top-n 10
This command will show you the top 10 protocols (that NBAR can see) on your router. I use this in an alias called “traffic”. You will also need “ip nbar protocol-discovery” enabled on interfaces you want to see statistics for.
show processes cpu sort
This command will show the sorted CPU usage of all processes running on the router. You could also use “show proc cpu history” to see some ASCII graphs of CPU utilization.
reload in 5
A recent thread on TechExams gave me the idea for a post on all the variations of the “show run” command. In this article I’ll go through the variations that I use the most, and some others that I don’t use much, but are pretty helpful.
Let’s take a look:
First we’ll look at all the options provided by IOS help:
EDGE#sh run ? all Configuration with defaults brief configuration without certificate data class-map Show class-map information control-plane Show Control-Plane information flow Global Flow configuration subcommands full full configuration interface Show interface configuration linenum Display line numbers in output map-class Show map class information policy-map Show policy-map information ssid Show Dot11 SSID information view View options vlan Show L2 VLAN information vrf Show VRF aware configuration | Output modifiers
I’m sure everyone reading this has used good old “sh run” many times. What about the other options? I use “sh run interface” quite a bit:
EDGE#sh run int fa0/0 ... interface FastEthernet0/0 description OUTSIDE ip address xx.xx.xx.xx 255.255.255.248 ip access-group OUTSIDE_IN in no ip redirects no ip unreachables no ip proxy-arp ip accounting access-violations ip nbar protocol-discovery ip nat outside ip virtual-reassembly load-interval 30 duplex auto speed auto no cdp enable service-policy input QoS_IN service-policy output SHAPER end
That and “sh run | section” are probably the variations I use most:
EDGE#sh run | sec ephone-dn ephone-dn 1 dual-line number 5001 no-reg primary label Colby name Colby ephone-dn 3 number 5003 no-reg primary label Laptop name Colby-Laptop ephone-dn 4 number 5004 no-reg primary name Wireless ephone-dn 5 number 5005 no-reg primary ephone-dn 6 number 5006 no-reg primary name Katie ephone-dn 11 dual-line number 555-555-5555 label 555-555-5555 name Colby
That one is perfect for times when you are looking for specific parts of the config, without having to wade through everything.
A new one I just learned from Networking-Forum:
EDGE#sh run Building configuration... ! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec service password-encryption ! /ospf <--- I typed this filtering... router ospf 200 router-id 192.168.254.254 log-adjacency-changes network 192.168.5.0 0.0.0.255 area 1 network 192.168.13.0 0.0.0.3 area 0 network 192.168.254.254 0.0.0.0 area 0
This is a short article on the NetFlow “top-talkers” CLI feature, which I didn’t know about before today. NetFlow is a tool for monitoring traffic flows, it’s particulalry handy when you’re trying to find out what host or protocol is saturating a network. Obviously the pretty GUI NetFlow collectors are better for many things, but the CLI method can be really helpful if you’re looking for something quickly. Here’s the config:
Here’s the config from my outside interface.
interface FastEthernet0/0 description OUTSIDE ip address xx.xx.29.218 255.255.255.248 ip flow ingress ip flow egress
I’ve enabled NetFlow with the “ip flow” commands.
Here are the commands to enable the “top-talkers” feature at the CLI.
EDGE(config)#ip flow-top-talkers EDGE(config-flow-top-talkers)# top 25 EDGE(config-flow-top-talkers)# sort-by bytes EDGE(config-flow-top-talkers)# cache-timeout 5000 EDGE(config-flow-top-talkers)#^Z
Pretty simple, we’ve set how many conversations to show, then we can sort by bytes or packets, finally we set our timeout (in milliseconds).
Now we’ll look at the show command:
EDGE#sh ip flow top-talkers SrcIf SrcIPaddress DstIf DstIPaddress Pr SrcP DstP Bytes Fa0/1 xx.xx.29.221 Fa0/0* 184.108.40.206 06 F6B9 9C40 77K Fa0/1 xx.xx.29.218 Fa0/0* 220.127.116.11 06 01BB EF24 12K Fa0/1 xx.xx.29.221 Fa0/0* 18.104.22.168 06 7F23 EC43 10K Fa0/1 xx.xx.29.221 Fa0/0* 22.214.171.124 06 7F23 0CB7 9216 Fa0/0 126.96.36.199 Fa0/1 xx.xx.29.221 06 EC74 7F23 5088 Fa0/0 188.8.131.52 Fa0/1 xx.xx.29.218 06 EF24 01BB 2680 Fa0/0 184.108.40.206 Fa0/1 xx.xx.29.221 06 0E20 7F23 2297 Fa0/1 xx.xx.29.221 Fa0/0* 220.127.116.11 06 7F23 0E20 2162 Fa0/0 18.104.22.168 Fa0/1 xx.xx.29.221 06 C220 7F23 2100 Fa0/1 xx.xx.29.221 Fa0/0* 22.214.171.124 06 7F23 C220 2072 Local xx.xx.29.218 Fa0/0* 126.96.36.199 32 033B B7EC 2000 Fa0/0 188.8.131.52 Fa0/1 xx.xx.29.221 06 D788 7F23 1838 Fa0/1 xx.xx.29.221 Fa0/0* 184.108.40.206 06 7F23 D788 1832 Fa0/1 xx.xx.29.221 Fa0/0* 220.127.116.11 06 7F23 F5BC 1717 Fa0/0 18.104.22.168 Fa0/1 xx.xx.29.221 06 9C40 F6B9 1276 Fa0/0 22.214.171.124 Fa0/1 xx.xx.29.221 06 F5BC 7F23 1067 Fa0/1 xx.xx.29.218 Fa0/0* 126.96.36.199 06 1853 0050 872 Fa0/1 xx.xx.29.221 Fa0/0* 188.8.131.52 06 7F23 8736 868 Fa0/0 184.108.40.206 Local xx.xx.29.218 2F 0000 0000 816 Fa0/0 220.127.116.11 Fa0/1 xx.xx.29.221 06 DABF 7F23 767 Fa0/0 18.104.22.168 Fa0/1 xx.xx.29.221 06 08A8 7F23 617 Tu103 xx.xx.29.218 Fa0/0* 22.214.171.124 32 0CED D9C9 616 Fa0/0 126.96.36.199 Fa0/1 xx.xx.29.218 06 0050 1853 594 Fa0/1 xx.xx.29.221 Fa0/0* 188.8.131.52 06 7F23 08A8 499 Fa0/0 184.108.40.206 Fa0/1 xx.xx.29.221 06 1F37 C0E5 372
This is just a quick post about an awesome little command I just saw on Networking-Forum. The command is “default interface”. First we’ll look at an interface config:
CORE#sh run int gi0/32 [...] interface GigabitEthernet0/32 switchport access vlan 10 switchport mode access spanning-tree portfast end
Now we’ll run the command:
CORE(config)#default interface GigabitEthernet0/32 Interface GigabitEthernet0/32 set to default configuration
CORE#sh run int gi0/32 [...] interface GigabitEthernet0/32 end
You can also use this with the “interface range” command if you want to reset a bunch of ports to their default settings. Simple little command with a lot of power.