Windows firewall blocks remote desktop with custom port
To open custom port in Windows Firewall, you can do the following:
- In your Windows Firewall in Control Panel, click on the Advanced Settings option on the left.
- In the Windows Firewall with Advanced Security window that opens, click on the Inbound Rules on the left.
- Click on the New Rule on the right side of the window.
- Select Port on the list of options.
- 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).
- Select Allow the connection in the next window.
- 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).
- Finally, write a Name and Description in the window that shows next. Click FINISH.
Your port should be now allowed through the Windows Firewall.
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
- Create a new rule
- Select "Inbound Rules" on the top left
- Right-click and select "New Rule…"
- A new "Inbound Rule Wizard" window opens
- Select "Program"
- click Next
- Select “This program path:”
- Type System in the text field
- Click Next
- Select “Allow the connection”
- Click Next
- Choose the profiles that the rule is for
- Click Next
- Name the new rule
- I would use something like “RDP3390” or whatever the new port number is
- Click "Finish"
- 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.