无法使用 TCP 协议通过 VPN 建立与 SQL Server 的连接

发布于 2024-12-20 09:34:03 字数 252 浏览 4 评论 0原文

在日常工作中,我需要使用客户的数据库。对于此连接,首先,我需要将VPN连接到客户的网络,然后进行数据库连接。

正常情况下,如果使用TCP协议可以建立这个连接。但有时我无法连接到数据库。然后我跟踪网络包,发现该连接正在尝试使用 UDP 协议连接到客户的数据库。

现在我的网络环境使用“172.16”,如果我将网络更改为“10.12”,进行相同的连接,然后更改回“172.16”网络,则可以成功建立连接。

因为数据库在客户这边,所以我无法检查它。

During my daily work, I need to use the customer's Database. for this connection, first of all, I need to connect the VPN to customer's network, and then make the DB connection.

Normally, if this connection can be established using TCP protocol. But sometimes I cannot connect to the DB. Then I track the network package, I found the connection is attempting connect to customer's DB using UDP protocol.

And now my network environment is using '172.16', if I change my network to '10.12', do the same connection, then change back to the '172.16' network, the connection can be established successfully.

Because the DB is in customer's side, I cannot check it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

白云悠悠 2024-12-27 09:34:03

我首先要考虑的几件事:

  • 防火墙

    ...和...

  • 防火墙

PS:
昨天我遇到了一个案例,客户的数据库可以通过 Windows 主机名或“localhost”进行通信……但不能通过 IP 或主机名别名进行通信……即使客户端和 SQL Server 在同一台 PC 上! !!

Windows 防火墙已关闭。 SQL 服务器和客户端之间没有任何路由器(记住:同一台 PC!)。

但他们安装了一个新的 A/V 程序...它有自己的防火墙...并且不允许任何 SQL Server 连接。

聚苯醚:
当然,正确的方法是为您需要的所有服务(例如 MSSQL)配置防火墙例外。

The first couple of things I'd look at:

  • Firewall

    ... and ...

  • Firewall

PS:
Yesterday I had a case where the customer's database could communicate by Windows host name or by "localhost" ... but NOT by IP, nor by hostname alias ... even though the client and the SQL Server were ON THE SAME PC!!!!

Windows firewall was OFF. There wasn't any router between SQL server and the client (remember: same PC!).

But they installed a new A/V program ... that had it's own firewall ... and wouldn't allow any SQL Server connections.

PPS:
The correct approach, of course, is to configure firewall exceptions for all services you need (like MSSQL).

赤濁 2024-12-27 09:34:03

您可以咨询客户的服务器管理员,您所拥有的 VPN 访问权限是否具有足够的端口/路由访问权限来访问客户的服务器数据库。

通常 VPN 访问允许外部人员访问内部网络,但在您遇到问题时可能是由不同的路由器分配的。不是数据库问题,是网络问题。

You could check with the customer's server administrator if the VPN access you have would have sufficient port/route access with customer's server database.

Normally VPN access allow outsider to gain access to internal network but it might be assigned by different router at the time you encountered problem. It isn't db problem, it is network issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文