Sql-server – Block SQL Server IP on Windows Server 2008 R2

sql server

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

Best Answer

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.