Tcpdump on a Cisco Router?

I want to be able to watch the packets as they flow through my router similar to tcpdump in *nix.  Is there any such command that can allow me to do this?  I am running IOS 12.2(17a).

Thanks guys and gals.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Try "debug ethernet-interface"
Don JohnstonInstructorCommented:
You could use "debug ip packet detail"

You can also limit the output with a ACL

access-list 1 permit
debug ip packet  1 detail

Will only show ip traffic sourced from the network

You can also use an extended ACL to further limit the output.

This may cause a bit of a load on the CPU though and you will need to disable fast-switching.

mpathetiqAuthor Commented:
i did "debug ip packet detail"  but i saw no packets.  i know there was data flowing through but saw no packets.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

mpathetiqAuthor Commented:
i also did "debug ethernet-interface"

both commands indicate that the debugging is on, but i don't know how to retrieve that data.
Are you using the router's console port, or telnet session?
If using telnet session, issue "term mon" command
Else, be sure to allow debug to the console
  router(config)#logg console debug
Don JohnstonInstructorCommented:
And don't forget to disable fast switching.

In interface configuration mode, "no ip route-cache"


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
You really don't want to do "debug ip packet detail" if you're connected via telnet/ssh and are logging to anything other than the internal buffer.  Otherwise the debug will capture the output going to the screen and/or syslog server and you'll get this nifty loop loop of doom as the debug causes more packets to dump from the debug.  Even going to the buffer (which will scroll like crazy if the router is moving much traffic at all) this will still add load to the router's CPU so be careful with this.  If you have a way to narrow down what you're looking for make an ACL to only match those packets, and put the ACL number after the debug command as in "debug ip packet detail 122".  This will give you less output to dig through and limit the overhead of logging every packet.

Finally, if you're really feeling brave or are doing this in a lab where you can take risks, there is an undocumented mode in most IOS version called 'debug ip packet dump" that will dump the entire contents of the packets, as tcpdump would.  All the stuff above about overhead, etc. goes triple for this.  The reason it's undocumented is so people don't complain to Cisco if they crash their router with this command.
On your transit port you could setup port monitoring depending on how much traffic is actually going out.

(config)# monitor session 1 <destination/source> 1 int fa 0/bla

Then you can just run tcpdump or ethereal on the Linux machine you send the mirrored traffic to. Worked very well when I needed to monitor a machine which was suspected of illegal activity.
How do you turn off the debugging???
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.