How would one go about capturing OSPF traffic in Wireshark between two routers?
I'm looking to do something like this:
[RTR A] - - - [LAPTOP] - - - [RTR B]
How would one go about capturing OSPF traffic in Wireshark between two routers?
I'm looking to do something like this:
[RTR A] - - - [LAPTOP] - - - [RTR B]
You have two options:
The second option is obviously the least disruptive, but might not be possible depending on your network topology.
Put a switch in between the routers and then use port mirroring to see the traffic. Caution: most port-mirroring implementations encapsulate the mirrored traffic inside a VLAN
While there are several solutions offered by others here that may work, I ended up doing the following:
[RTR A] - - - [DUMB HUB] - - - [RTR B]
|
|
|
[LAPTOP]
I stuck a dumb hub in between the two routers and then connected a laptop on another interface of the hub to capture the traffic in Wireshark.
Depending on your requirements, you could also use RITE (Traffic Export). This will send target packets on one interface to a MAC address on another interface.
http://blog.ipexpert.com/2010/07/01/router-ip-traffic-export-rite/
ip traffic-export profile EXPORT
interface FastEthernet3/0
bidirectional
incoming access-list 100
outgoing access-list 101
mac-address 001d.6094.d09d
incoming sample one-in-every 5
outgoing sample one-in-every 5
!
interface FastEthernet1/0
ip traffic-export apply EXPORT
!
access-list 100 permit tcp any any eq telnet
access-list 101 permit tcp any eq telnet any
You can do it with a passive network tap, assuming it's a 100mbit connection (or you are willing to make it a 100mbit connection).
This device gets inserted between the two devices. Then you get 2 ethernet ports to tap into - each one has the transmit pair from one device wired to receive on your laptop.
You need 2 network cards to capture both sides of the conversation. Newer versions of wireshark can handle capturing from multiple interfaces simultaneously.
There are plenty of guides on making them. The particular device I linked to will even downgrade gigabit connections to 100mbit, so it will still work, but might slow down the network.
The advantage of passive taps is that you are completely unable to transmit onto the network - the transmit pairs of your network cards aren't wired to anything. So you won't interfere with anything accidentally, or affect the results that you are looking for. They are also incredibly cheap and easy to make - all you really need are 4 cat5 punchdowns and a bit of wire to make a basic one.
Your question is tagged "Cisco" -- if these are Cisco routers, you can use IOS to capture packets right on the router. See https://supportforums.cisco.com/docs/DOC-5799 for details and some examples.