Archive

Archive for March, 2010

Troubleshooting Spanning Tree Protocol

March 29th, 2010 jud No comments

Spanning Tree Protocol Basics:
In a layer 2 environment with no routing, active redundant paths are neither allowed nor desirable, because that can cause loops. Because a switch only segments collision domains it does not segment broadcast domains. STP helps find redundant links and place one in a blocking state.

STP Definitions:

  • Root bridge — Center of the spanning tree.
  • Nonroot bridge — Every switch not elected the root.
  • Root port — Every nonroot bridge has a single root port, decided based on root path cost.
  • Designated port — Each segment has a single designated port. All ports on a root bridge are designated.
  • Nondesignated port — Every switch port that is neither a root port nor designated port starts blocking.
    Basic Spanning Tree Operation:

  1. Elect root bridge — Lowest bridge ID wins, consists of 2 bytes from 0-65,535 defaults to 32,678 + VLAN and the MAC address of 6 bytes, for example 32769 000a.b7d1.9580 for VLAN 1.
  2. Select root port — One per switch, points toward the root bridge.
  3. Select designated port — One per segment with the lowest root patch cost.
  4. Block ports — Block non-root and non-designated ports.

Spanning Tree Port States:

STP State The Port Can… The Port Cannot… Duration
Disabled Nothing Send/Receive Data
Blocking Receive BPDU's Send/Receive Data
Learn MAC Addresses
Indefinite if loop detected
Listening Send/Receive BPDUs Send/Receive data Forward Delay Timer
(15 Seconds)
Learning S/R BPDU's S/R data Forward Delay Timer
(15 Seconds)
Forwarding S/R Data
S/R BPDU's
Learn MAC Addresses

Securing STP
Root Guard — Is enabled on a per-port basis. When a port receives a superior BPDU, with a lower bridge ID, the local switch will not allow the new switch to become the root. Instead the port is changed to root-inconsistent state, no data can be sent or received until the BPDUs stop.

BPDU Guard — PortFast moves an end-user port to forwarding state without going through all of the STP checks and can induce loops in the network. If any BPDU is received on a port where BPDU guard is enabled that port is put into errdisable state. It can then be recovered manually or through the errdisable timeout function.

Strategy for troubleshooting STP:
Find the root bridge, then learn the designated ports on each subsequent switch. Cisco switches run PVST by default so you will have to work through each vlan.

Commands for STP Troubleshooting:
sh spanning-tree — View all STP parameters for all VLANs.
sh spanning-tree [int fa0/1] detail — View all STP details.
sh spanning-tree [vlan 2] summary — View ports in each of the STP states.
sh spanning-tree [vlan 2] root — Find root bridge ID, root port and root path cost.
sh spanning-tree [vlan 2] bridge — Show local switch bridge ID and STP timers.
sh spanning-tree uplinkfast — Show uplinkfast status.
sh spanning-tree backbonefast — Show the backbonefast status.

sh spanning-tree

ASW1#sh spanning-tree

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     000a.b7d1.9580
             Cost        24
             Port        65 (Port-channel13)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     0013.c36a.4880
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Po13             Root FWD 12        128.65   P2p
Po23             Altn BLK 19        128.66   P2p

         
VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    32778
... output omitted for brevity ...

sh spanning-tree int po23 det

ASW1#sh spanning-tree int po23 det
 Port 66 (Port-channel23) of VLAN0001 is blocking
   Port path cost 19, Port priority 128, Port Identifier 128.66.
   Designated root has priority 32769, address 000a.b7d1.9580
   Designated bridge has priority 32769, address 0018.1825.2500
   Designated port id is 128.232, designated path cost 12
   Timers: message age 3, forward delay 0, hold 0
   Number of transitions to forwarding state: 0
   Link type is point-to-point by default
   BPDU: sent 2, received 215029

sh spanning-tree vlan 10 summary

ASW1#sh spanning-tree vlan 10 summary
Switch is in pvst mode
Root bridge for VLAN0010 is 32778.000a.b7d1.9580.
Extended system ID           is enabled
Portfast Default             is disabled
PortFast BPDU Guard Default  is disabled
Portfast BPDU Filter Default is disabled
Loopguard Default            is disabled
EtherChannel misconfig guard is enabled
UplinkFast                   is disabled
BackboneFast                 is disabled
Configured Pathcost method used is short

Name                   Blocking Listening Learning Forwarding STP Active
---------------------- -------- --------- -------- ---------- ----------
VLAN0010                     1         0        0          3          4

show spanning-tree root

ASW1#sh spanning-tree root

                                        Root    Hello Max Fwd
Vlan                   Root ID          Cost    Time  Age Dly  Root Port
---------------- -------------------- --------- ----- --- ---  ------------
VLAN0001         32769 000a.b7d1.9580        24    2   20  15  Po13            
VLAN0010         32778 000a.b7d1.9580        24    2   20  15  Po13            
VLAN0020         32788 000a.b7d1.9580        24    2   20  15  Po13            
VLAN0021         32789 000a.b7d1.9580        24    2   20  15  Po13            
VLAN0200         32968 000a.b7d1.9580        24    2   20  15  Po13

show spanning-tree bridge

ASW1#sh spanning-tree bridge

                                                   Hello  Max  Fwd
