I want to know the appropriate cable type between:
- Layer-2 and Layer-3 switch
- Layer-3 switch and router
Is it cross-over or straight through?
Network Engineering Stack Exchange is a question and answer site for network engineers. It only takes a minute to sign up.
Sign up to join this communityI want to know the appropriate cable type between:
Is it cross-over or straight through?
I want to know the appropriate cable type between:
- Layer-2 and Layer-3 switch
- Layer-3 switch and router
Is it cross-over or straight through?
You need to make the distinction between MDI ports and MDI-X ports.
Traditionally both Layer-2 and Layer-3 switches use MDI-X ports, while routers and servers use MDI ports. But one ought to check.
See detailed explanation below, from: https://en.wikipedia.org/wiki/Medium-dependent_interface
With 10BASE-T and 100BASE-TX separate twisted pairs are used for the two directions of communication. Since twisted pair cables are conventionally wired pin to pin there are two different pinouts used for the medium dependent interface. These are referred to as MDI and MDI-X (medium dependent interface crossover). When connecting an MDI port to an MDI-X port a straight through cable is used while to connect two MDI ports or two MDI-X ports a crossover cable must be used. Conventionally MDI is used on end devices while MDI-X is used on hubs and switches. Some network hubs or switches have an MDI port (often switchable) to connect to other hubs or switches without a crossover cable.
Also, modern network ports often support Auto MDI-X:
Auto MDI-X automatically detects the required cable connection type and configures the connection appropriately, removing the need for crossover cables to interconnect switches or connecting PCs peer-to-peer.
I don't know what hardware you're specifically talking about here, but modern switches and routers support auto-MDIX which essentially eliminates the need for crossover cables.
Since you used a Cisco Catalyst tag, I'll link to this Cisco page.
To elaborate on the other answers.
Modern switches support Auto MDI-X, which allows the switch ports to automatically determine whether they should work as MDI or MDI-X ports, and therefore precludes the user from having to determine whether they should use a Straight Through or Crossover cable.
But because of how Auto MDI-X works, it must be enabled/supported on both interfaces on either side of the cable it only needs to be supported on one side of the link.
Thanks @Everton for the correction.
To check if an interface supports Auto MDI-X, use these commands:
show interfaces transceiver properties
show controllers ethernet-controller <interface> phy
In either output, look for these lines (respectfully):
Auto-MDIX : On [AdminState=1 Flags=0x00012345]
Operational Auto-MDIX: on
.To summarize:
If BOTH interfaces support Auto-MDIX, then it doesn't matter what cable you choose.
If only ONE interface supports Auto-MDIX, then it doesn't matter what cable you choose.
In the rare case that NEITHER interface supports Auto-MDIX, consider the L3 switchport as a regular L2 Switch port.
If your situation matches the very rare case that neither interface suports Auto-MDIX, you'll want to use the following cables:
Layer-2 and Layer-3 switch -- Use a Crossover
Layer-3 switch and router -- User a Straight-Through