Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a PCIX board (with MIPS CPU) from some vendor and it has an RJ-45 jack on the "board-side", where the cable has an RS-232 plug on the other side. The expected protocol is clearly the same as when using a nullmodem cable between two machines.

Now I am wondering whether there is some Linux or *nix flavor that allows me to substitute the cable for a standard patch cable with RJ-45 connectors on both ends (not crossed for obvious reasons)? I read that someone suggested socat for some similar use-case, but it appears that the use case is so arcane that documentation is virtually non-existent on the topic. Of course it's well possible that I simply used the wrong search terms so far.

Reasoning: it's almost hard to come by devices that have a COM port nowadays, but most have an ethernet port. Also, the board is in a rather inaccessible location, so to connect to it we've been using mobile devices. And then it's even harder to find machines with COM ports.

NB: I'm aware of RS-232 to USB devices, but would prefer a solution as pointed out as it seems more universal.

share|improve this question
up vote 10 down vote accepted

It's not clear exactly what you want. If you want to use your existing Ethernet port, that won't be an option for many reasons; the most fundamental being that Ethernet requires precise termination and voltage levels, the hardware on the interface (the PHY) is made to deal with that. Ethernet uses strictly +/- 0.85V and 50ohm termination impedance; RS-232 uses at a minimum +/- 3V, and could be as high as +/-25V, typically +/-12V. I imagine if you did try to connect your Ethernet port to an RS-232 line, it would fry your network interface.

Socat is a whole other level, and definitely is not useful here: it's a TCP/IP communication tool: it doesn't know anything about the electrical characteristics of the underlying hardware - it could talk over an RS232 line, but it'll be talking TCP, and you'd need to talk TCP on the other side for it to work.

Now, if what you're doing is designing a board, you could put an RJ45 jack with traces to a serial I/O port, which is exactly what the makers of your PCIX board have done. I've also seen Cisco routers like this.

The tool you really need is an RS232->USB converter.

share|improve this answer
thanks for your answer. I guess I'll have to read up on it a bit more :) ... +1 for now from me. Thanks also for the warning concerning the Ethernet port and that it may not survive an attempt to connect the cable there. – 0xC0000022L Mar 11 '11 at 19:34
ordered a converter. Thanks again for the answer. – 0xC0000022L Mar 12 '11 at 22:56
I got my converter. Works like a charm. Thanks again for the advice. – 0xC0000022L Mar 24 '11 at 19:25

Many devices use nonstandard connectors for serial ports. RJ-45 is probably the most common connector used for RS-232 serial after DB-9, but unlike with DB-9, there aren't even de facto standards for the pinout. I'm aware of 4 different RJ-45 RS-232 pinouts, and there are probably others I haven't seen yet.

None of this means that people are somehow converting Ethernet to serial. They merely happen to use the same connector.

There are many products that do provide that conversion, and in fact most of them do use the RJ-45 connector for their serial side. For an example of a single-port converter, there's the Digi One SP. More common are boxes that provide multiple serial ports, like the Digi PortServer and the Avocent (neé Cyclades) Console Servers. These are just two examples out of many. Digi and Avocent are easily the two biggest players, but there are lots of smaller companies doing things like this.

Some of these boxes present themselves to the OS as /dev/ttyWHATEVER by installing a driver. These have the advantage that any program that knows how to talk to a serial port can talk to the remote device plugged into the converter. For the most part, the driver makes the converter appear no different from a local serial port. For example, if a program opens one of the converter's /dev/ nodes and calls cfsetospeed() on it to set the serial port's bit rate, the driver forwards the command to the remote converter box, which changes the serial bit rate on that port.

The main problem you run into with that type of converter is that it isn't always possible to find a working driver for your particular kernel. This problem is becoming more common as the popularity of RS-232 drops, since it means the companies providing these boxes have dwindling incentives to keep enhancing their driver to track kernel differences.

The other major type of serial to Ethernet converter is purely a network appliance. For example, with the Cyclades boxes, if it gets the IP from the DHCP server, you can connect to on TCP port 7001 to connect to the first serial port. You'd use TCP port 7002 for the second serial port, and so forth.

To set serial port parameters with this sort of converter, you typically have to use a web management UI hosted by the converter box. While this does mean you don't get features like automatic serial port parameter forwarding to the converter, you do get compatibility with any program that can open a TCP connection without needing a driver.

share|improve this answer
Thanks for your explanation. +1. – 0xC0000022L Mar 12 '11 at 22:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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