Vlan                         Bridge ID              Time  Age  Dly  Protocol
---------------- --------------------------------- -----  ---  ---  --------
VLAN0001         32769 (32768,   1) 0013.c36a.4880    2    20   15  ieee        
VLAN0010         32778 (32768,  10) 0013.c36a.4880    2    20   15  ieee        
VLAN0020         32788 (32768,  20) 0013.c36a.4880    2    20   15  ieee        
VLAN0021         32789 (32768,  21) 0013.c36a.4880    2    20   15  ieee        
VLAN0200         32968 (32768, 200) 0013.c36a.4880    2    20   15  ieee
Categories: CCNP TSHOOT, Routing Tags:

Layer 2 Switch Troubleshooting

March 28th, 2010 jud 2 comments

I felt like my last set of notes for the Troubleshooting Toolbox had information that that was hidden in the command output. The output is for myself to play with the commands, however, I don’t want useful information hidden. So I am going to try a different setup with this set of notes and possibly an entirely different format for the next set until I find something that is easy for me to go back and study. Bear with me.

Commands for troubleshooting MAC addresses:
sh mac address-t dyn — Whether or not a host is communicating with the switch.
clear mac address-t dyn — Clear the MAC address address of dynamically learned mac addresses.

show mac-address-table dynamic
Shows the MAC addresses learned by a switch and it’s port. Useful to see whether or not a switch is learning the mac of a host, if the MAC address is not in the table, the problem is upstream from the current switch.

ASW1#sh mac address-table dynamic
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
   1    0012.d9a5.1515    DYNAMIC     Po13
   1    0012.d9a5.1516    DYNAMIC     Po13
  10    0000.0c07.ac0a    DYNAMIC     Po13
  10    0004.dd69.fd01    DYNAMIC     Fa0/2
  10    0012.d9a5.1516    DYNAMIC     Po13
  10    0012.d9a5.1545    DYNAMIC     Po13
  10    0018.1825.2546    DYNAMIC     Po13
  10    00d0.bbef.64c1    DYNAMIC     Fa0/1
 200    0012.d9a5.1516    DYNAMIC     Po13
  20    0004.76f2.4ee8    DYNAMIC     Po13
  20    0012.d9a5.1516    DYNAMIC     Po13
  20    0018.1825.2547    DYNAMIC     Po13
Total Mac Addresses for this criterion: 12

clear mac address-table dynamic
Clear out the table. This way you know a mac address was learned recently. Notice in this sample that the hosts on fa0/1 and 2 had not yet been learned in the first sh mac address-table command.

ASW1#clear mac-address-table dynamic
ASW1#sh mac address-table dynamic    
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
   1    0012.d9a5.1515    DYNAMIC     Po13
   1    0012.d9a5.1516    DYNAMIC     Po13
  10    0000.0c07.ac0a    DYNAMIC     Po13
  10    0012.d9a5.1516    DYNAMIC     Po13
  10    0012.d9a5.1545    DYNAMIC     Po13
  10    0018.1825.2546    DYNAMIC     Po13
  10    00d0.bbef.64c1    DYNAMIC     Fa0/1
 200    0012.d9a5.1516    DYNAMIC     Po13
  20    0012.d9a5.1516    DYNAMIC     Po13
  20    0018.1825.2547    DYNAMIC     Po13
Total Mac Addresses for this criterion: 10
ASW1#clear mac-address-table dynamic
ASW1#sh mac address-table dynamic    
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
   1    0012.d9a5.1516    DYNAMIC     Po13
  10    0000.0c07.ac0a    DYNAMIC     Po13
  10    0012.d9a5.1516    DYNAMIC     Po13
 200    0012.d9a5.1516    DYNAMIC     Po13
  20    0012.d9a5.1516    DYNAMIC     Po13
Total Mac Addresses for this criterion: 5

Commands to troubleshoot VLANs:
sh vlan
sh vlan br
sh int tru
sh int fa0/1 swi

show vlan
Allows you to verify a VLAN exists and shows which ports belong ti which VLANs.

ASW1#sh vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/3, Fa0/4, Fa0/5, Fa0/6
                                                Fa0/7, Fa0/8, Fa0/9, Fa0/10
                                                Fa0/11, Fa0/12, Fa0/13, Fa0/14
                                                Fa0/15, Fa0/16, Fa0/17, Fa0/18
                                                Fa0/21, Fa0/23, Fa0/24, Gi0/1
                                                Gi0/2
10   VLAN0010                         active    Fa0/1, Fa0/2
20   20Testing                        active    
21   SPAN                             active    
200  200Test                          active    
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0  
10   enet  100010     1500  -      -      -        -    -        0      0  
20   enet  100020     1500  -      -      -        -    -        0      0  
         
VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
21   enet  100021     1500  -      -      -        -    -        0      0  
200  enet  100200     1500  -      -      -        -    -        0      0  
1002 fddi  101002     1500  -      -      -        -    -        0      0  
1003 tr    101003     1500  -      -      -        -    srb      0      0  
1004 fdnet 101004     1500  -      -      -        ieee -        0      0  
1005 trnet 101005     1500  -      -      -        ibm  -        0      0  

Remote SPAN VLANs
------------------------------------------------------------------------------
21

Primary Secondary Type              Ports
------- --------- ----------------- ------------------------------------------

show int trunk
Which ports or trunk ports and what vlans are allowed.

ASW1#sh int trunk

Port        Mode         Encapsulation  Status        Native vlan
Po13        on           802.1q         trunking      1
Po23        on           802.1q         trunking      1

Port      Vlans allowed on trunk
Po13        1-4094
Po23        1-4094

