Monitoring incoming/outgoing packets on a Cisco switch

5,565

debug packet interface gi0/1

http://www.cisco.com/en/US/docs/ios/12_2/debug/command/reference/dbfmodem.html#wp1060637

Important Note:

Because the debug packet command generates a substantial amount of output for every packet processed, use it only when traffic on the network is low, so other activity on the system is not adversely affected.

Share:
5,565

Related videos on Youtube

Steve Townsend
Author by

Steve Townsend

Systems Administrator, Consultant, Programmer, Linux geek, Computer geek, Networking geek. I work for Net Direct, Canada's leading Linux solutions provider and largest Canadian IBM System x VAR. LinkedIn Profile Achievements Unlocked

Updated on September 17, 2022

Comments

  • Steve Townsend
    Steve Townsend over 1 year

    I would like to monitor (i.e. have the switch print out packets) incoming and/or outgoing packets on a Cisco switchport.

    For instance, I'd like to be able to tell it: Print to the log all packets arriving on Gi0/1.

    Something tells me this should be easy, but I can't find any way to do so!

    I am aware that I could set up a mirror port, however for this particular scenario that won't be useful.

    • Aaron
      Aaron almost 13 years
      Are you actually trying to get a copy of every single packet on the port? Mirror/SPAN/RSPAN is the "correct" answer - a debug will kill the CPU on the router.
    • Steve Townsend
      Steve Townsend almost 13 years
      I don't even remember the original circumstances that led to me asking this question, but according to above I am aware I could set up a mirror port but it wouldn't be useful for that particular case.
    • Aaron
      Aaron almost 13 years
      Oops, sorry, didn't realize how old this was. I guess I'm trying to understand the circumstances of "I want a copy of every packet" but "Span won't work".
    • Steve Townsend
      Steve Townsend almost 13 years
      No worries - it's actually good for site to get activity on old (especially unanswered) questions.
  • Steve Townsend
    Steve Townsend over 13 years
    A good answer, but not supported on any of my hardware (C2960, C3012, CIGESM, 2621 router). Any info on which versions of IOS support debug packet interface?