I'm trying to allow only specific computers on my domain to connect to a SQL Server instance but I appear to be inadvertently blocking all computers from connecting.
When I go in to configure the firewall on the server hosting the database, after setting which computers I want to be able to access the instance. It blocks all of them. After setting the rule back to its original state, it works.
On the Firewall rule, I have set the following:
- General Tab
- Action: Allow the connection if it is secure.
- Remote Computers
- Only allow connections from these computers: Checked
- The dialog box below is filled with the computer names I want: DOMAIN\PC1$, DOMAIN\PC2$, etc.
Setting this rule causes the connect to the server to time out after about 60 seconds and then comes back with the generic 'server does not exist or access denied' message.
What are the correct settings I need to use?
Best Answer
You can do this using the Windows Server 2012 built-in firewall and issuing simple and applicable Netsh AdvFirewall Firewall Commands from a command prompt (or batch script) run as administrator.
See "Scripts and Commands" below "Explanation". . .
Explanation
Essentially you'd allow inbound connections like so:
By the TCP port number the SQL Server instance is listening on the server
By allowing connections on this TCP port only from a specific (or a set of) IP address(es)
Scripts and Commands
Command Line
Batch Script Allow
Removing The Rule
Further Resources