Port        Vlans allowed and active in management domain
Po13        1,10,20-21,200
Po23        1,10,20-21,200

Port        Vlans in spanning tree forwarding state and not pruned
Po13        1,10,20-21,200
Po23        none

show int switchport
Displays summary information about a port.

ASW1#sh int fa0/1 switchport
Name: Fa0/1
Switchport: Enabled
Administrative Mode: static access
Operational Mode: static access
Administrative Trunking Encapsulation: negotiate
Operational Trunking Encapsulation: native
Negotiation of Trunking: Off
Access Mode VLAN: 10 (VLAN0010)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
         
Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none

Etherchannel:
Ehterchannel binds multiple physical interfaces into one logical interface.

Commands to troubleshoot etherchannel:
I include couple of sh run commands because it is most common to have configuration errors when working with etherchannel as you are dealing with multiple switches.
sh etherchannel
sh etherchannel 13 summary
sh int po [13]
sh run int po [13]
sh run | inc chann

show etherchannel 13 summary
A good way to see the protocol and ports in an etherchannel.

ASW1#sh etherchannel 13 summary
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port


Number of channel-groups in use: 2
Number of aggregators:           2

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
13     Po13(SU)        PAgP      Fa0/19(P)   Fa0/20(P)

show etherchannel
Show a brief output of the etherchannels configured on the switch.

ASW1#sh etherchannel
        Channel-group listing:
        ----------------------

Group: 13
----------
Group state = L2
Ports: 2   Maxports = 8
Port-channels: 1 Max Port-channels = 1
Protocol:   PAgP

Group: 23
----------
Group state = L2
Ports: 2   Maxports = 16
Port-channels: 1 Max Port-channels = 1
Protocol:   LACP

show int port-channel 13
Shows the typical sh int output.

ASW1#sh int po 13
Port-channel13 is up, line protocol is up (connected)
  Hardware is EtherChannel, address is 0013.c36a.4894 (bia 0013.c36a.4894)
  MTU 1500 bytes, BW 200000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Full-duplex, 100Mb/s, media type is 10/100BaseTX
  input flow-control is off, output flow-control is unsupported
  Members in this channel: Fa0/19 Fa0/20
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:00, output 00:14:22, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 3000 bits/sec, 5 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     9393687 packets input, 891352406 bytes, 0 no buffer
     Received 8753356 broadcasts (0 multicast)
     0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog, 8749154 multicast, 0 pause input
     0 input packets with dribble condition detected
     1294089 packets output, 112429676 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier, 0 PAUSE output
     0 output buffer failures, 0 output buffers swapped out

sh run int po13ASW1#sh run int po13

Building configuration...

Current configuration : 93 bytes
!
interface Port-channel13
 switchport trunk encapsulation dot1q
 switchport mode trunk
end

sh run | inc chann

ASW1#sh run | inc chann
interface Port-channel13
interface Port-channel23
 channel-group 13 mode desirable
 channel-group 13 mode desirable
 channel-group 23 mode active
 channel-group 23 mode active
Categories: CCNP TSHOOT, Routing Tags:

What I Learned Today

March 26th, 2010 jud No comments

One of my coworkers solved a problem today that I should have been able to solve. I got pulled into a project that uses a closed system with it’s own programming language that I had never seen nor programmed. My coworker was trying to figure out why his syntax was not working. So we cranked up the logging in Warn.log, Error.log and Fatal.log. We quickly figured out why it was failing, the program was looking for a file that did not exist and he was not catching that error, there is no catch statement.

So I began trying to write an IF/ELSE statement that would check for the error condition. I was given a .pdf of the manual for the system and just started trying different functions that made sense to me. I wrote a nice little one liner in the SYSTEM command that returned TRUE or FALSE if the FILE environment variable existed.

The problem was that we could not set the environment variable with a variable from the program. It has to be a string literal.

From the Trace.log:

      LET sys = EXPORT("FILE=" & $format)

      // Variable "Part01::sys" is a String
      // [  1] = ""

      LET sys = SYSTEM("if [ -f /usr/program/fmt/$FILE ]; then  echo "TRUE"; else echo "FALSE"; fi")

      // Variable "Part01::sys" is a String
      // [  1] = "FALSE"

      IF sys = "TRUE" THEN

        // Test result is FALSE - skipping...

      END IF

We tried a number of different variations on that theme, imported and exported variables to a subshell, tried different return values from the exit command. We got the system to turn circles but what we really wanted was squares.

Finally my coworker called and said, why don’t we just invert the logic. If it falls through to the end of the IF/ELSE statements it must be in the format we want. Let me take a step back and say this was his code, he should have been the one to figure it out. I believe I helped him figure out what his main problem was, which helped him find the solution. I’m not trying to minimize his work, nor am I trying to minimize my input into the solution.

The moral of the story is that I should have taken a higher level look at the problem to understand the solution. I am quick to believe that I can code my way out of any problem, regardless whether or not I have ever seen the language. What I really needed to do was step back and take a higher level view of the logic, rather than dive into syntax and functions.

Categories: Code, Linux, Musings Tags:

Troubleshooting Toolbox

March 26th, 2010 jud No comments

Let me start by what this chapter does not include, a nice set of filters for common show commands that will help you find the most pertinent information quickly. I think every networker has some of their favorite commands such as this one for BGP:

