What does an RD Gateway do for Remote Desktop users, and why does it keep TCP 3389 off the internet?
answer
- front door for remote desktops
- RDP wrapped in HTTPS
- three jobs in connection order
- only the gateway is published
basics
~20 sAn RD Gateway takes the user's connection over HTTPS on port 443, authenticates and authorizes it, then relays the RDP traffic to the internal host. Only the gateway faces the internet; the hosts keep 3389 private.
solid answer
~40 sRD Gateway sits in the perimeter network and does three jobs in connection order: it builds an encrypted TLS tunnel to a certificate the client trusts, it authenticates the user (through its web server, optionally with the RADIUS protocol toward an MFA solution), and it passes traffic between the client and the target host for as long as the connection lasts. Clients reach it on TCP 443, plus UDP 3391 when its optional UDP channel is used, so no router port-forward of 3389 is needed; 3389 stays the hosts' own RDP port on the inside. Two policies, RD CAP and RD RAP, decide who gets through and to what. The cost is that the gateway itself is now the internet-facing server, so it needs a publicly trusted certificate, updates and, ideally, MFA.
go deeper
Recall that the gateway wraps RDP in HTTPS on 443 so session hosts keep 3389 private, and that it authenticates the user before relaying.
Walk the three jobs in order, name TCP 443 and UDP 3391, and explain that CAP and RAP gate who connects and to what.
Add what remains: a publicly trusted certificate, MFA through RADIUS, gateway updates, and a check that no stray 3389 forward survives.
Frame the trade: many exposed listeners become one critical server, so ownership, patch cadence and fallback must be assigned before cutover.
## The problem the gateway solves Remote Desktop Protocol listens on TCP 3389 on every Windows host that accepts remote sessions. Publishing a desktop to remote staff by forwarding 3389 on the router puts that listener on the internet, one host per forwarded port, each carrying whatever patch level and password hygiene that host has. **Remote Desktop Gateway (RD Gateway)** replaces all of those exposures with one: a server in the perimeter network that speaks HTTPS to the outside and RDP to the inside. Microsoft's planning page describes the result as letting users reach internal resources from outside the corporate firewall, and the deployment page says this works without the need for a VPN. The gateway is a Remote Desktop Services role, installed on top of the web server role. ## The three jobs, in connection order 1. **Establish an encrypted SSL tunnel** between the user's device and the gateway. The gateway must present a certificate the device recognizes. The page allows self-signed certificates in tests and proofs of concept only; production should use a publicly trusted certificate authority. 2. **Authenticate the user.** The gateway uses its web server for this and can use the RADIUS protocol to bring in a multi-factor authentication solution. Beyond the default policies, administrators write additional RD Resource Authorization Policies (RD RAPs) and RD Connection Authorization Policies (RD CAPs) to say which users may reach which resources. 3. **Pass traffic back and forth** between the device and the chosen resource for as long as the connection exists. Timeout properties on the gateway servers limit how long an abandoned session stays open. ## What the firewall and the client see | Where | Port | What it is | |---|---|---| | Internet to gateway | TCP 443 | HTTPS, the gateway's main entry | | Internet to gateway | UDP 3391 | the gateway's optional UDP channel | | Gateway to session host | TCP 3389 | the host's own RDP listener, reached from inside | | Internet to RD Web Access | TCP 443 | the web portal that publishes desktops and apps | The role guidance for a gateway virtual machine is a public address that allows inbound TCP 443 and inbound UDP 3391, and a certificate whose name matches the name clients use to reach it, whether that is the public address's DNS name or a CNAME pointing at it. A privately issued certificate means every client must be given the trust chain beforehand. ## Where RD Web Access fits RD Web Access is the portal that lists the desktops and apps a user may launch, selectively published per user or group, and starts them in the device's native Remote Desktop client. It needs the web server role and HTTPS on 443. The gateway is plugged into that flow as a deployment property, or typed into a connection by users who connect without a feed. Small deployments may combine the two roles on one machine. ## What the gateway does not do - It is **not a VPN**. It relays RDP channels to named targets: the client connects to the gateway, and the gateway makes a separate connection to the target server. The client gets no address on the internal network. - It does **not replace the host's own sign-in**. Users still authenticate to the session host after the gateway lets the connection through. - It does **not balance sessions across hosts**. Placing users on a farm and returning them to a disconnected session is the Connection Broker's job. - It does **not make a surviving port-forward safe**. Traffic that bypasses the gateway bypasses its policies. ## What it costs and what it leaves open - The exposure shrinks to one server, but that server is now reachable by everyone, so its updates, certificate renewal and policies are the new critical path. - The gateway authorizes at connection setup through RD CAP and RD RAP; the material on per-request access decisions covers what that does not do. - A forwarded 3389 elsewhere in the estate is untouched by the gateway; the evidence is an external check of your own address ranges and the firewall rule set, not the gateway console. - Larger gateway farms sit in a load-balanced set, and IP affinity is not required. ## Checks to run after cutover - An external check of your own address ranges shows TCP 443 (and UDP 3391 if enabled) on the gateway and no 3389 on any host. - A device outside the network opens the gateway's address without a certificate warning. - The default policies have been replaced by policies that name real groups and real hosts. ## How to say it in an interview Start with the sentence "the gateway wraps RDP in HTTPS so 3389 never faces the internet", then give the three jobs in order, then the two policies, then the honest cost: you have traded many exposed listeners for one internet-facing server that you must keep patched and fronted with MFA.
- A router still forwards 3389 to one session host after the gateway goes live; what has the migration achieved?Only part of its purpose. The gateway protects hosts that are reachable solely through it, but a surviving forward is a second, ungated door to that host. Find it with an external check of your own address ranges and a review of firewall rules, then remove it, since the gateway's policies never see that traffic.
- Why must the gateway's certificate be publicly trusted in production?Every client device has to recognize it before the tunnel forms, and the gateway is meant to be public. A self-signed certificate is documented for tests and proofs of concept; a privately issued one works only if each client was given its trust chain first, which outside users rarely have.
- Says the gateway is a VPN that puts the whole client on the network.
- Believes port 3389 must be forwarded to the gateway from the internet.
- Thinks a self-signed gateway certificate is fine for production because the tunnel is encrypted.
- Forgets the gateway itself is now the internet-facing server needing updates.
- Treats RD Web Access and RD Gateway as the same role.