Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Jul 17 '11 at 8:32

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

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.

share|improve this answer
    
This was my first thought as well, though I'd prefer to do it at the hardware/network layer. –  Peter Schofield Jul 17 '11 at 16:14
add comment

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?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.