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.
mpathetiqAsked:
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.

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

You can also limit the output with a ACL

access-list 1 permit 144.1.0.0 0.0.255.255
debug ip packet  1 detail

Will only show ip traffic sourced from the 144.1.0.0 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.

-Don
0
mpathetiqAuthor Commented:
i did "debug ip packet detail"  but i saw no packets.  i know there was data flowing through but saw no packets.
0
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.
0
lrmooreCommented:
Are you using the router's console port, or telnet session?
If using telnet session, issue "term mon" command
0
lrmooreCommented:
Else, be sure to allow debug to the console
  router(config)#logg console debug
0
Don JohnstonInstructorCommented:
And don't forget to disable fast switching.

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

-Don
0

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
MaxQCommented:
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.
0
alexcfCommented:
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

http://www.cisco.com/en/US/products/hw/switches/ps4324/products_configuration_guide_chapter09186a00801d616e.html

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.
0
umasscscfCommented:
How do you turn off the debugging???
0
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
Routers

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.