How to add Firewall Rule to Windows 2008 Server Firewall to restrict access to a port to specified IP Addresses
- Log into your server via RDP.
- Click on start > administrative tools > windows firewall with advanced security.
- On the left side of the firewall window click on the inbound rules option.
- On the right side of the screen click on New Rule.
- Click on the custom radio button and then click next.
- Make sure the All programs radio is selected then click next.
- On the protocol and ports options, select TCP and add the required port
- On the scope screen you will see two boxes the top one is for local IP addresses and the bottom is for remote IP addresses. In this scenario we are trying to allow an outside (remote) IP from accessing port 21 on the server so we will need to add the IP address to this section only as it will not be a local IP address.
- Click on the radio that says “these IP addresses ” in the remote section and add the IP addresses you wish to grant access
- Click ok, click next.
- Make sure you select the Allow the connection radio on the next screen and then click next.
- Leave all of the options on the next screen checked this will be sure to block the IP no matter the connection they are trying to use. Click next.
- Name the rule on the next screen something you can remember in case you wish to remove or edit it in the future. Click finish and thats it.