mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[GH-ISSUE #4503] [Feature Request] 有偿解决frp+Synology Drive 显示真实ip的问题。 #3557
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#3557
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wuai1024 on GitHub (Oct 21, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4503
Describe the feature request
我在使用frp内网穿透synology drive 后,显示的一直都是frpc的内网ip地址。

我希望这里能显示到正确的ip.
ps. synology drive是使用的tcp协议,不能使用http中的 X-Forwarded-For 来获取真实ip。
通过群辉自家的 QuickConnent 能显示客户端的真实ip,我不明白其中是如何实现的。
Describe alternatives you've considered
No response
Affected area
@JsonSong89 commented on GitHub (Oct 21, 2024):
群辉自己有个ddns服务吧 比如客户端访问http://ifconfig.me/
获取自己的公网ip,然后通过某个接口上报给服务端
frp想加这个功能也挺简单,就两个http请求的事情 自己改改代码都行
@wuai1024 commented on GitHub (Oct 21, 2024):
不是一个东西,下去先沉淀沉淀吧。
@huangluyu commented on GitHub (Oct 22, 2024):
这里显示正确的 ip 是为了什么?如果是为了分享文件时链接使用 frp server 的公网 IP,那么群晖的设置中可以直接设置这个 ip
@wuai1024 commented on GitHub (Oct 22, 2024):
主要是为了安全和 ACL控制,这个服务和ssh是一样的,都是tcp协议的,但是没有直接支持 Proxy Protocol 协议。需要其他方式处理下。
我的ssh服务也不能开启公网访问,因为一直显示的是我 frpc 的内网ip,所以做不了安全控制。
这2个服务是一个逻辑,如果能处理好其中一个,另外一个就同理可得了。
@wuai1024 commented on GitHub (Oct 22, 2024):
就例如这样的拓扑:

@JustinTangChina commented on GitHub (Oct 22, 2024):
你的Synology drive这个群辉干嘛不直接连到frp服务端上面,按照你的描述你是通过192.168.1.24中转后再link到drive的,显示ip地址192.168.1.24这是很正常的,无论你外网的什么地址访问 都是通过 192.168.1.24这个frp客户端建立的中转去访问的
所以如果你想显示真实ip 应该是192.168.1.26连接到frp服务端
@wuai1024 commented on GitHub (Oct 22, 2024):
这样的效果是一样的,会显示 192.168.1.26 的地址。
@wuai1024 commented on GitHub (Oct 22, 2024):
@fatedier 大佬,有什么办法没,给指导指导。
这个可能需要 linux 内核态的支持吧。
@JustinTangChina commented on GitHub (Oct 22, 2024):
那如果是Synology Drive 显示 的问题估计你找frp这边解决不了,群辉那边可以是因为走他们自家的协议,你用第三方的显示访问者的ip估计需要群辉那边支持才行,frp的log里面是能查到这些的,但是群辉app那边没有和第三方的frp合作
@JustinTangChina commented on GitHub (Oct 22, 2024):
内核估计你有点难,除非你伪装成群辉自家的服务
@JustinTangChina commented on GitHub (Oct 22, 2024):
群辉的QC说白了也是frp 但是那是他们家的
@wuai1024 commented on GitHub (Oct 22, 2024):
我在 frp 里面能看到真实ip,在nginx的日志里面也能看到,就是因为 Synology Drive 不支持那个协议。所以才想一些其他办法。
@JustinTangChina commented on GitHub (Oct 22, 2024):
所以你想在Synology Drive上去显示估计难实现
@cholau0 commented on GitHub (Oct 24, 2024):
这个貌似解决不了,之前我的OA也是和你一样的架构,显示的也是跳板机的IP。你这除非自己解包了,真IP应该在包里面封着
@cholau0 commented on GitHub (Oct 24, 2024):
这个设置不知道有没有用:
transport.proxyProtocolVersion = "v2"
realip
@wuai1024 commented on GitHub (Oct 25, 2024):
这个配置了的,这样nginx日志中才能显示到真实ip。只是因为 nginx 转发的 后端服务不支持这个协议。
就想能不能通过其他方法,例如 iptables 等内核态的工具,把真实的公网ip 作为源ip给传递给 后端服务。
@github-actions[bot] commented on GitHub (Nov 16, 2024):
Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
@ilcxyz commented on GitHub (Jan 14, 2025):
我在尝试穿透至viger也是这个问题,看来是程序架构的问题,SSH也是正常的。
@ilcxyz commented on GitHub (Jan 14, 2025):
我在尝试穿透至viger也是这个问题,看来是程序架构的问题,SSH也是正常的。
@MikoyChinese commented on GitHub (Mar 4, 2025):
Try this https://github.com/fatedier/frp/issues/4692.
@wuai1024 commented on GitHub (Mar 5, 2025):
Thank you very much.