I'm trying to connect to my local sql server while vpn is connected but it throws an error saying 'The target principal name is incorrect. Cannot generate SSPI context. (.Net SqlClient Data Provider)'. Split tunneling is enabled but it does not resolve the issue. If I disconnect from the vpn I can connect to the local sql server just fine. However, when split tunneling is enabled I can no longer remote desktop onto my vms on the vpn. What's the issue and how can I fix it?
1 Answer
- Check if you have overlapping ip address space on either side of the tunnel.
- Check name resolution.
- Try connecting with an ip instead of a name.
- Try using a "test connection" (UDL file)
- Consider putting the name in your hosts file. On windows it should be
C:\windows\system32\drivers\etc\hosts - regarding UDL files: https://support.microsoft.com/en-us/topic/how-to-test-connections-to-sql-server-using-an-universal-data-link-file-udl-911075ba-c7fb-51b4-a847-26ceab92d3e9
- Thank you. There's no overlap of ip address space. Trying with an ip address does not work. Adding to hosts file does not work and testing with udl does not work. How could I check name resolution? I can however ping the ip address of the sqlserver successfully.izuuriver– izuuriver2021-01-26 14:50:35 +00:00Commented Jan 26, 2021 at 14:50
- To check name resolution you could simply ping the server by name. There are other ways depending on the name resolution mechanisms active in your environment. If you are using DNS for name resolution,
nslookupwould be the tool to use. If you are relying on PNRP or NetBIOS,pingshould work for basic troubleshooting.ApatheticSheep– ApatheticSheep2021-01-27 15:19:27 +00:00Commented Jan 27, 2021 at 15:19