Springe zu Hauptinhalt

Springe zu Hauptmenü

Henryk Richter

Switch as Hub

turn a switch (virtually) into a hub

You are here: Startseite » Networking » Switch as Hub 


In lab environments, it is often advisable to observe the inter-Router or inter-Switch traffic to gain conclusions about the state of the network and the running protocols.

An easy way to monitor the traffic can be achieved by plugging Ethernet Hubs into the respective spots which enable packet capture and analysis. Yet hubs (especially with 100 MBit/s) are increasingly harder to come by these days. Half of our own 100 MBit/s Hubs are already dead. Now what ?

One feature that might come in handy is port monitoring (in Cisco terms: SPAN or switched port analyzer). SPAN in itself is useful for monitoring a limited number of ports but you have to remember which ports are the monitored and which to use for the analyzer host.

While thinking about a more versatile solution, I came across remote SPAN or short RSPAN. When defining a VLAN with the remote-span attribute, the Switch will no longer perform MAC-address learning on the respective ports and hence resort to broadcasting incoming frames toward all other ports associated with that VLAN. Bingo.

So the code to enable Switch-To-Hub-Mode would look like this (C2960-24TT-L):

! make sure, the VLAN will be visible in "sh run"
vtp mode transparent
! remote-span VLAN (locally used only..)
vlan 555
 name SwitchHUBVLAN
! all FastEthernet interfaces (change as necessary)
interface range fa0/1 - 24
 switchport mode trunk
 switchport trunk native vlan 555
 no cdp enable
 spanning-tree portfast trunk
 spanning-tree cost 1

On other devices, the interface range would need to be adjusted to the actual port names. The spanning-tree parameters I chose are optional. I just wanted the setup to keep operational (with as little obstruction as possible) when inserting this device into a switch chain. The "no cdp enable" directive is important. Else, connected Cisco switches would (rightfully) complain about native VLAN mismatches.

So there it is. A switch that will nicely chatter incoming data towards all ports.

A few differences between this approach and a real hub remain.

  1. Cisco's switches are store-n-forward. There is additional delay compared to a true Hub.
  2. Link-Local Protocols such as CDP, STP and others will not pass the Hub-Switch.
  3. The Hub-Switch will be part of the STP domain. Although I recommended a cost of 1 (minimum possible), the root ports and active paths on other switches might change.