We only want a computer with an IP address to connect to the SQL Server server. Other clients are not allowed to connect. How can this problem be solved?
Solution: You can set limits on the firewall to only allow 1433 communication with the specified IP address. Of course, from a more secure perspective, you should change port 1433 to another port. Other solution 1 (limited to clients connected from a specified IP address): If SQLServer2005 is used, you can also use the endpoint restriction method. This method requires a dedicated Nic, all clients that can connect to SQLServer are connected through this NIC (assuming the IP address of this Nic is 192.168.1.1): 1. in "SQLServer2005 network configuration" of "SQL Server Configuration Manager", all protocols except TCP/IP are prohibited; 2. use the following T-SQL to disable the default TCP endpoint! -- Code highlighting produced byActiproCodeHighlighter (freeware) --> alter endpoint [TSQL Default TCP] STATE = STOPPED 3. Use the following T-SQL to create new TCP endpoints and authorizations! -- Code highlighting produced byActiproCodeHighlighter (freeware) --> USE master GO -- Create a New Endpoint! -- Code highlighting produced byActiproCodeHighlighter (freeware) --> create endpoint [TSQL User TCP] STATE = started as tcp (LISTENER_PORT = 1433, LISTENER_IP = (192.168.1.1) -- network address of the listener) for tsql () GO -- Grant all logon (or specified logon) the connection permission to use this endpoint! -- Code highlighting produced byActiproCodeHighlighter (freeware) --> grant connect on endpoint: [TSQL User TCP] TO [public] After completing the preceding configuration, only clients connected by NICs configured with the network address 192.168.1.1 can access SQLServer. In addition, if only the connection permission for the specified logon to the endpoint is granted, only the specified logon can access SQLServer instance. Other solution 2 (limited to client access with the specified IP address) when SQL Server 2005 is upgraded to SP2 or a later version, new triggers can also be used for control. After the following T-SQL is executed, client connection except IP address 192.168.1.1 fails.! -- Code highlighting produced byActiproCodeHighlighter (freeware) --> USE master go create trigger tr_LoginCheck ON ALL SERVER FOR LOGON AS ROLLBACK TRAN GO