Connecting to a Remote Serial Port over TCP/IP

This article illustrates how to realize a lan to serial gateway

Remote unit

On the remote unit install ser2net then add this line in /etc/ser2net.conf configuration file

2000:raw:600:/dev/ttyS1:115200 8DATABITS NONE 1STOPBIT

Launch ser2net:

# ser2net

Local unit

Install the socat utility.

Create a directory called $HOME/dev

Launch socat:

$ socat pty,link=$HOME/dev/ttyV0,waitslave tcp:remoteip:remoteport

Open minicom on /dev/ttyV0 and send chars to your remote port.


Serial port on stdin

socat /dev/ttyUSB0,b115200,raw,echo=0,crnl -

Remote console


socat /dev/ttyS2,b115200,raw,echo=0
socat /dev/ttyS4,b115200,raw,echo=0

Server web

socat TCP-LISTEN:2002 PTY,link=ttyV2,raw,crnl
socat TCP-LISTEN:2004 PTY,link=ttyV2,raw,crnl


Sergio Tanzilli
Systems designer, webmaster of and founder of Acme Systems srl

Personal email:
Web pages: ---
Github repositories: ---
Telegram group dedicated to the Acme Systems boards: