?
Solved

Tcpdump on a Cisco Router?

Posted on 2004-10-25
10
Medium Priority
?
19,132 Views
Last Modified: 2010-07-12
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.
0
Comment
Question by:mpathetiq
  • 3
  • 2
  • 2
  • +3
10 Comments
 
LVL 79

Expert Comment

by:lrmoore
ID: 12404736
Try "debug ethernet-interface"
0
 
LVL 50

Assisted Solution

by:Don Johnston
Don Johnston earned 1400 total points
ID: 12404740
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
 

Author Comment

by:mpathetiq
ID: 12404802
i did "debug ip packet detail"  but i saw no packets.  i know there was data flowing through but saw no packets.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 

Author Comment

by:mpathetiq
ID: 12404876
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
 
LVL 79

Assisted Solution

by:lrmoore
lrmoore earned 600 total points
ID: 12404941
Are you using the router's console port, or telnet session?
If using telnet session, issue "term mon" command
0
 
LVL 79

Expert Comment

by:lrmoore
ID: 12404953
Else, be sure to allow debug to the console
  router(config)#logg console debug
0
 
LVL 50

Accepted Solution

by:
Don Johnston earned 1400 total points
ID: 12409656
And don't forget to disable fast switching.

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

-Don
0
 
LVL 3

Expert Comment

by:MaxQ
ID: 12445943
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
 

Expert Comment

by:alexcf
ID: 12550337
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
 

Expert Comment

by:umasscscf
ID: 33188846
How do you turn off the debugging???
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you with short command examples how to obtain a packet footprint of all traffic flowing thru your Juniper device running ScreenOS. I do not know the exact firmware requirement, but I think the fprofile command is availab…
I have seen some questions on problems with SSH/telnet access to Cisco routers that may occur despite the fact that from a PC connected to your LAN, Internet connectivity is in place and users can access Internet sites without any issues.  There are…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question