Here's a couple of things I've picked up when playing with Cisco kit
No guarantees of accuracy
- Wading through 'show run' output: sometimes it can be a pain to wade through an entire config just to look at one or two sections.
Thankfully Cisco have taken a leaf out of the Unix shell book, and included pipes. Here's a simple example - what did I set the SNMP
community to?:
1841Test#show run | include snmp snmp-server community public RO 1841Test#
Ok, that's definitely an improvement on trying to use Cisco's pager [think 'more' rather than 'less'] to find something in the config. But what if you wanted to see the OSPF config?:1841Test#show run | include ospf router ospf 1 1841Test#
Well, that's not really much use, is it? Luckily there's a 'section' modifier:1841Test#show run | section ospf router ospf 1 router-id 192.168.1.251 log-adjacency-changes redistribute connected subnets network 192.168.1.0 0.0.0.255 area 0 1841Test#
- How do I see DSL line stats?: this information can be had with the 'show dsl interface atmN' command, where 'N'
is the interface number. The format of the output depends on your DSL WIC/IOS release:
1841Test#show dsl interface atm 0 Interleave Fast Interleave Fast Speed (kbps): 0 8128 0 736 Cells: 0 29315953 0 345523097 Reed-Solomon EC: 0 0 17 8 CRC Errors: 0 1628 19 141 Header Errors: 0 1266 17 89 Total BER: 0E-0 65535E-255 Leakage Avarage BER: 0E-0 65535E-255 ATM0 is up, line protocol is up Hardware is MPC ATMSAR (with Alcatel ADSL Module) MTU 4470 bytes, sub MTU 4470, BW 736 Kbit, DLY 500 usec, reliability 255/255, txload 20/255, rxload 141/255 Encapsulation ATM, loopback not set Encapsulation(s): AAL5 AAL2, PVC mode 10 maximum active VCs, 1024 VCs per VP, 1 current VCCs VC Auto Creation Disabled. VC idle disconnect time: 300 seconds Last input never, output 00:00:00, output hang never Last clearing of "show interface" counters 00:33:26 Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: Per VC Queueing 5 minute input rate 409000 bits/sec, 55 packets/sec 5 minute output rate 58000 bits/sec, 39 packets/sec 98737 packets input, 88671470 bytes, 0 no buffer Received 0 broadcasts, 0 runts, 0 giants, 0 throttles 0 input errors, 2 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 71598 packets output, 14488894 bytes, 0 underruns 0 output errors, 0 collisions, 0 interface resets 0 output buffer failures, 0 output buffers swapped outATM0/1/0 Alcatel 20150 chipset information ATU-R (DS) ATU-C (US) Modem Status: Showtime (DMTDSL_SHOWTIME) DSL Mode: ITU G.992.1 (G.DMT) Annex A ITU STD NUM: 0x01 0x1 Vendor ID: ' ' 'TSTC' Vendor Specific: 0xDBB0 0x0000 Vendor Country: 0x04 0xB5 Capacity Used: 94% 59% Noise Margin: 7.5 dB 22.0 dB Output Power: 20.0 dBm 12.0 dBm Attenuation: 21.0 dB 10.5 dB Defect Status: None None Last Fail Code: None Watchdog Counter: 0x83 Watchdog Resets: 0 Selftest Result: 0x00 Subfunction: 0x15 Interrupts: 2650 (0 spurious) PHY Access Err: 0 Activations: 1 LED Status: ON LED On Time: 100 LED Off Time: 100 Init FW: embedded Operation FW: embedded FW Version: 3.8.131 Interleave Fast Interleave Fast Speed (kbps): 8096 0 448 0 Cells: 71810032 0 802795561 0 Reed-Solomon EC: 1901 0 389 350 CRC Errors: 1341 0 533 349 Header Errors: 592 0 324 280 Bit Errors: 0 0 BER Valid sec: 0 0 BER Invalid sec: 0 0 (snipped)
- How do I see some of the config without exiting the configuration context? We've all done it - started configuring, and then realised
we need to see a vital bit of info, but don't want to cancel half way through. Thankfully there's the 'do' command:
1841Test#conf t Enter configuration commands, one per line. End with CNTL/Z. 1841Test(config)#int Loopback0 1841Test(config-if)#ip address 192.168.192.10 255.255.255.0 1841Test(config-if)#no shut 1841Test(config-if)#show run ^ % Invalid input detected at '^' marker. 1841Test(config-if)#do show run Building configuration... Current configuration : 1622 bytes ! version 12.4 (snipped) - How do I get my device to set its clock by NTP? You may need to enable DNS lookups first:
1841Test(config)#ip name-server 192.168.1.3 1841Test(config)#ip domain lookup 1841Test(config)#ntp server pool.ntp.org
However, this won't quite work as expected for round-robin DNS NTP servers like pool.ntp.org, as the router will only resolve the name to an IP once, which somewhat defeats the purpose. - How do I monitor multiple gateways, and only use one that's working? This is a complex area, and the following is
the simplest possible implementation: monitoring two gateways on one subnet, and switching over when one goes down.
Our Cisco has one interface on the 192.168.1.0/24 subnet, and there are two possible default gateways, 192.168.1.3 and 192.168.1.252. We prefer 192.168.1.252.! ip sla monitor 103 type echo protocol ipIcmpEcho 192.168.1.3 timeout 300 frequency 3 ip sla monitor schedule 103 life forever start-time now ! track 103 rtr 103 reachability delay down 10 up 20 ! ip route 0.0.0.0 0.0.0.0 192.168.1.3 20 track 103 ! ! ip sla monitor 152 type echo protocol ipIcmpEcho 192.168.1.252 timeout 300 frequency 3 ip sla monitor schedule 152 life forever start-time now ! track 152 rtr 152 reachability delay down 10 up 20 ! ip route 0.0.0.0 0.0.0.0 192.168.1.252 10 track 152
Bear in mind that if you try to modify the 'ip sla monitor nnn' object whilst it's scheduled, you will see this:1841Test(config)#ip sla monitor 103 Entry already running and cannot be modified (only can delete (no) and start over) (check to see if the probe has finished exiting)The trick is to un-schedule the object first:no ip sla monitor schedule 103 life forever start-time now
Use the links on the left hand side to navigate the site