Resolving the IP address that restricts access to SQL Server

Source: Internet
Author: User

  We just want to make an IP computer connect to the SQL Server servers, not to allow other clients to connect, how to operate?

        WORKAROUND: You can restrict it directly to the firewall, allowing only 1433 of the traffic to be established with the specified IP address. Of course, from a more secure perspective, 1433 ports should be converted to other ports.         Other workaround 1 (limited to clients with specified IP access): If you use SQLServer2005, you can also implement the endpoint restriction method, which requires a dedicated network card, All clients that can connect to SQL Server are connected through this network card (assuming the IP of this NIC is 192.168.1.1):         1. In SQL Server Configuration Manager SQLServer2005 Network Configuration ", prohibit all protocols except TCP/IP;         2. Use the following T-SQL to disallow default TCP endpoints        !--         Code highlighting produced byactiprocodehighlighter (freeware)        --&G T ALTER ENDPOINT [TSQL Default TCP]         state = STOPPED         3. Use the following T-SQL to create a new TCP endpoint and authorization        !--        Code highlighting produced Byactiprocodehighlighter (f Reeware)        --> use master         go        --Create a new Endpoint        !--        Code highlighting produceD Byactiprocodehighlighter (freeware)        --> CREATE ENDPOINT [TSQL User TCP]     &NBS P   State = started         as TCP (        Listener_port = 1433,         LISTENER_IP = (192.168.1.1)--Listening network address        )         for TSQL ()         go        -Grant all logins (or login) access to this endpoint        !--&N Bsp       Code highlighting produced byactiprocodehighlighter (freeware)        --> GRAN T CONNECT on Endpoint::[tsql User TCP]         to [public]         After completing the above configuration, only through the network A client with an address configured as 192.168.1.1 can access SQL Server, and if only the specified login is granted connection rights to the endpoint, only the specified login can access the SQL Server instance.         Other workaround 2 (IP-specific client access only)         When SQL Server 2005 is upgraded to SP2 or higher, you can also pass new triggers To achieve control.         executes the following T-SQL and will make the addition of the IP addressConnection to client outside of 192.168.1.1 failed.        !--        Code highlighting produced byactiprocodehighlighter (freeware)        --> use master         go         CREATE TRIGGER TR _logincheck         on all servers         for LOGON         AS         ROLLBACK TRAN         GO
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.