R1# sh ip bgp neigh | inc BGP
BGP neighbor is 209.65.200.226,  remote AS 65002, external link
  BGP version 4, remote router ID 209.65.200.242
  BGP state = Established, up for 1w3d
  BGP table version 16, neighbor version 16/0
  Last reset 1w3d, due to BGP Notification sent, hold time expired

Or one of my favorite sh run commands:

R1#sh run | sect int|router
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
... output omitted for brevity ...
ipv6 router ospf 6
 router-id 10.1.1.1
 log-adjacency-changes


Filtering the show command

Using include:

R4#sh ip int br | inc 10.1
FastEthernet0/0            10.1.4.5        YES NVRAM  up                    up      
FastEthernet0/1            10.1.4.9        YES NVRAM  up                    up      
Serial0/0/0.34             10.1.1.10       YES NVRAM  up                    up

Using exclude to show the same information:

R4#sh ip int br | exc unass
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            10.1.4.5        YES NVRAM  up                    up      
FastEthernet0/1            10.1.4.9        YES NVRAM  up                    up      
Serial0/0/0.34             10.1.1.10       YES NVRAM  up                    up


Redirecting output

I had never seen the redirect and append commands in IOS, and while I have used tee and >> or 2>&1 on UNIX servers, I had never used redirection in IOS. Redirecting with append:

R4#sh ip int br | redirect tftp://10.2.2.10/test.txt
!
R4#sh ip route | append tftp://10.2.2.10/test.txt  
% Appending is not supported in this file system

Interesting, I’m not able to append to tftp while they can in the book. Let’s troubleshoot :)

R4#sh ip route | ?                              
  append    Append redirected output to URL (URLs supporting append operation
            only)
  begin     Begin with the line that matches
  exclude   Exclude lines that match
  include   Include lines that match
  redirect  Redirect output to URL
  section   Filter a section of output
  tee       Copy output to URL

So where can I append?

R4#sh ip route | append ?
  flash:  Uniform Resource Locator
  ftp:    Uniform Resource Locator
  nvram:  Uniform Resource Locator

R4#sh ip route | tee ftp://10.2.2.10/test-ftp.txt
Writing test-ftp.txt
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
... output omitted for brevity ...
O IA    10.1.1.0/30 [110/192] via 10.1.1.9, 1w3d, Serial0/0/0.34
C       10.1.4.4/30 is directly connected, FastEthernet0/0
O IA    10.1.1.4/30 [110/128] via 10.1.1.9, 1w3d, Serial0/0/0.34
D*   0.0.0.0/0 is a summary, 1w0d, Null0
R4#sh ipv route | append ftp://10.2.2.10/test-ftp.txt
Writing test-ftp.txt

Lesson learned. I can append to ftp while the TSHOOT author, Kevin Wallace can append to tftp. I wonder what IOS version he is using? Just for clarity here is my version:

R4#sh ver
Cisco IOS Software, 1841 Software (C1841-ADVENTERPRISEK9-M), Version 12.4(25a), RELEASE SOFTWARE (fc2)

Ping:

Before I go into what all ping can do on IOS I want to point out a link about Mike Muus, the man who wrote ping, it’s an interesting read for some historical perspective.

What the different characters mean in the ping response field:
! — Each exclamation point indicates receipt of a reply.
. — Each period indicates the network server timed out while waiting for a reply.
U — A destination unreachable error PDU was received.
Q — Source quench (destination too busy).
M — Could not fragment.
? — Unknown packet type.
& — Packet lifetime exceeded.

Some of the ping options from the TSHOOT book:
size — Then number of bytes per datagram.
repeat — The number of ICMP Echo messages sent.
timeout — Seconds to wait for an ECMP Echo Reply.
source — Source IP of the datagrams.
df-bit — Set the do not fragment bit.

If you’re going to turn on ip packet debugging on a router, you better set up an ACL. This is me playing with debugging ICMP, remember access lists are almost always set for inbound traffic.

R4(config)#ip access-list extended 100
R4(config-ext-nacl)#permit icmp host 10.2.1.1 any
R4(config-ext-nacl)#^Z
R4#debug ip packet 100
IP packet debugging is on for access list 100
R4#ping 10.2.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
R4#
Mar 22 21:05:53.381: IP: tableid=0, s=10.2.1.1 (FastEthernet0/0), d=10.1.4.5 (FastEthernet0/0), routed via RIB
Mar 22 21:05:53.381: IP: s=10.2.1.1 (FastEthernet0/0), d=10.1.4.5 (FastEthernet0/0), len 100, rcvd 3
Mar 22 21:05:53.381: IP: tableid=0, s=10.2.1.1 (FastEthernet0/0), d=10.1.4.5 (FastEthernet0/0), routed via RIB
... output omitted for brevity ...

I also did not know about the ping sweep capability of IOS:

R4#ping
Protocol [ip]:
Target IP address: 10.2.1.1
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface:
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]: y
Sweep min size [36]: 1450
Sweep max size [18024]: 1550
Sweep interval [1]:
Type escape sequence to abort.
Sending 505, [1450..1550]-byte ICMP Echos to 10.2.1.1, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

So you would use ping to test layer 3 and telnet to test layer 4. Let’s test ftp in our testlab. This will come back and bite me some day, why remember port numbers when they are always at your disposal.

R4#sh ip nbar port-map | inc ftp
port-map ftp                      tcp 21
port-map secure-ftp               tcp 990
port-map tftp                     udp 69
R4#telnet 10.2.2.10 21
Trying 10.2.2.10, 21 ... Open
220 (vsFTPd 2.0.5)
quit

[Connection to 10.2.2.10 closed by foreign host]

This portion of the book is frustrating to me. I am an interactive learner and this portion is not as fun. It also feels like I am just reiterating the Key Topic points in the book. That is frustrating as well. I guess in time Cisco will have some more interesting documentation concerning troubleshooting as the pendulum swings toward documentation for the new test.

Hardware Debugging Commands:

show processes cpu — Is the switch/router able to handle the traffic?
show memory — Memory usage.
show interfaces — If needed use the clear counters command.
input queue drops — Receiving packets faster than it can process.
output queue drops — Could not send fast enough, i/o speed mismatch?
input errors — Frames were not received correctly, cabling problem?
output errors — Frames were net sent correctly, duplex mismatch?

Packet Captures:
I added another ethernet card to the server and connected it to gi0/12 on DSW2. That way I can run wireshark and capture traffic. You can download my libpcap file here.

DSW2(config)#monitor sess 1 source  int g0/14
DSW2(config)#monitor sess 1 dest int gi0/12

RSPAN:
RSPAN allows you capture traffic on switch that is sent from the port on another. That way you don’t have to have a collector in every closet.

First you need to configure the vlan as a remote-span vlan:

DSW2(config)#vlan 21
DSW2(config-vlan)#name SPAN
DSW2(config-vlan)#remote-span
DSW2(config-vlan)#do sh vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Gi0/2, Gi0/3, Gi0/4, Gi0/5
                                                Gi0/6, Gi0/7, Gi0/8, Gi0/9
... output omitted for brevity ...
20   20Testing                        active    
21   SPAN                             active    
... output omitted for brevity ...
Remote SPAN VLANs
------------------------------------------------------------------------------
21
... output omitted for brevity ...

The switches are set up with port-channels between them, however, rspan does not give an option for a portchannel interface as the reflector port. I just pointed it at one interface of the port-channel and it worked.

ASW1(config)#monitor session 1 destination remote vlan 21 reflector-port ?
  FastEthernet       FastEthernet IEEE 802.3
  GigabitEthernet    GigabitEthernet IEEE 802.3z
  LongReachEthernet  Long-Reach Ethernet interface

Here is the complete setup:

ASW1(config)#monitor session 1 source int fa0/2
ASW1(config)#monit sess 1 des remote vlan 21 reflector-port fa0/21
ASW1(config)#do sh run | inc mon
monitor session 1 source interface Fa0/2
monitor session 1 destination remote vlan 21 reflector-port Fa0/21
ASW1(config)#do sh mon
Session 1
---------
Type              : Remote Source Session
Source Ports      :
    Both          : Fa0/2
Reflector Port    : Fa0/21
Dest RSPAN VLAN   : 21

And on the destination switch:

DSW2(config)#monitor session 1 source vlan 21 both
DSW2(config)#monitor session 1 destination interface gi 0/12
DSW2(config-if-range)#do sh mon
Session 1
---------
Type                   : Local Session
Source VLANs           :
    Both               : 21
Destination Ports      : Gi0/12
    Encapsulation      : Native
          Ingress      : Disabled

SNMP:
Uses a pull model to collect device statistics. The command ifindex persist ensures the interface index stays consistent across reboots.

R1(config)#snmp-server ?
  chassis-id        String to uniquely identify this chassis
  community         Enable SNMP; set community string and access privs
  contact           Text for mib object sysContact
  context           Create/Delete a context apart from default
  drop              Silently drop SNMP packets
  enable            Enable SNMP Traps
  engineID          Configure a local or remote SNMPv3 engineID
  file-transfer     File transfer related commands
  group             Define a User Security Model group
  host              Specify hosts to receive SNMP notifications
  ifindex           Enable ifindex persistence
  inform            Configure SNMP Informs options
  ip                IP ToS configuration for SNMP traffic
  location          Text for mib object sysLocation
  manager           Modify SNMP manager parameters
  packetsize        Largest SNMP packet size
  queue-length      Message queue length for each TRAP host
  source-interface  Assign an source interface
  system-shutdown   Enable use of the SNMP reload command
  tftp-server-list  Limit TFTP servers used via SNMP
  trap              SNMP trap options
  trap-source       Assign an interface for the source address of all traps
  trap-timeout      Set timeout for TRAP message retransmissions
  user              Define a user who can access the SNMP engine
  view              Define an SNMP MIB view

R1(config)#snmp-server community collection ro
R1(config)#snmp-ser comm changes rw
R1(config)#snmp-serv conta x9995
R1(config)#snmp-ser ifindex persist

NetFlow:
Uses a push model to collect detailed traffic statistics.

R4(config-if)#int fa0/1
R4(config-if)#ip flq
R4(config-if)#ip fl
R4(config-if)#ip flow ingr
R4(config-if)#ip flow ingress
R4(config-if)#int s0/0/0
R4(config-if)#ip fl
R4(config-if)#ip flow ingr
R4(config-if)#ip flow ingress
R4(config-if)#do sh ip cach flo
IP packet size distribution (219750 total packets):
   1-32   64   96  128  160  192  224  256  288  320  352  384  416  448  480
   .003 .622 .015 .022 .001 .001 .001 .001 .001 .001 .001 .001 .001 .001 .001

    512  544  576 1024 1536 2048 2560 3072 3584 4096 4608
   .001 .001 .001 .019 .296 .000 .000 .000 .000 .000 .000

