Check the Windows Firewall rule for RDP port 12230

Find and verify the inbound TCP 12230 rule that lets Remote Desktop reach your RunRacks server, recreate it if it was deleted and scope it without locking yourself out.

  • Intermediate
  • Windows VPS · Admin RDP
  • 5 min read

By RunRacks Team · Published

RunRacks Windows VPS and Admin RDP servers accept Remote Desktop on TCP port 12230. Windows Defender Firewall must allow that port inbound, or nobody can connect. This guide shows how to find the rule, confirm it is enabled and correct, recreate it if it has gone missing, and narrow it to your own IP addresses safely.

Before you start

  • A Remote Desktop session to the server at 203.0.113.10:12230, signed in as an administrator.
  • PowerShell as Administrator: right-click Start, choose Terminal (Admin) or Windows PowerShell (Admin).
  • Know where the browser console is: it is in the control panel for your service in the Dashboard. It works without Remote Desktop, so it is your way back if a firewall change goes wrong.

Find the rule for port 12230

Firewall rules and their ports are stored separately, so search by port and then show the matching rules:

PowerShell
Get-NetFirewallPortFilter -Protocol TCP |
  Where-Object LocalPort -eq 12230 |
  Get-NetFirewallRule |
  Format-Table Name, DisplayName, Enabled, Direction, Action, Profile

A healthy result has at least one rule with:

  • Enabled: True
  • Direction: Inbound
  • Action: Allow
  • Profile: Any, or one that includes the profile your network uses (usually Public on a VPS).

Check which profile the server's network uses:

PowerShell
Get-NetConnectionProfile | Format-Table Name, InterfaceAlias, NetworkCategory

If the rule covers only Domain and the network is Public, the rule will not apply.

Check the rule's details

Look at the address and program filters, which can also block traffic. Replace the display name with the one from the previous step:

PowerShell
$rule = Get-NetFirewallRule -DisplayName "Remote Desktop (TCP 12230)"
$rule | Get-NetFirewallAddressFilter | Format-List RemoteAddress
$rule | Get-NetFirewallApplicationFilter | Format-List Program
  • RemoteAddress : Any means connections are allowed from anywhere.
  • A list of addresses means only those IPs can connect. Make sure your current IP is included.
  • Program : Any is normal for a port rule.

Also check that no block rule overrides it. Block rules win over allow rules:

PowerShell
Get-NetFirewallPortFilter -Protocol TCP |
  Where-Object LocalPort -eq 12230 |
  Get-NetFirewallRule |
  Where-Object Action -eq 'Block'

This should return nothing.

Recreate the rule if it is missing

If the search found no allow rule, add one. If you are connected at the moment, an existing session may survive briefly, but new connections will fail until the rule exists, so do this from the browser console if needed.

PowerShell
New-NetFirewallRule -DisplayName "Remote Desktop (TCP 12230)" `
  -Direction Inbound -Protocol TCP -LocalPort 12230 `
  -Action Allow -Profile Any

If an old rule exists but is disabled, enable it instead of adding a duplicate:

PowerShell
Enable-NetFirewallRule -DisplayName "Remote Desktop (TCP 12230)"

Then confirm Remote Desktop itself still listens on 12230:

PowerShell
Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name PortNumber

The result should show PortNumber : 12230.

Scope the rule to your IP addresses

Limiting the rule to the addresses you connect from blocks almost all password-guessing bots. Do it only if your IP is fixed or changes rarely.

  1. Find your current public IP from your own PC, for example by searching what is my IP in a browser.
  2. Set the rule's allowed addresses, listing every location you use. This example allows one office IP and one home range:
PowerShell
   Set-NetFirewallRule -DisplayName "Remote Desktop (TCP 12230)" `
     -RemoteAddress 198.51.100.20, 192.0.2.0/24
  1. Without closing your current session, open a new Remote Desktop connection to 203.0.113.10:12230 to prove it still works.
  2. To undo the scope at any time:
PowerShell
   Set-NetFirewallRule -DisplayName "Remote Desktop (TCP 12230)" -RemoteAddress Any

Check it works

From your own PC, test the port:

PowerShell
Test-NetConnection 203.0.113.10 -Port 12230

TcpTestSucceeded : True means the firewall allows you in. On the server you can confirm the listener is up:

PowerShell
Get-NetTCPConnection -LocalPort 12230 -State Listen

Troubleshooting

  • Rule exists but the port test fails: the profile does not match the network, a block rule overrides it, or your IP is outside the scoped addresses. Run the checks above.
  • Locked out after a change: open the browser console from the Dashboard, sign in and run the reset command Set-NetFirewallRule ... -RemoteAddress Any or recreate the rule. More help is in Fix a firewall change that locked you out of RDP.
  • Two rules for 12230: harmless, but confusing. Keep one and remove the duplicate with Remove-NetFirewallRule -Name <Name> using the Name column from the search.
  • Port test works, but sign-in fails: the firewall is fine. Check your username and password in the Dashboard.

Next steps

Was this guide helpful?

Still stuck?

Ask RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.

Security

iptables basics: list, allow, drop and save rules

Learn how iptables chains and rule order work, then build a small ruleset that allows SSH and web traffic, drops everything else and can be edited by line number.

  • Intermediate
  • Linux VPS
  • 6 min read

Security

RDP Hardening: Using Local Security Policy to Limit User Rights

Restrict what RDP users can do on a Windows VPS by editing user rights in Local Security Policy — who may log on remotely, who holds admin rights, and which dangerous privileges stay with Administrators only.

  • Intermediate
  • Windows VPS · Admin RDP
  • 6 min read