[GH-ISSUE #3575] 通过frpc中转 frpc,ssh,mysql 都可以,但oracle始终失败,不知什么原因 #2851

Closed
opened 2026-05-05 13:50:48 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @miws on GitHub (Aug 14, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3575

Describe the feature request

网络架构
我的电脑 <--> 前置机(公网) --> 指定内网服务器 <--> oracle服务器

  1. 指定内网服务器与oracle服务器 可以相互访问
  2. 前置机对内只能访问 指定内网服务器
  3. 指定内网服务器 不可以访问 前置机
  4. 前置机仅有特定的很少端口可被其他公网服务电脑访问
  5. 前置机(公网),指定内网服务器 上运行的 frps frpc 为0.51.2, 下文中的另一公网服务器运行 frps 0.40.0

于是

  1. 我在 指定内网服务器 运行frps, 和frpc, frpc将 oracle服务器的1521及本机的 ssh 通过 stcp向外映射
    frps.ini
    [common] bind_port = 9000
    frpc.ini
    `
    [ssh]
    type = stcp
    sk = ssh
    local_ip = 127.0.0.1
    local_port = 22

[oracle]
type = stcp
sk = oracle
local_ip = 10.20.30.40
local_port = 1521
`

  1. 在 前置机(公网)上运行两个frpc
    frpc1.ini
    `
    [common]
    server_addr = 10.20.30.41
    server_port = 9000
    tls_enable = false

[sshv]
type = stcp
role = visitor
server_name = ssh
sk = ssh
bind_addr = 127.0.0.1
bind_port = 9001

[ov]
type = stcp
role = visitor
server_name = oracle
sk = oracle
bind_addr = 127.0.0.1
bind_port = 9002
这样将 指定内网服务器ssh 及 oracle数据库服务器 1521映射 到了 前置机上。 再通过另一frpc2.ini 将 前置机的 22, 9001, 9002向外映射。
[common]
server_addr = x.x.x.x
server_port = 7000
tls_enable = false
log_level = debug
[front]
type = stcp
sk = front
local_ip = 127.0.0.1
local_port = 22
[back]
type = stcp
sk = mssh
local_ip = 127.0.0.1
local_port = 9001

[oracle]
type = stcp
sk = mssh
local_ip = 127.0.0.1
local_port = 9002
结果 前置机的 22, 9001 这两个端口能够正常工作,但9002终于无法在外面访问,通过 trace方式看到 前置机 frpc2.log 中
2023/08/14 14:27:42 [D] [proxy_wrapper.go:255] [ceae20b5fb455200] [oracle] start a new work connection, ..........
2023/08/14 14:27:42 [D] [proxy.go:201] [ceae20b5fb455200] [oracle] join connections, ......................
2023/08/14 14:27:42 [D] [proxy.go:213] [ceae20b5fb455200] [oracle] join connections closed
`
不知为何会关闭。

求各位大神指导。

Describe alternatives you've considered

No response

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @miws on GitHub (Aug 14, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3575 ### Describe the feature request 网络架构 我的电脑 <--> 前置机(公网) --> 指定内网服务器 <--> oracle服务器 1. 指定内网服务器与oracle服务器 可以相互访问 2. 前置机对内只能访问 指定内网服务器 3. 指定内网服务器 不可以访问 前置机 4. 前置机仅有特定的很少端口可被其他公网服务电脑访问 5. 前置机(公网),指定内网服务器 上运行的 frps frpc 为0.51.2, 下文中的另一公网服务器运行 frps 0.40.0 于是 1. 我在 指定内网服务器 运行frps, 和frpc, frpc将 oracle服务器的1521及本机的 ssh 通过 stcp向外映射 frps.ini ` [common] bind_port = 9000 ` frpc.ini ` [ssh] type = stcp sk = ssh local_ip = 127.0.0.1 local_port = 22 [oracle] type = stcp sk = oracle local_ip = 10.20.30.40 local_port = 1521 ` 2. 在 前置机(公网)上运行两个frpc frpc1.ini ` [common] server_addr = 10.20.30.41 server_port = 9000 tls_enable = false [sshv] type = stcp role = visitor server_name = ssh sk = ssh bind_addr = 127.0.0.1 bind_port = 9001 [ov] type = stcp role = visitor server_name = oracle sk = oracle bind_addr = 127.0.0.1 bind_port = 9002 ` 这样将 指定内网服务器ssh 及 oracle数据库服务器 1521映射 到了 前置机上。 再通过另一frpc2.ini 将 前置机的 22, 9001, 9002向外映射。 ` [common] server_addr = x.x.x.x server_port = 7000 tls_enable = false log_level = debug [front] type = stcp sk = front local_ip = 127.0.0.1 local_port = 22 [back] type = stcp sk = mssh local_ip = 127.0.0.1 local_port = 9001 [oracle] type = stcp sk = mssh local_ip = 127.0.0.1 local_port = 9002 ` 结果 前置机的 22, 9001 这两个端口能够正常工作,但9002终于无法在外面访问,通过 trace方式看到 前置机 frpc2.log 中 ` 2023/08/14 14:27:42 [D] [proxy_wrapper.go:255] [ceae20b5fb455200] [oracle] start a new work connection, .......... 2023/08/14 14:27:42 [D] [proxy.go:201] [ceae20b5fb455200] [oracle] join connections, ...................... 2023/08/14 14:27:42 [D] [proxy.go:213] [ceae20b5fb455200] [oracle] join connections closed ` 不知为何会关闭。 求各位大神指导。 ### Describe alternatives you've considered _No response_ ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [X] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [X] Others
gitea-mirror 2026-05-05 13:50:48 -06:00
Author
Owner

@cnjmj commented on GitHub (Aug 15, 2023):

我理解的是local_ip是指frpc所在的主机的IP,也就是只能是本机接口。
你这种情况可能需要在本地做个转发才能实现

<!-- gh-comment-id:1678634213 --> @cnjmj commented on GitHub (Aug 15, 2023): 我理解的是local_ip是指frpc所在的主机的IP,也就是只能是本机接口。 你这种情况可能需要在本地做个转发才能实现
Author
Owner

@miws commented on GitHub (Aug 16, 2023):

@fatedier 帮忙看看需要怎么调整

<!-- gh-comment-id:1679820421 --> @miws commented on GitHub (Aug 16, 2023): @fatedier 帮忙看看需要怎么调整
Author
Owner

@fatedier commented on GitHub (Aug 16, 2023):

@miws Github issue 仅接受明确的 bug report 和 feature request,精力不足,寻求帮助的话建议在其他平台上发帖求助。

<!-- gh-comment-id:1679928791 --> @fatedier commented on GitHub (Aug 16, 2023): @miws Github issue 仅接受明确的 bug report 和 feature request,精力不足,寻求帮助的话建议在其他平台上发帖求助。
Author
Owner

@github-actions[bot] commented on GitHub (Sep 16, 2023):

Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1722079557 --> @github-actions[bot] commented on GitHub (Sep 16, 2023): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#2851
No description provided.