IP Flow Switching Cache, 278544 bytes
  3 active, 4093 inactive, 3591 added
  721344 ager polls, 0 flow alloc failures
  Active flows timeout in 30 minutes
  Inactive flows timeout in 15 seconds
IP Sub Flow Cache, 21640 bytes
  1 active, 1023 inactive, 3211 added, 3211 added to flow
  0 alloc failures, 0 force free
  1 chunk, 1 chunk added
  last clearing of statistics never
Protocol         Total    Flows   Packets Bytes  Packets Active(Sec) Idle(Sec)
--------         Flows     /Sec     /Flow  /Pkt     /Sec     /Flow     /Flow
TCP-FTP             12      0.0         9    55      0.0       1.8       3.8
TCP-WWW              2      0.0        12    65      0.0       9.7       1.4
TCP-other           13      0.0         2    40      0.0       0.0       7.8
UDP-NTP           3073      0.0         1    76      0.0       0.0      15.8
UDP-other          108      0.0         5    38      0.0       0.0      15.5
ICMP                29      0.0      2742  1285      0.0    1363.3       4.9
IP-other           351      0.0       388    60      0.1    1791.7       2.4
Total:            3588      0.0        61   504      0.2     186.3      14.3

SrcIf         SrcIPaddress    DstIf         DstIPaddress    Pr SrcP DstP  Pkts
Fa0/0         10.1.4.6        Null          224.0.0.10      58 0000 0000    19
Fa0/1         10.1.4.10       Null          224.0.0.10      58 0000 0000    97
Se0/0/0.34    10.1.1.9        Local         10.1.1.10       29 0000 0000     6

Embedded Event Manager:

EEM monitors events through event detectors which then trigger an action based upon defined policies.
Event detectors can be an CLI command, interface counter, SNMP event or syslog event.
Actions occur in response to an event, examples of action include generating an SNMP trap, reloading IOS or generating a syslog message.
Policies are either an applet or a script.

As I was playing around in the EEM I came across this situation, it would be a mean way to play a game on someone.

R4(config)#event manager applet JUD
R4(config-applet)#event cli pattern "show run" skip yes sync no occurs 1

On a more serious note:

R4(config)#event manager applet JUD
R4(config-applet)#event cli pattern "clear counters" sync no occurs 1 skip no
R4(config-applet)#action JUD syslog msg "Why clear counters" priority 0
R4(config-applet)#^Z
R4#clear counters
Clear "show interface" counters on all interfaces [confirm]
Mar 26 21:18:51.107: %HA_EM-0-LOG: JUD: Why clear counters

