7

一个关于路由器端口转发的问题

 2 years ago
source link: https://www.v2ex.com/t/820999
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  程序员

一个关于路由器端口转发的问题

  movq · 1 天前 · 771 次点击

我的 WAN 口具有公网 IP ,记为 A.B.C.D

局域网有一台机器 M ,记为 192.168.1.2

这台机器的 3306 端口有一个 mysql 服务在监听,已经开启所有 IP 都可以访问。

我设置了如下的端口转发:

A.B.C.D:8888 -> 192.168.1.2:3306

这样的话,我使用非局域网的其它机器,可以通过 A.B.C.D:8888 连接到机器 M 上面的 mysql

但是我在 M 机器本机上面,使用 datagrip ,根据 A.B.C.D:8888 却无法连接到 mysql

使用telnet A.B.C.D:8888,无反应。使用telnet localhost:3306有反应

所以只能使用 localhost:3306 来连接

这是为什么???


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK