Find switchport for device on your network (cisco)

If you have a cisco network and not using software tools who logs status for your switchports you can still find where your device is connected without physically going to the location checking patching.

You will need a source and a destination mac address.

  • Source mac address
    • The source mac address isn’t that important, just do a sh mac address table vlan 5. Find a random mac address on the same vlan as the device you are looking for.
  • Destination mac address
    • I usually find this by checking the dhcp server or asking the user for the information. It might be printed on a label on the device or if it’s a windows computer you find it with ipconfig /all under Physical Address.

When you got source and destination mac address you can run the command: traceroute mac {source mac} {destination mac}. The output will tell you something about where both source and destination mac is connected and the path between them. Example:

Traceroute mac aaaa.bbbb.cccc dddd.eeee.ffff
Source aaaa.bbbb.cccc found on switch10
1 switch10 (172.32.0.10) : Fa0/40 => Gi0/1
2 switch13 (172.32.0.13) : Gi0/2 => Gi0/1
3 switch19 (172.32.0.19) : Gi0/2 => Gi0/1
4 switch31 (172.32.0.31) : Gi0/2 => Fa0/38
Destination dddd.eeee.ffff found on switch31
Layer 2 trace completed

If you need more details, you can add detail after the command.

TSM cheatsheet

Clean up volumes, moving data first

  1. Set volume readonly: upd vol /tsmdata/stg1/filepool/01301.dsm acc=reado
  2. Move data from the volume: move data /tsmdata/stg1/filepool/01301.dsm w=y
  3. Delete the volume: del vol /tsmdata/stg1/filepool/01301.dsm
  4. Delete the volume from the underlying file system (linux example here): rm -f /tsmdata/stg1/filepool/01301.dsm

All this could be scripted if multiple volumes should be cleaned up to free space on underlying file system.

Backup database

ba db t=f dev={deviceclass} (example: file_dbb)

SVC cheatsheet

CLI

General

List commands starts with ls, try ls and tab to get a list or use the command: help

  • svctask
  • svcinfo
  • svcconfig

Get help with cli commands

  • svctask -?
  • svctask chvdisk -? (Helptext for the chvdisk command)

Easy Tier

  • svctask chvdisk –easytier off volume name/id (disable easy tier for volume)
  • svctask chmdiskgrp -easytier [on/off/auto] volume name/id (enable easy tier for a disk pool)

Cisco IOS – cheatsheet

General commands

  • sh ip traffic – all traffic through the Cisco
  • sh controllers ethernet-controller gi1/0/1 phy – information about the SFP module into a particular port
  • show vlan internal usage – used to show vlan
  • sh inventory raw – in 4924 about stuck SFP seems to be the only way to see.
  • sh ip protocols – all of the dynamic routing

Tracing

  • traceroute mac aaaa.bbbb.cccc dddd.eeee.ffff (Traces source and destination mac addresses over multiple switches)

Diagnosing problems with TCAM, ASIC

  • sh platform …
  • sh platform tcam utilization – a place in the TCAM Diagnosing problems with the fallback interface / memory / CPU
  • sh controllers cpu-interface
  • sh controllers utilization – the percentage loading of interfaces. Plus upload the switch factory
  • sh controllers tcam sh controllers tcam asic
  • sh controllers ethernet-controller phy
  • sh controllers ethernet-controller port-asic statistics
  • sh controllers ethernet-controller port-asic configuration
  • sh controllers ethernet-controller gigabitEthernet 1/0/1

Interface Commands show interfaces description

  • show interfaces counters protocol status
  • show interfaces summary
  • show interfaces accounting
  • sh interfaces stats – statistics on the interface, the method of switching
  • sh interfaces switching – a hidden command. More detail than the stats.
  • sh interface switchport – diagnostic vlan
  • show interface trunk – for the diagnosis of vlan
  • show int | i proto.*notconnect|proto.*administratively down|Last in.* [6-9]w|Last in.*[0-9][0-9]w|[0-9]y|disabled|Last input never, output never, output hang never

SDM

  • sh sdm prefer

CDP

  • show cdp neighbors
  • show cdp neighbors detail – here just shows the version of IOS from a neighbor
  • show cdp entry * version – IOS neighbor
  • show cdp entry * protocols – protocols

Multicast

  • sh ip multicast
  • sh ip multicast interface vlan 104
  • sh ip interface vlan 104

PIM troubleshooting

  • sh ip mroute
  • sh ip pim interface
  • sh ip pim rp [mapping]
  • sh ip rpf
  • sh ip pim interface vlan 25
  • sh ip pim neighbor

IGMP troubleshooting

  • sh ip igmp
  • sh ip igmp group
  • sh ip igmp interface ip igmp join-group

Linux cheatsheet

Search for directories and run getfacl for them: find . -type d -exec getfacl -t ‘{}’ ‘;’

Ping with don’t fragment bit set, packetsize 1472: ping {ip} -M do -s 1472

Ping with timestamp, redirect to file: ping {ip} -M do -s 8972 | while read pong; do echo “$(date): $pong”; done > pinglog.txt

Run command each <interval> seconds and output to stdout: watch –n 1 nfsstat –c (here with nfsstat)