Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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. –  Aaron Aug 4 '11 at 11:03
    
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. –  MikeyB Aug 4 '11 at 13:34
    
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". –  Aaron Aug 4 '11 at 15:48
    
No worries - it's actually good for site to get activity on old (especially unanswered) questions. –  MikeyB Aug 4 '11 at 16:11

1 Answer 1

up vote 5 down vote accepted

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|improve this answer
    
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? –  MikeyB Aug 20 '10 at 15:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.