Windows firewall blocks remote desktop with custom port

42,938

Solution 1

To open custom port in Windows Firewall, you can do the following:

  1. In your Windows Firewall in Control Panel, click on the Advanced Settings option on the left.
  2. In the Windows Firewall with Advanced Security window that opens, click on the Inbound Rules on the left.
  3. Click on the New Rule on the right side of the window.
  4. Select Port on the list of options.
  5. Select TCP (or UDP if that is what you require) and Specific local ports, and then write your ports in the text box to the right of Specific local ports (i.e. 1234).
  6. Select Allow the connection in the next window.
  7. Select the options which you need from Domain, Private, Public (private and public are the network types that you select when you connect to the new network, and windows asks you to select the network type, and domain is obviously your domain).
  8. Finally, write a Name and Description in the window that shows next. Click FINISH.

Your port should be now allowed through the Windows Firewall.

Solution 2

If you changed the RDP listening port you will need to create a custom Windows firewall rule to listen on that port.

Create a firewall rule for new port:

  • Open Windows Firewall with Advanced Security
    1. Create a new rule
    2. Select "Inbound Rules" on the top left
    3. Right-click and select "New Rule…"
    4. A new "Inbound Rule Wizard" window opens
    5. Select "Program"
    6. click Next
    7. Select “This program path:”
    8. Type System in the text field
    9. Click Next
    10. Select “Allow the connection”
    11. Click Next
    12. Choose the profiles that the rule is for
    13. Click Next
    14. Name the new rule
    15. I would use something like “RDP3390” or whatever the new port number is
    16. Click "Finish"
    17. Test your port by going to www.whatsmyip.org and use their port scanner. You should be able to turn the rule off and off the scan fail.

Solution 3

Just in case anyone is still having difficulty with this, this is what I had to do...

Windows 10 creates 3 inbound firewall rules when you set options for remote desktop. You need to create 3 new rules exactly like those 3 rules except you must specify your new custom port instead.

The 3 rules are:

Remote Desktop - Shadow (TCP-In)

Remote Desktop - User Mode (TCP-In)

Remote Desktop - User Mode (UDP-In)

you cannot copy and paste them so you must read them and then create from scratch as program rules in Inbound rules and edit accordingly.

Then when you have done that you must disable the above 3 microsoft rules which point to port 3389.

Good luck!

Solution 4

To complete the previous answers I must add the following:

In case that you want to connect to a Virtualbox machine through a RDP custom port you have to disabled the "Virtual Box Manager" default rule, who is blocking all the connection to the Virtual Box Software, without this, the inbound rules that you add will not work.

Share:
42,938
user1995781
Author by

user1995781

Updated on September 18, 2022

Comments

  • user1995781
    user1995781 over 1 year

    I was able to use my remote desktop with custom port when I was using Kaspersky Internet Security. Now, I have uninstalled my Kaspersky and switch to Avast!. Therefore, the windows firewall is turned on back again. However, after the firewall is turned on, I cannot connect to the remote desktop. I have set the remote desktop "checked" in the windows firewall as shown by here: http://windows.microsoft.com/en-my/windows7/use-remote-desktop-when-windows-firewall-is-on.

    So, I am guessing it is caused by the custom port setting of my remote desktop. So, how can I unblock that on firewall to make my remote desktop works again?

    Thank you.

    • barlop
      barlop about 10 years
      You are essentially asking how do you add a port to the windows firewall. (which would be windows firewall behaving as one would want from a firewall!)
  • DavidPostill
    DavidPostill almost 8 years
    Welcome to Super User! This is really a comment and not an answer to the original question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. Please read Why do I need 50 reputation to comment? What can I do instead?
  • llinfeng
    llinfeng over 5 years
    I would like to highlight step #2-#8!!!! I have spent hours after having opened ports through my home router, only to get confused about why none of my other Windows PC with customized ports should be inaccessible for RDP without having disabled the firewall completely.
  • fantabolous
    fantabolous over 4 years
    If you want to limit the port to RDP access, you should specify "Remote Desktop Services" under Programs&Services->Services.
  • Louis Waweru
    Louis Waweru over 4 years
    Hi @percept, would you mind mentioning where to view and create the rules?