[GH-ISSUE #3814] p2p下访问samba,一直访问的是本机,已做端口转发 #3031

Closed
opened 2026-05-05 13:57:41 -06:00 by gitea-mirror · 8 comments
Owner

Originally created by @kktt007 on GitHub (Nov 29, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3814

p2p下访问samba怎么正确配置

  • frp --verison 0.52.3

  • 前提:已经配置过xtcp下ssh 端口转发访问被访问端,且被访问端的web端都能访问,一切正常

  • 现在是需要访问文件服务器linux上安装的samba4

被访问端是linux:

serverAddr = "x.x.x.x"
serverPort = 11111
frpc.toml:
[[proxies]]
name = "samba"
type = "xtcp"
secretKey = "abcde"
localIp = "192.168.1.3"
localPort = 445

访问端是windows:

frpc.toml
serverAddr = "x.x.x.x"
serverPort = 11111
[[visitors]]
name = "smb_visitor"
type = "xtcp"
serverName = "smb"
secretKey = "abcde"
bindAddr = "127.0.0.1"
bindPort = 12345
  • 然后windows下对445也做了端口转发了,用的命令是:
    netsh interface portproxy add v4tov4 listenport=445 connectaddress=127.0.0.1 connectport=12345

windows下查看是以下结果:

Listen on ipv4:             Connect to ipv4:

Address         Port        Address         Port
--------------- ----------  --------------- ----------
*               445         127.0.0.1       12345

现在在windows文件管理中输入 \127.0.0.1 默认定位到的是本机的共享,应该怎么设置才能xtcp远程访问到linux上的samba上面去。

  1. 怎么修改配置才能正常访问到Linux下的samba
  2. 如果实在不支持,有其他方案吗(ftp太古老了)

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 @kktt007 on GitHub (Nov 29, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3814 ### p2p下访问samba怎么正确配置 - frp --verison 0.52.3 - 前提:已经配置过xtcp下ssh 端口转发访问被访问端,且被访问端的web端都能访问,一切正常 - 现在是需要访问文件服务器linux上安装的samba4 ## 被访问端是linux: ``` serverAddr = "x.x.x.x" serverPort = 11111 frpc.toml: [[proxies]] name = "samba" type = "xtcp" secretKey = "abcde" localIp = "192.168.1.3" localPort = 445 ``` ## 访问端是windows: ``` frpc.toml serverAddr = "x.x.x.x" serverPort = 11111 [[visitors]] name = "smb_visitor" type = "xtcp" serverName = "smb" secretKey = "abcde" bindAddr = "127.0.0.1" bindPort = 12345 ``` - 然后windows下对445也做了端口转发了,用的命令是: netsh interface portproxy add v4tov4 listenport=445 connectaddress=127.0.0.1 connectport=12345 windows下查看是以下结果: ``` Listen on ipv4: Connect to ipv4: Address Port Address Port --------------- ---------- --------------- ---------- * 445 127.0.0.1 12345 ``` ### 现在在windows文件管理中输入 \\127.0.0.1 默认定位到的是本机的共享,应该怎么设置才能xtcp远程访问到linux上的samba上面去。 1. 怎么修改配置才能正常访问到Linux下的samba 2. 如果实在不支持,有其他方案吗(ftp太古老了) ### Describe alternatives you've considered _No response_ ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [X] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 13:57:41 -06:00
Author
Owner

@xqzr commented on GitHub (Nov 29, 2023):

Windows 默认会监听

tcp [::]:445
tcp 0.0.0.0:445
netstat -an|find "445"
<!-- gh-comment-id:1831557772 --> @xqzr commented on GitHub (Nov 29, 2023): Windows 默认会监听 ```log tcp [::]:445 tcp 0.0.0.0:445 ``` ```batch netstat -an|find "445" ```
Author
Owner

@superzjg commented on GitHub (Nov 29, 2023):

你这windows的转发445,貌似还缺少listenaddress,检查命令是不是错了。

<!-- gh-comment-id:1831922390 --> @superzjg commented on GitHub (Nov 29, 2023): 你这windows的转发445,貌似还缺少listenaddress,检查命令是不是错了。
Author
Owner

@kktt007 commented on GitHub (Nov 30, 2023):

Windows 默认会监听

tcp [::]:445
tcp 0.0.0.0:445
netstat -an|find "445"

是啊,而且默认端口改不了,所以我才用了转发,不过我只显示这一条:tcp 0.0.0.0:445,另一条对我没影响吧

<!-- gh-comment-id:1832930412 --> @kktt007 commented on GitHub (Nov 30, 2023): > Windows 默认会监听 > > ``` > tcp [::]:445 > tcp 0.0.0.0:445 > ``` > > ```batchfile > netstat -an|find "445" > ``` 是啊,而且默认端口改不了,所以我才用了转发,不过我只显示这一条:tcp 0.0.0.0:445,另一条对我没影响吧
Author
Owner

@kktt007 commented on GitHub (Nov 30, 2023):

你这windows的转发445,貌似还缺少listenaddress,检查命令是不是错了。

感谢回复
系统默认监听的445,这里的命令把445转发到12345,listenaddress就是frpc的12345端口,见最后

Address         Port        Address         Port
--------------- ----------  --------------- ----------
*               445         127.0.0.1       12345

在frpc(visitor访问端,也就是本机上)
bindAddr = "127.0.0.1"
bindPort = 12345

查看12345端口
TCP 127.0.0.1:12345 0.0.0.0:0 LISTENING 3032

<!-- gh-comment-id:1832934564 --> @kktt007 commented on GitHub (Nov 30, 2023): > 你这windows的转发445,貌似还缺少listenaddress,检查命令是不是错了。 感谢回复 系统默认监听的445,这里的命令把445转发到12345,listenaddress就是frpc的12345端口,见最后 ``` Address Port Address Port --------------- ---------- --------------- ---------- * 445 127.0.0.1 12345 ``` 在frpc(visitor访问端,也就是本机上) bindAddr = "127.0.0.1" bindPort = 12345 查看12345端口 TCP 127.0.0.1:12345 0.0.0.0:0 LISTENING 3032
Author
Owner

@xqzr commented on GitHub (Nov 30, 2023):

Windows 默认会监听

tcp [::]:445
tcp 0.0.0.0:445
netstat -an|find "445"

是啊,而且默认端口改不了,所以我才用了转发,不过我只显示这一条:tcp 0.0.0.0:445,另一条对我没影响吧

看起来 这一条 优先于“另一条”

<!-- gh-comment-id:1833625480 --> @xqzr commented on GitHub (Nov 30, 2023): > > Windows 默认会监听 > > ``` > > tcp [::]:445 > > tcp 0.0.0.0:445 > > ``` > > > > > > > > > > > > > > > > > > > > > > > > ```batchfile > > netstat -an|find "445" > > ``` > > 是啊,而且默认端口改不了,所以我才用了转发,不过我只显示这一条:tcp 0.0.0.0:445,另一条对我没影响吧 看起来 这一条 优先于“另一条”
Author
Owner

@ATKghost commented on GitHub (Dec 4, 2023):

尝试一下监听127.0.0.2、127.0.0.3这些地址呢?

<!-- gh-comment-id:1839266939 --> @ATKghost commented on GitHub (Dec 4, 2023): 尝试一下监听127.0.0.2、127.0.0.3这些地址呢?
Author
Owner

@github-actions[bot] commented on GitHub (Jan 4, 2024):

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

<!-- gh-comment-id:1876153049 --> @github-actions[bot] commented on GitHub (Jan 4, 2024): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
Author
Owner

@RowgerGo commented on GitHub (Nov 19, 2024):

大佬,你最后是怎么解决监听的

<!-- gh-comment-id:2484650072 --> @RowgerGo commented on GitHub (Nov 19, 2024): 大佬,你最后是怎么解决监听的
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#3031
No description provided.