skip to content
Maathuran's Blog
Setting up Remote Desktop Gateway

Setting up Remote Desktop Gateway

/ 2 min read

Introduction

With our setup of a Proxmox Cluster, Another tool I would like to learn is Active Directory. To start things off, I will be setting up Windows Server 2022 21H2 on Proxmox and will link it to the domain ata.al

Adding Remote Desktop Gateway

Under Deployment Overview, click on RD Gateway. WD1

Add RDS.ata.al to the selected computers, then click on Next. WD2

For the SSL name, I will keep it the same as the hostname, as this is the URL that will be outside the lab, too. WD3

Click on Add WD3

It will take some time to install the service WD4

If it asks for certificates, that can be skipped, as we will configure it later. Click on Close WD5

RDG Port Configuration

We will be forwarding the following ports

ProtocalPortsDescription
TCP80Used for SSL Cert generation (letsencrypt HTTP-01)
TCP443Used for SSL
UDP3391RDP over UDP (improving steaming)

Caddy Config

{
    "apps": {
        "layer4": {
            "servers": {
                "HTTP": {
                    "listen": [
                        ":80"
                    ],
                    "routes": [
                        {
                            "match": [
                                {
                                    "http": [
                                        {
                                            "host": [
                                                "rds.ata.al"
                                            ]
                                        }
                                    ]
                                }
                            ],
                            "handle": [
                                {
                                    "handler": "proxy",
                                    "upstreams": [
                                        {
                                            "dial": [
                                                "10.0.220.12:80"
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                },
                "HTTPS": {
                    "listen": [
                        ":443"
                    ],
                    "routes": [
                        {
                            "match": [
                                {
                                    "tls": {
                                        "sni": [
                                            "rds.ata.al"
                                        ]
                                    }
                                }
                            ],
                            "handle": [
                                {
                                    "handler": "proxy",
                                    "upstreams": [
                                        {
                                            "dial": [
                                                "10.0.220.12:443"
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                },
                "U3391": {
                    "listen": [
                        "udp/0.0.0.0:3391"
                    ],
                    "routes": [
                        {
                            "handle": [
                                {
                                    "handler": "proxy",
                                    "upstreams": [
                                        {
                                            "dial": [
                                                "udp/10.0.220.12:3391"
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            }
        }
    }
}