For debugging purposes I needed to provide serial access to a device attached to a remote machine without giving any other type of remote access. This doesn't sound too hard but surprisingly it's quite confusing and information is sparse. Making Google do it's magic I ended up with these three options:

  • ser2net
  • socat
  • remserial

ser2net: Follows the RFC 2217 standard which is good, unfortunately there doesn't seem to be many clients around. The only ones I could find that were free was Kermit (Open Source) and HW VSP by the HW-Group (Freeware).

socat: Seems to be awesome and very versatile if you know what you're doing, honestly the documentation put me off...

remserial: Emulates a serial port remotely, proprietary, very minimalistic (doesn't really output any errors) and doesn't run on Windows unfortunately.

As Windows wasn't a requirement in this case I ended up running remserial as it just worked and did what it was supposed to do without any additional applications.

On the server (-p port (TCP), -s speed raw, /dev/cuau0 being the serial device in my case):
remserial -d -p 32323 -s "115200 raw" /dev/cuau0 &

On the client (-r remoteipadress, -p port (TCP), -l redirected-serial-port):

kldload ptmx
remserial -d -r <ipaddress> -p 32323 -l /dev/remser1 /dev/ptmx &

All set, now you just need to connect as you usually do but using /dev/remser1 as the serial port instead.

Tested on FreeBSD 10.1