Frp: 通过systemd无法穿透成功,但直接启动可以正常工作

Created on 2 May 2020  ·  2Comments  ·  Source: fatedier/frp

Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.

Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST

What version of frp are you using (./frpc -v or ./frps -v)?
0.33.0

What operating system and processor architecture are you using (go env)?
frpc: Debian GNU/Linux 10 x86_64
frps: Debian GNU/Linux 10 x86_64

Configures you used:
frpc.ini:
[common]
server_addr = x.x.x.x
server_port = 10000

tcp_mux = true
tls_enable = true

authentication_method = token
auto_token = xxxxxxxx

[poste-25]
type = tcp
local_ip = 127.0.0.1
local_port = 10025
remote_port = 25

frps.ini:
[common]
bind_port = 10000

tcp_mux = true
tls_enable = true
tls_only = true

authentication_method = token
auto_token = xxxxxxxx

Steps to reproduce the issue:
1.systemctl start frpc
2.systemctl start frps or /usr/bin/frps -c /etc/frp/frps.ini

Describe the results you received:
通过systemctl start frps启动时,提示port unavaliable

May 02 12:41:41 xxxxx systemd[1]: Started Frp Server Service.
May 02 12:41:41 xxxxx frps[13407]: 2020/05/02 12:41:41 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
May 02 12:41:41 xxxxx frps[13407]: 2020/05/02 12:41:41 [I] [root.go:209] start frps success
May 02 12:41:48 xxxxx frps[13407]: 2020/05/02 12:41:48 [I] [service.go:432] [a466bccfd73973a0] client login info: ip [x.x.x.x:58818] version [0.33.0] host
May 02 12:41:48 xxxxx frps[13407]: 2020/05/02 12:41:48 [W] [control.go:441] [a466bccfd73973a0] new proxy [poste-25] error: port unavailable

Describe the results you expected:
通过/usr/bin/frps -c /etc/frp/frps.ini手动启动frps时,穿透正常

2020/05/02 12:42:08 [I] [service.go:178] frps tcp listen on 0.0.0.0:10000
2020/05/02 12:42:08 [I] [root.go:209] start frps success
2020/05/02 12:42:14 [I] [service.go:432] [487b86fa5db05c0b] client login info: ip [x.x.x.x:58852] version [0.33.0] hostname [] os [linux] arch [amd64]
2020/05/02 12:42:14 [I] [tcp.go:63] [487b86fa5db05c0b] [poste-25] tcp proxy listen port [25]
2020/05/02 12:42:14 [I] [control.go:445] [487b86fa5db05c0b] new proxy [poste-25] success

Additional information you deem important (e.g. issue happens only occasionally):
使用lsof或netstat查看,服务端与客户端相关端口均未被占用

Most helpful comment

根据frp的systemd配置默认使用nobody用户运行,而非root是不允许监听1024以下的端口。
所以,把frp的systemd配置里面的“User=nobody”和下面那行“G....=nobody”注释或者删除。
也可以把“remote_port”改成1024以上的端口。

All 2 comments

根据frp的systemd配置默认使用nobody用户运行,而非root是不允许监听1024以下的端口。
所以,把frp的systemd配置里面的“User=nobody”和下面那行“G....=nobody”注释或者删除。
也可以把“remote_port”改成1024以上的端口。

根据frp的systemd配置默认使用nobody用户运行,而非root是不允许监听1024以下的端口。
所以,把frp的systemd配置里面的“User=nobody”和下面那行“G....=nobody”注释或者删除。
也可以把“remote_port”改成1024以上的端口。

已解决,感谢!

Was this page helpful?
0 / 5 - 0 ratings