User Tools

Site Tools


systemd Cookbook

Network Proxy (like socat)

Sometimes you want to create a simple proxy. For example, you want to forward the local port 3389/tcp to the remote host port 3389/tcp to enable RDP access for other hosts. You maybe stumble upon socat and put together a working command like this:

socat TCP4-LISTEN:3389,fork,reuseaddr TCP4:

Now you want to start this proxy in the background in case of a reboot of the system. systemd offers its own way of creating a proxy like this with systemd-socket-proxyd.

You have to create a socket and a service file. The socket file defines the listening socket and will trigger the service file on start and stop.


After creating/editing the files, systemd has to be reloaded.

systemctl daemon-reload

Enable the socket to activate it at boot and immediately start it with “–now”.

systemctl enable --now proxy-to-rdphost.socket
apps/systemd/cookbook.txt · Last modified: 2024-03-07 18:39 by Manuel Frei