Restrict an SQL Server connection to a specific IP address

后端 未结 4 1562
长情又很酷
长情又很酷 2020-11-29 05:46

I want to restrict the connections to my SQL Server instance to specific IP addresses. I want to prevent any connections from any IP addresses except a specific list. Is thi

4条回答
  •  醉酒成梦
    2020-11-29 05:50

    Sounds like something you'd do using the Windows firewall (you can block the SQL Server port(s), and allow exceptions for certain IP addresses).

    You could do this with something like a logon trigger that checked the IP address using sys.dm_exec_connections but I think it's a much less desirable option than blocking the traffic outright.

    Certainly much tougher to do at the database level.

提交回复
热议问题