mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #1959] 关于内网穿透映射FTP #1559
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#1559
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 @HuangLuxuan on GitHub (Aug 29, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/1959
我试着映射FTP,结果压根用不了,发现是FileZilla服务器接受PASV指令后返回的结果被修改了,变成运行FRPS的机器的内网地址以及一个我也不清楚是什么的端口,这可咋整啊。(顺带一提,跑FRPC和FRPS的都是XP,所以在跑0.24.0,希望有救)
相关配置:
[server_ftp_21]
type = tcp
local_ip = 127.0.0.1
local_port = 21
remote_port = 21
use_encryption = true
use_compression = true
[range:server_ftp_1024_1151]
type = tcp
local_ip = 127.0.0.1
local_port = 1024-1151
remote_port = 1024-1151
use_encryption = true
use_compression = true
#啊对了,这些端口还不停报错 [W] [control.go:141] [server_ftp_1024_1151_47] start error: port unavailable
@Becods commented on GitHub (Aug 29, 2020):
被动式FTP需要额外的端口
请检查FileZilla配置文件,确定被动式端口,并在frpc上配置
@HuangLuxuan commented on GitHub (Aug 30, 2020):
FTP配置都是没毛病的,telnet测试发现经过frp后发现服务器发送的内容变了,PASV命令回复的地址变成frps机器的内网IP了,端口也变了(变得端口实在是看不出来有什么规律)
@Becods commented on GitHub (Aug 30, 2020):
由于数据需要经过frpc代理,故FileZilla接收到的ip为frpc的ip,端口为frpc开的随机端口
请考虑使用支持#get-real-ip的软件
@HuangLuxuan commented on GitHub (Sep 1, 2020):
不不不,我说FileZilla回复的内容经过frpc到frps之后变了,变成frps的IP了,不是说与FileZilla建立tcp的IP是frpc的
@HuangLuxuan commented on GitHub (Sep 3, 2020):
我的网络是这么一个结构
跑FRPC的机器@192.168.0.100 --- NAT网关@10.22.176.56 --- 西北大学南校区@211.137.127.234 --- 互联网
跑FRPS的机器@192.168.1.2 --- NAT网关@117.23.248.92(已将相关端口映射至192.168.1.2) --- 互联网
在跑FRPC的机器上用Telnet进行三次实验,分别访问127.0.0.1:21,192.168.0.100:21和117.23.248.92:21,然后登录并发送PASV命令,实验结果发现,前两次回文皆为
227 Entering Passive Mode (117,23,248,92,4,0)
第三次回文是
227 Entering Passive Mode (192,168,1,2,19,137)
实验说明FRPC到FRPS的过程中修改了这个内容,导致FTP服务器无法传输数据
具体的实验过程可以参考以下文件
20200903.txt
@Becods commented on GitHub (Sep 5, 2020):
https://github.com/fatedier/frp/issues/219
请善用搜索
@HuangLuxuan commented on GitHub (Sep 5, 2020):
也恳请你看一下我上条回复,我觉得如果你真的看了,大概不会这样回复我
@HuangLuxuan commented on GitHub (Mar 6, 2022):
今天研究了下具体什么情况会被篡改结果,发现是remote_port一旦设置为21,frp就会修改FTP服务返回的被动模式ip地址,虽然通过把remote_ip修改成非21的值能解决,但是这并不是我想要的方法,试着读了下源码,还是没有找到是哪里修改的ip
@fatedier commented on GitHub (Mar 6, 2022):
@HuangLuxuan 你既然能阅读代码,就说明有弄清楚问题的能力,那么最好在完全弄清楚了细节之后再提问会比较合适。
@HuangLuxuan commented on GitHub (Mar 6, 2022):
细节就是在一切搭建正确的情况下,如果remote_port设置为21的话,frp就会将ftp服务器返回的被动端口的ip成错误的,这样就没法链接ftp了,如果设置为其它任意值frp就不会替换,ftp内网穿透正常工作
@fatedier commented on GitHub (Mar 6, 2022):
Show me the code.
@HuangLuxuan commented on GitHub (Mar 6, 2022):
配置文件中的内容,实验的过程和结果都在上面,往上翻就能看到