[GH-ISSUE #1505] 配置为ubuntu服务后,每次重启系统,提示路由冲突 #1187

Closed
opened 2026-05-05 12:45:58 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @at2008 on GitHub (Nov 7, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1505

应用场景说明

一个服务器端(公网),两个客户端(一个在局域网,一个在公网),

  • 重启局域网端的那个 frpc.service ,每次都提示 路由冲突,需要先重启一次服务器端的frps.service,然后再重启 frpc.service ,可以正常代理
  • 重启那个在公网的客户端 frpc.service ,正常

情况说明

局域网端 frpc 配置为ubuntu服务后,每次重启系统或者手工命令行方式重启frpc.service,提示路由冲突;

sudo systemctl restart frpc.service
sudo systemctl status frpc.service
11月 07 12:13:46 wa-System-Product-Name systemd[1]: Started frp-client daemon.
11月 07 12:13:46 wa-System-Product-Name frpc[4521]: 2019/11/07 12:13:46 [I] [service.go:234] login to server success, get run id [c77d55be793b953b], server udp port [0]
11月 07 12:13:46 wa-System-Product-Name frpc[4521]: 2019/11/07 12:13:46 [I] [proxy_manager.go:144] [c77d55be793b953b] proxy added: [hos-http-m.domain.cn
11月 07 12:13:46 wa-System-Product-Name frpc[4521]: 2019/11/07 12:13:46 [W] [control.go:151] [hos-http-m.domain.cn] start error: router config conflict

临时解决方法

需要服务器端先重启一次,然后客户端再 重启一次,这样才能正常启动客户端代理

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

0.29.0

What operating system and processor architecture are you using (go env)?

ubuntu 18.04

Configures you used:

/etc/systemd/system/frpc.service

[Unit]
Description=frp-client daemon
Wants=NetworkManager-wait-online.service network-online.target
After=NetworkManager-wait-online.service network.target network-online.target
[Service]
Type=simple
Restart=on-failure
RestartSec=5s
WorkingDirectory=/home/username/frp
ExecStart=/home/username/frp/frpc -c /home/username/frp/frpc.ini
ExecReload=/home/username/frp/frpc reload -c /home/username/frp/frpc.ini
[Install]
WantedBy=multi-user.target

==============frps=============

frps.ini

[common]
bind_port = 11001
kcp_bind_port = 11001
vhost_http_port = 80
vhost_https_port = 443
==============frpc=============

frpc.ini

[common]
server_addr = x.x.x.x
server_port = 11001
protocol = kcp

[hos-http-m.mydomain.cn]
type = http
local_port = 8000
custom_domains = m.mydomain.cn

Steps to reproduce the issue:
1.
2.
3.

Describe the results you received:

Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):

Can you point out what caused this issue (optional)

Originally created by @at2008 on GitHub (Nov 7, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1505 # 应用场景说明 一个服务器端(公网),两个客户端(一个在局域网,一个在公网), - 重启局域网端的那个 frpc.service ,每次都提示 路由冲突,需要先重启一次服务器端的frps.service,然后再重启 frpc.service ,可以正常代理 - 重启那个在公网的客户端 frpc.service ,正常 # 情况说明 局域网端 frpc 配置为ubuntu服务后,每次重启系统或者手工命令行方式重启frpc.service,提示路由冲突; ``` sudo systemctl restart frpc.service sudo systemctl status frpc.service ``` ``` 11月 07 12:13:46 wa-System-Product-Name systemd[1]: Started frp-client daemon. 11月 07 12:13:46 wa-System-Product-Name frpc[4521]: 2019/11/07 12:13:46 [I] [service.go:234] login to server success, get run id [c77d55be793b953b], server udp port [0] 11月 07 12:13:46 wa-System-Product-Name frpc[4521]: 2019/11/07 12:13:46 [I] [proxy_manager.go:144] [c77d55be793b953b] proxy added: [hos-http-m.domain.cn 11月 07 12:13:46 wa-System-Product-Name frpc[4521]: 2019/11/07 12:13:46 [W] [control.go:151] [hos-http-m.domain.cn] start error: router config conflict ``` # 临时解决方法 需要服务器端先重启一次,然后客户端再 重启一次,这样才能正常启动客户端代理 **What version of frp are you using (./frpc -v or ./frps -v)?** 0.29.0 **What operating system and processor architecture are you using (`go env`)?** ubuntu 18.04 **Configures you used:** # /etc/systemd/system/frpc.service [Unit] Description=frp-client daemon Wants=NetworkManager-wait-online.service network-online.target After=NetworkManager-wait-online.service network.target network-online.target [Service] Type=simple Restart=on-failure RestartSec=5s WorkingDirectory=/home/username/frp ExecStart=/home/username/frp/frpc -c /home/username/frp/frpc.ini ExecReload=/home/username/frp/frpc reload -c /home/username/frp/frpc.ini [Install] WantedBy=multi-user.target ==============frps============= # frps.ini [common] bind_port = 11001 kcp_bind_port = 11001 vhost_http_port = 80 vhost_https_port = 443 ==============frpc============= # frpc.ini [common] server_addr = x.x.x.x server_port = 11001 protocol = kcp [hos-http-m.mydomain.cn] type = http local_port = 8000 custom_domains = m.mydomain.cn **Steps to reproduce the issue:** 1. 2. 3. **Describe the results you received:** **Describe the results you expected:** **Additional information you deem important (e.g. issue happens only occasionally):** **Can you point out what caused this issue (optional)**
Author
Owner

@fatedier commented on GitHub (Nov 7, 2019):

这个和使用 kcp 协议有关系,服务端没有感知到连接的中断,只能依靠心跳超时来判断,这样会有一定的延时。目前已经采用了在关闭程序前会主动 close 自身,但是网络环境不同,会导致可能某些情况下没有起作用。

这种情况,建议在 frpc.ini 中加上 login_fail_exit = false

一般在达到心跳超时后会自动恢复。

<!-- gh-comment-id:550869596 --> @fatedier commented on GitHub (Nov 7, 2019): 这个和使用 kcp 协议有关系,服务端没有感知到连接的中断,只能依靠心跳超时来判断,这样会有一定的延时。目前已经采用了在关闭程序前会主动 close 自身,但是网络环境不同,会导致可能某些情况下没有起作用。 这种情况,建议在 frpc.ini 中加上 `login_fail_exit = false`。 一般在达到心跳超时后会自动恢复。
Author
Owner

@at2008 commented on GitHub (Nov 7, 2019):

这个和使用 kcp 协议有关系,服务端没有感知到连接的中断,只能依靠心跳超时来判断,这样会有一定的延时。目前已经采用了在关闭程序前会主动 close 自身,但是网络环境不同,会导致可能某些情况下没有起作用。

多谢大神,我暂时取消 kcp 了,一切正常了!

<!-- gh-comment-id:550884246 --> @at2008 commented on GitHub (Nov 7, 2019): > 这个和使用 kcp 协议有关系,服务端没有感知到连接的中断,只能依靠心跳超时来判断,这样会有一定的延时。目前已经采用了在关闭程序前会主动 close 自身,但是网络环境不同,会导致可能某些情况下没有起作用。 多谢大神,我暂时取消 `kcp` 了,一切`正常`了!
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#1187
No description provided.