A universal serial cable

I've been playing around with RS232-interface peripherals a lot recently, and keep finding that I never have the right cables on hand. There are DTE and DCE variants, 9-pin and 25-pin, and even some weird combinations (notably serial terminals with DCE connectors wired as if they were DTEs, or with DTR/DSR and RTS/CTS crossed).

As a result of years of frustration with consumer networking equipment early-on, my homelab is full of enterprise networking kit (mostly Cisco). Most of this equipment uses “Cisco console” pinned RJ45 plugs and sockets for serial connections, and I have plenty of those cables. One day I tripped over a box of these cables, and realised they were the perfect solution to my problems!

  • The big box of random RS232 cables can be replaced with a smaller box of console and rollover cables, and adapters.
  • A USB console cable is tidier and more convenient than a USB-to-DB9 adapter and a serial cable.
  • If I need a longer cable, I just need an RJ45 coupler and a Cat5 straight Ethernet cable.

All I needed was some 9-pin and 25-pin to RJ45 adapters, the sort which can be pinned

Wiring basics

Traditionally a Cisco Console cable was made up of a Rollover cable and a DB9F-to-RJ45 socket adapter. These days that arrangement is rare to see, and most modern cables combine the rollover cable with the adapter: they're made up of a DB9 female connector (or a USB-RS232 adapter module) soldered on to a length of flat cable which terminates in an RJ45 plug. These modern cables are usually wired as follows:

DB9 female Function RJ45 plug
8 CTS ← RTS 1
6 DSR ← DTR 2
2 RXD ← TXD 3
5 Ground 4, 5
3 TXD → RXD 6
4 DTR → DSR 7
7 RTS → CTS 8

The DCD (data carrier detect) and RI (ring indicator) are not connected. In practice this doesn't matter: some null-modem cables connect DCD to DTR, but this isn't essential, and where needed it can be accommodated by wiring the pins up inside the RJ45 adapter.

It's also worth considering the matter of DTE and DCE wiring conventions. In times gone by, a printing or CRT terminal might have been plugged into a modem to allow it to dial a remote computer. This would only need a straightforward male-to-female DE9 or DB25 extension cable, and was facilitated by having two different pinouts:

  • DTE (Data Terminal Equipment) is usually a female DE9 or DB25 connector, and is found on terminals, PCs, and similar equipment.
  • DCE (Data Communications Equipment) is usually a male DE9 or DB25 connector, and is usually found on modems.
  • A DTE is connected to a DCE with a straight-through (pin-1-to-pin-1) wired male-to-female cable: in essence, an extension cable.
  • A DTE is connected to another DTE with a null-modem cable, which crosses the data pairs.
  • Connecting two DCEs together makes absolutely no sense at all.

By virtue of the rollover cable (which crosses RXD/TXD, RTS/CTS and DTR/DSR like a null-modem cable would), the Cisco RJ45 console port can be considered to be a DTE.

Adapter wiring

DB9 female Function RJ45 jack
7 RTS → CTS 1
4 DTR → DSR 2
3 TXD → RXD 3
5 Ground 4, 5
2 RXD ← TXD 6
6 DSR ← DTR 7
8 CTS ← RTS 8

This converts a Cisco console cable into a DB9F for plugging into a PC.

One of these adapters plus a rollover cable (or straight cable and rollover adapter) can be used to connect a PC to a Cisco console port.

DB25 female Function RJ45 jack
4 RTS → CTS 1
20 DTR → DSR 2
2 TXD → RXD 3
7 Ground 4, 5
3 RXD ← TXD 6
6 DSR ← DTR 7
5 CTS ← RTS 8

This converts a Cisco console cable into a DB25F for plugging into a PC.

One of these adapters plus a rollover cable (or straight cable and rollover adapter) can be used to connect a PC to a Cisco console port.

DB9 male Function RJ45 jack
8 CTS → CTS 1
6 DSR → DSR 2
2 RXD → RXD 3
5 Ground 4, 5
3 TXD ← TXD 6
4 DTR ← DTR 7
7 RTS ← RTS 8

This converts a Cisco console cable into a DB9M for plugging into some types of modem (e.g. the Diamond Speedstar 56k).

One of these adapters plus a rollover cable (or straight cable and rollover adapter) can be used to connect a modem to a Cisco console port.

DB25 male Function RJ45 jack
5 CTS → CTS 1
6 DSR → DSR 2
3 RXD → RXD 3
7 Ground 4, 5
2 TXD ← TXD 6
20 DTR ← DTR 7
4 RTS ← RTS 8

This converts a Cisco console cable into a DB25M for plugging into a modem.

One of these adapters plus a rollover cable (or straight cable and rollover adapter) can be used to connect a modem to a Cisco console port.

Find me on Mastodon
  • Last modified: 2024/11/05 15:05
  • by philpem