1

how can I define some IP filters for SQL server 2008 remote connection? (my server is running on winserver 2008 R2), I use remote desktop to to view my server and I can run firewall and sql server management studio, how should I block some IPs from accessing my sql server? should I disable remote connection at all? can you describe the procedure step by step? should I restart my windows server after making changes? thanks

2 Answers 2

2

You could also have a look at logon triggers (http://msdn.microsoft.com/en-us/library/bb326598.aspx). Essentially, you're going to get the client IP address from the eventdata that's part of the logon trigger context, get the value of ClientHost from it, and if it matches any of your forbidden IPs, execute a rollback. I'd go with a firewall solution myself, though.

1
  • This was my first thought as well, though I'd prefer to do it at the hardware/network layer. Jul 17, 2011 at 16:14
1

I think SQL Server traffic is on port 1433 tcp, So basically you want to block some IP's on that port on your server, Windows built-in Firewall lacks this kind of functionality (also i'm not sure about that never used Windows built-in firewall anyway) so I suggest you install Comodo Firewall free edition and add inbound rule that blocks all traffic coming from specific IP address to port 1433 on your server. You can try other free firewalls (i've tried ZoneAlarm but prefer Comodo) and do the same

Edited:

I've found a way to do this in Windows Firewall, see this

How can a block IP addresses using Windows Server 2008 firewall?

You must log in to answer this question.