Serial-over-Network on Linux: Comparing ser2net, remserial, and socat for Serial ↔ TCP/Telnet Integration

Serial communication continues to power industrial automation, embedded development, lab infrastructure, remote management systems, and legacy equipment around the world. Even in modern IP-based environments, RS232 and RS485 devices remain essential for controlling power systems, networking hardware, PLCs, test equipment, and embedded devices.

Linux provides several powerful tools that make it possible to bridge serial devices and network connections together. Three of the most commonly used utilities are:

  • ser2net
  • remserial
  • socat

While all three can connect serial devices to TCP or Telnet sessions, they each approach the problem differently and are optimized for different use cases.

This article compares the similarities and differences between these tools, explains where each one excels, and shows how they can be combined with EZMation hardware and embedded solutions for powerful remote automation systems.


The Common Goal: Serial ↔ Network Bridging

All three tools are designed to bridge Linux serial devices with network sockets.

Typical Linux serial devices include:

/dev/ttyS0
/dev/ttyUSB0
/dev/ttyACM0
/dev/pts/*

These may represent:

  • Physical motherboard UARTs
  • USB-to-serial adapters
  • Embedded device consoles
  • RS232 or RS485 interfaces
  • Arduino and ESP debug ports
  • Virtual pseudo-terminals

The tools discussed here allow you to:

  • Expose serial ports over TCP or Telnet
  • Create virtual serial devices
  • Connect legacy applications to networked serial devices
  • Build remote console servers
  • Tunnel serial traffic across LANs or VPNs
  • Integrate serial hardware into automation systems

1. ser2net

ser2net is the most purpose-built serial-over-network daemon available on Linux.

It is specifically designed to expose serial devices over TCP or Telnet connections.

Typical Example

Expose /dev/ttyUSB0 on TCP port 2000:

2000:telnet:0:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT

A remote user can connect with:

telnet host-ip 2000

or:

nc host-ip 2000

Strengths

Purpose-Built Serial Server

ser2net was designed specifically for remote serial access and includes features such as:

  • RFC2217 support
  • Baud rate negotiation
  • Serial parameter control
  • Persistent daemon operation
  • Multi-client support
  • Access controls

Excellent for Production Systems

Common deployments include:

  • Console servers
  • Remote infrastructure management
  • Network switch and router console access
  • Embedded Linux debugging
  • Industrial serial device access

Runs as a Service

ser2net is designed to run continuously:

systemctl enable ser2net

making it ideal for always-on environments.

Weaknesses

  • Configuration syntax can be intimidating
  • Less flexible than generic stream tools
  • Focused primarily on serial networking

Best Use Cases

Choose ser2net when you need:

  • Stable production serial sharing
  • Remote RS232 access
  • Infrastructure console management
  • Persistent serial services
  • RFC2217 compatibility

2. remserial

remserial approaches the problem differently.

Instead of exposing a local serial port to the network, it creates a local virtual serial device that connects to a remote TCP socket.

Conceptually:

Remote TCP Socket → Local Virtual /dev/tty Device

Typical Example

Create a virtual serial device connected to a remote serial server:

remserial -d /dev/ttyR0 -s 192.168.1.50:2000

Applications can then use:

/dev/ttyR0

exactly like a local serial port.

Strengths

Excellent for Legacy Software

Many older industrial or embedded applications only understand local serial ports.

remserial allows those applications to communicate with remote networked devices transparently.

Compatibility Layer

Ideal for software that:

  • Cannot open TCP sockets
  • Requires /dev/tty*
  • Only supports serial APIs

Lightweight and Simple

Minimal overhead and focused functionality.

Weaknesses

  • Limited feature set
  • Less actively maintained
  • Narrowly focused use case

Best Use Cases

Choose remserial when:

  • Legacy applications require serial devices
  • You need transparent virtual serial ports
  • SCADA or industrial software expects /dev/tty*
  • Networked serial devices must appear local

3. socat

socat is the most flexible tool of the three.

Rather than being focused specifically on serial devices, it acts as a universal bidirectional stream relay.

It can connect:

  • Serial ports
  • TCP sockets
  • UDP
  • SSL/TLS
  • PTYs
  • Files
  • Pipes
  • UNIX sockets

and many other stream types.

Typical Examples

Serial Port to TCP Server

socat TCP-LISTEN:2000,reuseaddr,fork FILE:/dev/ttyUSB0,b115200,raw

Virtual Serial Device Connected to TCP

socat PTY,link=/tmp/virtualtty TCP:192.168.1.50:2000

Strengths

Extremely Flexible

socat can build highly customized communication pipelines including:

  • Virtual serial pairs
  • Encrypted serial tunnels
  • Logging proxies
  • TCP-to-UDP conversion
  • Protocol debugging setups
  • Multi-hop stream routing

Excellent for Development and Testing

Commonly used in:

  • Embedded development
  • CI test systems
  • Hardware simulation
  • Protocol analysis
  • Virtual device creation

Strong PTY Support

Creating virtual serial devices is one of socat’s greatest strengths.

Weaknesses

  • Complex command syntax
  • Easier to misconfigure
  • Not purpose-built for serial serving
  • No built-in service management

Best Use Cases

Choose socat when you need:

  • Maximum flexibility
  • Virtual serial device creation
  • Advanced networking
  • Development or testing tools
  • Encrypted or customized serial transport

Feature Comparison

Feature ser2net remserial socat
Purpose-built serial daemon Yes Partial No
Virtual serial devices Limited Yes Yes
Serial ↔ TCP bridging Excellent Good Excellent
TCP ↔ Virtual TTY Limited Excellent Excellent
RFC2217 support Yes Limited No
Persistent daemon support Excellent Basic Manual
Flexibility Medium Low Extremely High
Ease of use Medium Easy Advanced
Best for testing/labs Good Fair Excellent

Real-World Automation Applications

These tools are widely used in:

  • Embedded Linux development
  • Remote serial console access
  • Industrial automation
  • Power control systems
  • PLC management
  • Data center infrastructure
  • Test labs
  • Remote debugging
  • Serial device virtualization

For example:

  • ser2net is commonly used to expose RS232 console ports over a LAN
  • remserial allows legacy software to access remote serial hardware transparently
  • socat is frequently used to create virtual serial devices for automation and testing

They can also be combined together in more advanced architectures.


How EZMation Can Help

Whether you are building a simple remote serial bridge or a large-scale automation infrastructure, EZMation can help with both the hardware and software portions of the solution.

We provide a wide range of products and services including:

  • RS232 and RS485 automation hardware
  • Network-controlled power devices
  • Embedded automation systems
  • Serial control interfaces
  • ESP32 and ESP8266-based solutions
  • Custom software integration
  • Industrial automation support

Many customer deployments combine Linux tools like ser2net, remserial, or socat with EZMation hardware to build:

  • Remote console servers
  • Power automation systems
  • Browser-controlled serial devices
  • Lab management systems
  • Remote test infrastructure
  • Wireless serial bridges
  • Embedded control systems

Because every environment has unique requirements, EZMation also assists customers with designing custom serial-over-network architectures optimized for reliability, performance, and ease of integration.

If you are unsure which combination of hardware and software is best for your application, contact EZMation to discuss a custom solution.


ESP32 and ESP8266 Telnet-to-Serial Solutions

In addition to Linux-based serial networking tools, EZMation also maintains lightweight embedded serial gateway software on GitHub.

Our GitHub repository includes Telnet-to-Serial applications that run directly on:

  • ESP32 devices
  • ESP8266 devices

These low-cost WiFi-enabled microcontrollers can act as compact serial servers for:

  • Remote serial access
  • Wireless RS232 bridging
  • Embedded debugging
  • IoT integration
  • Portable console adapters
  • DIY automation projects

You can explore the projects here:

EZMation GitHub Repository

These embedded solutions work especially well alongside Linux tools such as socat and ser2net, enabling flexible hybrid serial-network architectures that combine embedded hardware with Linux servers and browser-based interfaces.


Which Tool Should You Choose?

Choose ser2net if:

You need a reliable production-grade serial server.

Best for:

  • Console servers
  • Remote RS232 devices
  • Infrastructure management
  • Persistent serial networking

Choose remserial if:

You need older software to believe a remote device is local.

Best for:

  • Legacy industrial software
  • SCADA systems
  • Compatibility layers
  • Virtual serial device mapping

Choose socat if:

You need maximum flexibility and advanced routing.

Best for:

  • Developers
  • Embedded engineers
  • Test automation
  • Virtual serial devices
  • Protocol manipulation
  • Encrypted serial tunnels

Final Thoughts

Linux provides remarkably powerful tools for integrating serial hardware into modern IP-based systems.

Although ser2net, remserial, and socat overlap in functionality, each serves a distinct role:

  • ser2net excels at production serial serving
  • remserial shines in compatibility scenarios
  • socat dominates in flexibility and advanced stream routing

Combined with embedded hardware, WiFi-enabled serial gateways, and automation platforms from EZMation, these tools make it possible to modernize legacy serial infrastructure while preserving compatibility with existing equipment and software.

As browser-based serial technologies and remote automation systems continue to evolve, serial-over-network architectures remain an incredibly practical and powerful solution for embedded engineers, industrial automation professionals, and infrastructure developers alike.