We have a Sql Server in our office here that I connect to regularly. No problems.

We have a client now to whose VPN we need to connect using the Windows VPN software. When I connect to the VPN though, I can no longer connect to our local sql server.

I have made sure the VPN connection has the checkbox for "Use default gateway on remote network" is turned off for both IPv4 and IPv6, so I SHOULD be able to access my local LAN resources. I know that this at least partially working because I can RDP into our local servers.

For some reason though, I just cannot connect to our local Sql Server via Sql Server Manager or Sql Delta. I tried connecting via DNS name and IP address, both with and without ,1433 on the end.

By name without the port, I get the usual "network resource could not be found, make sure remote connections are enabled" message. When I try it by IP, or by name with the port, I get the following error:

enter image description here

Can anyone point me to how to fix this? I'm trying to get it set up so when we need to push changes, I can use Sql Delta to just generate change scripts and do it quickly, rather than having to backup/zip/copy/unzip/restore the whole database every time.

I'm using Windows 8. Thanks!

As requested, here is my route table...

C:\>route print
Interface List
 19...0c 60 76 37 fd 80 ......Microsoft Hosted Network Virtual Adapter
 13...00 26 b9 6f d3 84 ......NVIDIA nForce Networking Controller
 12...0c 60 76 37 fd 80 ......Dell Wireless 1510 Wireless-N WLAN Mini-Card
  1...........................Software Loopback Interface 1
 15...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
 16...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
 17...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2

IPv4 Route Table
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
     25     26         On-link    281     26         On-link    306         On-link    306         On-link    306         On-link    281         On-link    281         On-link    281         On-link    306         On-link    281         On-link    281         On-link    306         On-link    281         On-link    281
Persistent Routes:

IPv6 Route Table
Active Routes:
 If Metric Network Destination      Gateway
  1    306 ::1/128                  On-link
  1    306 ff00::/8                 On-link
Persistent Routes:


I'm a developer, so software is really my thing. When it comes to any kind of more advanced networking, I'm a little out of my element, so I'm not sure what to make of most of that.

  • 1
    Sounds like a routing problem. Can you print your routing table, pls? – MariusMatutiae Oct 14 '13 at 18:13
  • Updated @MariusMatutiae – eidylon Oct 14 '13 at 18:35
  • I understand you want to keep the IP address of your sql server reserved, can you just tell me whether it falls in the range 10.x.x.x? – MariusMatutiae Oct 14 '13 at 19:33
  • Yes, it does. Pretty much all our local servers are in 10.x.x.x . – eidylon Oct 14 '13 at 19:40
  • BTW, the range is one of those reserved for private IPs, so there's no need to edit, I cannot identify your location in any way from this. – MariusMatutiae Oct 19 '13 at 5:10

From your routing table it seems your main gateway is in the net, and the remote network (the one made accessible by the VPN) is instead But you also told us that pretty much all of your (local) servers are in the range. From this it follows that there is a clash of Ip addresses: when connected thru the VPN, all packets to are routed thru the VPN to the remote LAN, even those destined to your local sql server.

If the sql server is in the network, which I believe is the remote LAN accessible thru the VPN (please correct if I am getting this wrong), there is nothing you can do. If instead the server is not in a network, then the following commands, to be given after the establishment of the VPN conenction, will solve your problem:

route delete 
route ADD MASK  
route ADD MASK

There is an apparent conflict between these routes, but not to worry: the more restrictive rule always takes precedence on the larger rule, yielding the correct result.

  • I think I pretty much understand whatall you're saying here. The only thing that confuses me, given all this, is why I can RDP into our local servers without issue. – eidylon Oct 14 '13 at 20:58
  • Because this is not an issue with the connectivity - it is an authentication problem. – Nikola Dimitrijevic Oct 14 '13 at 21:59
  • @eidylon You have not given us enough info on what's happening to answer that question. In any case, changing the routing table the way I suggested takes one second, and the effect of these commands only lasts to the next reboot. So, if they work great, otherwise, turn the pc off and then on again, and we are back to square one. – MariusMatutiae Oct 15 '13 at 7:39
  • Yes yes YES! Thank you! I did have to adjust my routing tables... I removed all the 10.x.x.x ones, and added route add mask' and route add mask`. I also had to disconnect and reconnect the VPN, which makes sense. Now I can Sql Delta and connect to both at once! THANK YOU!!! I should add the 10.10.10.x one as a permanent. – eidylon Oct 18 '13 at 18:13

Try to do the following:

  1. Locate the .pbk file that contains the entry that you dial. In my case it is C:\Users\<user>\AppData\Roaming\Microsoft\Network\Connections\Pbk

  2. Open the file in Notepad.

  3. Locate the UseRasCredentials=1 entry

    enter image description here

  4. Change the 1 to 0 -> UseRasCredentials=0

    enter image description here

  5. Save it and close your Notepad

Just to add: I don't know how many VPN connections you have (I have one), but in case that you have more than one, you need to find all instances of UseRasCredentials=1 and change them to UseRasCredentials=0. Each VPN connection have the name in a form [VPN Connection name] at the beginning of its section

  • 1
    I just tried that, and it said was unable to verify the credentials. So I tried changing it back and now it refuses to connect and says it is unable to verify the server. – eidylon Oct 14 '13 at 19:28
  • I now see that I wrote what i wrote in a stupid manner :) Do you have more than one VPN connection? If you have more than one VPN connection you need to find all instances of UseRasCredentials=1 and change them to UseRasCredentials=0. Windows 7 and Vista unlike XP have different behaviour. XP would send the VPN credentials to SMB authentication only over the VPN, while Windows 7 is using the VPN credentials for all SMB authentications including local requests and VPN machines – Nikola Dimitrijevic Oct 14 '13 at 21:53
  • And maybe you can try with using fully qualified domain names for accessing your local resources? This should work, although I have never tried this. – Nikola Dimitrijevic Oct 14 '13 at 22:03
  • 2
    Well, using FQDN did not help. :/ – eidylon Oct 18 '13 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.