Is it possible to include switches in traceroute hops?

I was wondering if it's at all possible to make a Dell Powerconnect 2848 switch show when running internal traceroutes. This would help with diagnosing issues and make it far easier to see where issues occur.

According to the datasheet, this particular switch is Layer 2 and 3 aware. I'm not completely sure what that means.

Is this possible?


Solution 1:

No. The hops shown by traceroute show the path that an IP packet follows on a routed (layer 3) network. Routers will show up, and switches will not.

Switches are by their nature a layer 2 device: they receive and forward Ethernet frames, using the destination MAC address to determine the correct destination port. Some switches are also able to function as routers. We call such devices "layer 3 switches." Even a layer 3 switch will not necessarily show up on a traceroute, because much of the traffic passing through such a switch is layer 2 traffic within its own subnet.

In any event, the PowerConnect 2848 is not a layer 3 switch. It is "layer 3 aware" for QoS purposes only.

Solution 2:

A layer 2 switch won't show up in a tracert because it's a layer 2 device (a switch) and simply forwards (switches) traffic from one switch port to another based on the layer 2 address of the destination device. Tracert (ICMP) works at layer 3. In order for the switch to show up in tracert it has to be in use as a layer 3 device (a router) and has to be in the layer 3 path between the source and the destination devices.

Solution 3:

Not with the default traceroute program which by definition uses a response from a gateway (see man page):

traceroute tracks the route packets taken from an IP network on their way to a given host. It utilizes the IP protocol's time to live (TTL) field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path to the host.

If there is not a gateway on the traced path, only Layer 2 devices, the IP will not be reported.

But Cisco has a utility that works on Layer 2. But this utility is dependent on CDP protocol which :

Cisco Discovery Protocol (CDP) must be enabled on all the devices in the network. For the Layer 2 traceroute utility to function properly, do not disable CDP. If any devices in the Layer 2 path are transparent to CDP, the Layer 2 traceroute utility cannot identify these devices on the path.

Check additional information here:
Cisco Layer 2 Traceroute Utility