Network, Ports and Firewalls

lamco-rdp-server listens on the standard RDP port, 3389, for TCP, and on the same port for UDP when the UDP side channel is on. A desktop firewall that blocks the port blocks the server without a trace in its log, so open it first when a client can't connect.

Listen address

[server]
listen_addr = "[::]:3389" # default: IPv6 and IPv4 on one socket
# listen_addr = "0.0.0.0:3389" # IPv4 only
# listen_addr = "127.0.0.1:3389" # this machine only, for an SSH tunnel
  • The default [::]:3389 takes IPv6 and IPv4 clients on every host. The listener clears IPV6_V6ONLY itself, so a host with net.ipv6.bindv6only = 1 still accepts IPv4. IPv4 clients arrive as IPv4-mapped addresses.
  • A localhost-only listener needs no sign-in for server.desktop_session = "on-connect"; on any other address that mode needs PAM or NLA.
  • The server has no IP allowlist of its own. Restrict who can reach it with the firewall, as below.

Open the port

Omarchy and CachyOS ship ufw enabled, and Fedora, RHEL and openSUSE ship firewalld enabled. Open 3389 for TCP, and for UDP if you turn the UDP side channel on.

# firewalld (Fedora, RHEL, AlmaLinux, openSUSE)
sudo firewall-cmd --add-port=3389/tcp --add-port=3389/udp --permanent
sudo firewall-cmd --reload

# ufw (Ubuntu, Omarchy, CachyOS)
sudo ufw allow 3389/tcp
sudo ufw allow 3389/udp

# nftables, into an existing inet filter table's input chain
sudo nft add rule inet filter input tcp dport 3389 accept
sudo nft add rule inet filter input udp dport 3389 accept

To allow one network only, use the firewall's source rules, for example sudo ufw allow from 192.168.1.0/24 to any port 3389 proto tcp. Make nftables rules permanent in /etc/nftables.conf, as your distribution does it.

The UDP side channel

With the UDP side channel on, the server offers a client RDP-UDP after its TLS or NLA handshake and moves the picture onto it once the client confirms. That keeps the picture moving on a lossy link where TCP would stall. Sound, keyboard, mouse and the clipboard stay on TCP. A client that declines, or whose UDP handshake fails, stays on TCP.

[udp_transport]
enabled = false # true offers UDP; also a switch on the GUI's Server tab
# bind_addr = "[::]:3389" # unset: the address the client reached over TCP
  • Leave bind_addr unset on a host with several addresses: The socket then binds to the address the client reached over TCP, which mstsc needs.
  • The log says "The picture now goes over the UDP side channel" when a session moves.
  • If the UDP transport dies after the picture moved onto it, the server ends the connection so the client reconnects at once, because mstsc doesn't accept the picture moving back to TCP.
  • In the 1.4.6 release test, mstsc on Windows Server 2025 moved to the UDP side channel (RDP-UDP version 2) and stayed up through a 60-second hold. The transport is IronRDP's, where Lamco's fixes for mstsc over IPv6 and for a late UDP confirmation were merged.

Reaching the server from outside

The server signs clients in by default, with failed sign-ins rate limited for each address and account: The first three cost nothing, then the wait climbs from 5 seconds to 15 minutes, and fifty failures in a row disable sign-in until the server is restarted. Even so, the simplest safe way in from the internet is a tunnel: Listen on 127.0.0.1:3389 and forward the port over SSH or a VPN.

# on the client machine: forward local port 3389 to the server's loopback listener
ssh -L 3389:127.0.0.1:3389 user@HOST
# then connect the RDP client to localhost:3389

Through a tunnel like this the picture stays on TCP; the UDP side channel needs a direct UDP path.

Metrics endpoint

The server can serve Prometheus /metrics and a JSON /health over HTTP. It's off by default. Anyone who can reach the address can read them, so keep it on loopback unless a scraper elsewhere needs it.

[monitoring]
metrics_endpoint = true
metrics_bind = "127.0.0.1:9100"

Related