3

I want to know the appropriate cable type between:

  1. Layer-2 and Layer-3 switch
  2. Layer-3 switch and router

Is it cross-over or straight through?

  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 13 '17 at 3:10
6

I want to know the appropriate cable type between:

  1. Layer-2 and Layer-3 switch
  2. 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.

  1. Standard cable connects MDI to MDI-X.
  2. Crossover cable connects either MDI to MDI or MDI-X to MDI-X.

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.

| improve this answer | |
5

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.

| improve this answer | |
4

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

| improve this answer | |
  • "But because of how Auto MDI-X works, it must be enabled/supported on both interfaces on either side of the cable." Are you sure? I have used auto-mdix several times on only one side of the cable. I know some Cisco ports (but not all) require "auto" mode (not forcing speed/ duplex) in order to enable Auto-MDIX. – Everton Jan 19 '16 at 19:54
  • @Everton Based on my understanding of how Auto MDI-X works, yes, it must be enabled on both sides for the auto switching to work. That said, if they don't both support Auto MDI-X, there is still a 50% chance that the pin outs are connected in a way where TX pins face RX pins, and everything will work flawlessly innately -- aka, you ended up using the correct cable by luck. That said, I'm open to reading or documents (or testing if you have the ability) that say otherwise. – Eddie Jan 19 '16 at 20:38
  • 1
    Look at "Table 1 Link Conditions and Auto-MDIX Settings" from cisco.com/c/en/us/td/docs/switches/lan/catalyst2960x/software/… – Everton Jan 19 '16 at 21:01
  • 2
    @Everton That caused me to look up and read one of the (riveting) patents for AutoMDIX to find out that the initial implementation worked as I thought, BUT an addition created a way for AutoMDIX to work when the other end did not support Auto MDX. So the current state of Auto MDIX does not require both ends after all. I'll update my answer imminently. Good find and correction! – Eddie Jan 19 '16 at 22:04
  • @Zaved If so, please consider marking one of these answers as the accepted answer. – Eddie Jan 21 '16 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.