[confirm]y
R4#sh log
Syslog logging: enabled (1 messages dropped, 1 messages rate-limited,
... removed for brevity ...
Mar 26 21:18:47.979: %SYS-5-CONFIG_I: Configured from console by console
Mar 26 21:18:51.107: %HA_EM-0-LOG: JUD: Why clear counters

I am going to end with some things I would like to see in the IOS CLI toolbox:
&& I should be able to see the output of this command:

R2#sh ip int br | exc unass && sh run | sect int

Or another command:

R2#conf t && int fa0/1 && ip add 10.1.1.1 255.255.255.0 && do sh run int fa0/1
Categories: CCNP TSHOOT Tags:

Xenix

March 21st, 2010 jud No comments

Today on Slashdot someone had a question about getting data off of an old Xenix server. A few years ago I did a consulting job for a customer who had an old Xenix server with no ethernet card that needed to get some data for the State Police. The server ran an old database that kept track of training records and they needed that information in order to “webify” the process.

I wish I could remember the ins and outs of the problem. I gave the customer a write up of how I did it and the problems I had getting the usr directory off of the system. Unfortunately I can’t find the report.

Regardless, it was an interesting project, here is the script from my library that eventually worked:

#!/bin/sh

for I in bin boot dos etc lib oa.files once shlib tmp u unit57 unit58 unit59 usr xenix
do
    echo "tar -cf - $I|uuencode -"
    tar -cf - $I|uuencode -
done

tar -cf - `find /usr -type f -print` >2/usr.err|uuencode -


for I in `cat usr.txt`
do
    tar -cf - $I |uuencode -
done
Categories: Code Tags:

Troubleshooting Processes

March 21st, 2010 jud No comments

The best reason to follow a structured approach is the shot in the dark that often happens if you don’t gather enough information or work to nail down the cause of the problem. It results in haphazard guessing with little to remind you of what you have changed and why.

A general outline of troubleshooting as described in the first paragraph of this chapter:
1. Report
2. Define the Issue
3. Gather Information
4. Better define the issue
5. Hypothesize root cause
6. Propose resolution
7. Test resolution
8. Document solution

Troubleshooting Model:

1. Problem report — Often needs further investigation.
2. Problem diagnosis
    a. Collect information — Use sh and debug to get a better understanding.
    b. Examine information
        — Look for evidence that points to the cause.
        — Look for evidence that can eliminate a vector.
        — What is happening on the network.
        — What should be happening on the network.
    c. Eliminate causes — Start to form hypotheses for what is wrong.
    d. Decide most likely cause — Once possible causes have been narrowed decide on most plausible.
    e. Verify Hypothesis — How can you test whether you have found the problem.
3. Problem resolution — Apply solution, test and document.

Troubleshooting Methods:

  • Top-down Method — Start at layer 7, the application and work down.
  • Bottom-up Method — Start at layer 1 and make sure the physical layer is correct. No efficient in later networks.
  • Divide and Conquer — Begin by pinging and work up or down the OSI stack accordingly.
  • Follow the traffic — Work through the network one switch at a time from source to destination.
  • Configuration Comparison — Compare a working configuration with one that does not work.
  • Component swapping — By changing components you can figure out which one is not working, either hardware or misconfigured.

Troubleshooting involves knowing what should be happening as opposed to what is happening on the network. The best way to do that is to have a baseline which involves SNMP and NetFlow data. They are covered in more depth in the next chapter.

Categories: CCNP TSHOOT Tags:

When it’s time to leave

March 19th, 2010 jud 1 comment

I came across this post today by way of HackerNews. It explains some of my feelings lately as I chomp at the bit wanting the challenge of a new job. I promised my wife we would not move until we had our kids, so I have a couple more years, but I’ve been straining against the reigns.

That post also explains why I think about documentation differently than my peers. I joke about being raised in the military, I wasn’t, however, the Air Force was my first real job. In the military it is known that you will change jobs every three years and so the documentation you write is not for yourself, it is for the person you know will come behind you. In the military you do not quit, you are moved. If you stay in one place too long or “homestead” you are looked down upon and it can actually threaten your career. As a result documentation is taken seriously and my time in the Air Force shaped my understanding of documentation.

Thinking about past employees as alumni is also the same way veterans think about themselves. I am proud to have served and there have been times I felt guilty I left, other times I have wanted to return. Whenever I leave my current position I will view myself as an alumnist, I just hope my current employer does too.

In the future I would like to find an employer that shares my interest in personal development and also has the room for me to grow. I first hired on as a Programmer Analyst and was promoted three years later to Senior Network Engineer. That is the extent of advancement with my current employer, there is no Super Senior Network Engineer. I don’t mind taking a step back with a new employer as long as there is the ability for future growth as I develop.

Categories: Musings Tags:

Network Maintenance

March 18th, 2010 jud No comments

I am going to admit that I have not been studying for the TSHOOT exam very diligently. In my mind it is a topic that we deal with on a daily basis and what could the book teach me. (sarcasm) They gave us the topology, if you understand it like your own network what more could they want? Well, I read the first few chapters and learned some new commands. Now I’m going back to start over, this time typing up notes like I did for the ONT. It keeps me headed in the right direction because other people can see my progress and that motivation keeps me on task.

The first chapter has been a struggle because it is not interesting. These notes are just me struggling through, trying not to fall asleep or get side tracked… oh look there’s a new article on slashdot…

Two network maintenance categories:
Structured tasks — Planned tasks.
Interrupt-driven tasks — Helpdesk tasks.

Network Maintenance Models:
FCAPS — Fault, Configuration, Accounting, Performance and Security management.
ITIL — IT Infrastructure Library is a series of books and checklists published by the UK Government that a company can modify to it’s needs.
TMN — The Telecommunications Management Network includes is the ITU-T version of the FCAPS model, it includes Business, Service, Network and Element management.
Cisco Lifecycle Services — Phases are Prepare, Plan, Design, Implement, Operate, Optimize.

Routine Maintenance Tasks:
Configuration changes
Hardware replacement
Scheduled backups
Software updates
Network performance monitoring

Change Management Issues:
Responsibility, who owns what processes.
Define scheduled maintenance tasks.
Change procedures to follow.
Documentation, who is responsible.
Rollback plan, what happens when a change goes south.

Documentation: — Network documentation is one of the most important tasks a network administrator does. (My opinion, not out of the book.)

Logical topology diagram — shows network interconnects and protocols
Physical topology diagram — shows physical layout and interconnects
Listing of interconnections — device and port connections with circuit IDs
Inventory of network equipment — manufacturer, serial number, model number software version
IP address assignment — describe the network numbering scheme
Configuration information — copies of current and past configurations
Original design documentation — why the network was designed that way

Troubleshooting Aids:
The terminal when logged in remotely does not display console messages by default. Use the term mon command to see messages.

Logging levels:
The logging levels listed below are the same for if you are logging console or logging buffered:

  <0-7>          Logging severity level
  emergencies    System is unusable                (severity=0)
  alerts         Immediate action needed           (severity=1)
  critical       Critical conditions               (severity=2)
  errors         Error conditions                  (severity=3)
  warnings       Warning conditions                (severity=4)
  notifications  Normal but significant conditions (severity=5)
  informational  Informational messages            (severity=6)
  debugging      Debugging messages                (severity=7)
  filtered       Enable filtered logging
  guaranteed     Guarantee console messages
  xml            Enable logging in XML
  <cr>

It’s always good to be able to correlate logs with the correct time, use NTP to synchronize clocks across the domain:

R4#sh clock
.12:00:10.263 UTC Fri Jan 1 1993
R4#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R4(config)#clock timezone CDT -6
R4(config)#
.Jan  1 12:00:40.687: %SYS-6-CLOCKUPDATE: System clock has been updated from 12:00:40 UTC Fri Jan 1 1993 to 06:00:40 CDT Fri Jan 1 1993, configured from console by console.
R4(config)#ntp server 10.2.2.10
R4(config)#exit
R4#sh clock
17:38:51.397 CDT Thu Mar 18 2010

And if you log remotely:

logging facility local6
logging host 10.2.2.10

Backup Tools:
At the Circus we use rancid with SVN to back up our Cisco and ProCurve devices. I never knew about the archive command, however, I still believe rancid is the better tool, with SVN it will email you diffs, set it up with tacacs+ and you know who made what changes and can be notified by email.

Let’s explore some Cisco backup options.

For standard ftp backup:

R4#sh run | inc \ ftp
ip ftp username ftpuser
ip ftp password ftppass

And ftp in action:

R4#copy start ftp://10.2.2.10
Address or name of remote host [10.2.2.10]?  
Destination filename [r4-confg]?
Writing r4-confg !
1977 bytes copied in 0.076 secs (26013 bytes/sec)

The archive command. I have it set to archive every 60 minutes and every time I write memory:

R4#sh run | sect arch
archive
 path tftp://10.2.2.10/Archives/r4.arch
 write-memory
 time-period 60

The archive command in action, when I archive from the command line, it writes r4.arch-29 and when I wri mem it archives r4.arch-30.

R4#archive confi
!!
R4#sh arch
The next archive file will be named tftp://10.2.2.10/Archives/r4.arch-30
 Archive #  Name
   0       tftp://10.2.2.10/Archives/r4.arch-15
   1       tftp://10.2.2.10/Archives/r4.arch-16
   2       tftp://10.2.2.10/Archives/r4.arch-17
   3       tftp://10.2.2.10/Archives/r4.arch-18
   4       tftp://10.2.2.10/Archives/r4.arch-19
   5       tftp://10.2.2.10/Archives/r4.arch-20
   6       tftp://10.2.2.10/Archives/r4.arch-21
   7       tftp://10.2.2.10/Archives/r4.arch-22
   8       tftp6://10.2.2.10/Archives/r4.arch-23
   9       tftp://10.2.2.10/Archives/r4.arch-24
   10       tftp://10.2.2.10/Archives/r4.arch-25
   11       tftp://10.2.2.10/Archives/r4.arch-26
   12       tftp://10.2.2.10/Archives/r4.arch-27
   13       tftp://10.2.2.10/Archives/r4.arch-28
   14       tftp://10.2.2.10/Archives/r4.arch-29 <- Most Recent
R4#wri me
Building configuration...
[OK]!!
R4#sh arch
The next archive file will be named tftp://10.2.2.10/Archives/r4.arch-31
 Archive #  Name
   0       tftp://10.2.2.10/Archives/r4.arch-30 <- Most Recent
   1       tftp://10.2.2.10/Archives/r4.arch-16
   2       tftp://10.2.2.10/Archives/r4.arch-17
   3       tftp://10.2.2.10/Archives/r4.arch-18
   4       tftp://10.2.2.10/Archives/r4.arch-19
   5       tftp://10.2.2.10/Archives/r4.arch-20
   6       tftp://10.2.2.10/Archives/r4.arch-21
   7       tftp://10.2.2.10/Archives/r4.arch-22
   8       tftp://10.2.2.10/Archives/r4.arch-23
   9       tftp://10.2.2.10/Archives/r4.arch-24
   10       tftp://10.2.2.10/Archives/r4.arch-25
   11       tftp://10.2.2.10/Archives/r4.arch-26
   12       tftp://10.2.2.10/Archives/r4.arch-27
   13       tftp://10.2.2.10/Archives/r4.arch-28
   14       tftp://10.2.2.10/Archives/r4.arch-29
R4#

Both the archive and ftp sections of the R4 config:

R4#sh run | sect ftp|arch
archive
 path tftp://10.2.2.10/Archives/r4.arch
 write-memory
 time-period 60
ip ftp username ftpuser
ip ftp password ftppass

And to restore the running config from backup use the configure replace command:

R4#config repla tftp://10.2.2.10/Archives/r4.arch-30
This will apply all necessary additions and deletions
to replace the current running configuration with the
contents of the specified configuration file, which is
assumed to be a complete configuration, not a partial
configuration. Enter Y if you are sure you want to proceed. ? [no]: y
Loading Archives/r4.arch-30 from 10.2.2.10 (via FastEthernet0/1): !
[OK - 2039 bytes]

Total number of passes: 0
Rollback Done

R4#
*Mar 18 18:11:22.354: Rollback:Acquired Configuration lock.
R4#
Categories: CCNP TSHOOT Tags:

TSHOOT Demo and Tutorial

March 16th, 2010 jud 1 comment

Chris pointed out that the Cisco Learning Network has posted a TSHOOT demo. I just went and played with it. Funny thing is, I wasn’t taking a real test but my pulse and blood pressure both shot up. It’s a wonder I passed any of the exams the way Cisco has got me wired.

Categories: CCNP TSHOOT Tags:

TSHOOT Topology

March 12th, 2010 jud 5 comments

I’ve been playing around in the TSHOOT topology and thought I would share my configuration. Here is a copy of the original topology as released on the Cisco Learning Network. You can download a .tar file of all of my configurations here. If you have it configured differently please share in the comments or a post on your own blog.

I used a few more routers for the clients and set up the BGP cloud as well. The frame relay switch configuration on R10 was left over from Narbiks labs and the extraneous configurations that you see on random ports on the client routers was testing for another project. This way I could use the lab for both scenarios. Below is my modified topology, everything else is the same as the original .pdf. Routers 1-4 are 1841s, 5-10 are 3640s, the distribution switches are a couple of 3560s and the aggregation switches are 3550s.

TSHOOT Topology

Categories: CCNP TSHOOT Tags: