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.

  • 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!) – barlop Mar 3 '14 at 9:20
up vote 6 down vote accepted

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.

  • 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. – llinfeng Dec 10 at 4:41

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.

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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.