[GH-ISSUE #366] 客户端【树莓派Ubuntu Mate系统】正常跑一段时间后,就连不上【阿里云windows Server2008R2】服务器了 #268

Closed
opened 2026-05-05 12:04:26 -06:00 by gitea-mirror · 11 comments
Owner

Originally created by @mymmoonoa on GitHub (Jun 15, 2017).
Original GitHub issue: https://github.com/fatedier/frp/issues/366

一、测试环境

  1. 服务器: 阿里云服务器, 操作系统:windows Server2008 R2 Enterprise 4GRAM 64位OS
    frp: frp_0.11.0_windows_386

  2. 客户端: 硬件:树莓派Model 3B armv7 操作系统:ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img
    frp: frp_0.11.0_linux_arm.tar.gz

二、frp配置

  1. 服务器端配置frps03.ini:
    [common] bind_port = 7000 vhost_http_port = 10001 subdomain_host = xxxx.club (省略) dashboard_port = 10000 dashboard_user = admin dashboard_pwd = ...(省略) privilege_allow_ports = 6999-7999,10000-20000 privilege_token = ...(省略) log_file = frps.log log_level = info log_max_days = 7
  2. 客户端配置frpc03.ini
    [common] server_addr = 106.1x.xx.xxx server_port = 7000 privilege_token = chixxx [web] type = http local_port = 3000 subdomain = test

三、测试步骤

  1. 客户端树莓派通过crontab开机自动启动脚本启动 ./frpc -c ./frpc03.ini和 3000端口express服务
  2. 一开始通过局域网访问树莓派3000端口、和通过test.xxxx.club:10001都能正常访问。
  3. 2个小时后,调试其它机器后回来,发现test.xxx.club不能正常访问。
  4. 树莓派上查看进程也还在执行中,尝试手动启动 ./frpc -c ./frpc03.ini,提示 dial tcp 106.xx.xx.xxx:7000: getsockopt: network is unreachable
  5. 在树莓派上直接ping服务器ip ping 106.xx.xx.xxx和www.xxx.club的域名都返回
    PING 106.xx.xx.xxx(106.xx.xx.xxx) 56(84) bytes of data. From 192.168.1.1 icmp_seq=1 Destination Net Unreachable
    大神们有没有什么建议,能不能帮忙分析下域名,ping www.baidu.com其它站点都能正常ping通,frp所在主机域名没法正常ping;
    树莓派重启后(不会!!)变好,这个要投入生产环境的,好想可以稳定工作啊

四、其它描述

这是第二次发现这种问题,在做crontab forever自动加载之前发生过一次。
要是需要完整域名和账号配置测试可以私信 ma_thilda@126.com

五、图片
img_1172 -

Originally created by @mymmoonoa on GitHub (Jun 15, 2017). Original GitHub issue: https://github.com/fatedier/frp/issues/366 一、测试环境 1. 服务器: 阿里云服务器, 操作系统:windows Server2008 R2 Enterprise 4GRAM 64位OS frp: frp_0.11.0_windows_386 2. 客户端: 硬件:树莓派Model 3B armv7 操作系统:ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img frp: frp_0.11.0_linux_arm.tar.gz 二、frp配置 1. 服务器端配置frps03.ini: ` [common] bind_port = 7000 vhost_http_port = 10001 subdomain_host = xxxx.club (省略) dashboard_port = 10000 dashboard_user = admin dashboard_pwd = ...(省略) privilege_allow_ports = 6999-7999,10000-20000 privilege_token = ...(省略) log_file = frps.log log_level = info log_max_days = 7 ` 2. 客户端配置frpc03.ini ` [common] server_addr = 106.1x.xx.xxx server_port = 7000 privilege_token = chixxx [web] type = http local_port = 3000 subdomain = test ` 三、测试步骤 1. 客户端树莓派通过crontab开机自动启动脚本启动 ./frpc -c ./frpc03.ini和 3000端口express服务 2. 一开始通过局域网访问树莓派3000端口、和通过test.xxxx.club:10001都能正常访问。 3. 2个小时后,调试其它机器后回来,发现test.xxx.club不能正常访问。 4. 树莓派上查看进程也还在执行中,尝试手动启动 ./frpc -c ./frpc03.ini,提示 `dial tcp 106.xx.xx.xxx:7000: getsockopt: network is unreachable` 5. 在树莓派上直接ping服务器ip `ping 106.xx.xx.xxx`和www.xxx.club的域名都返回 `PING 106.xx.xx.xxx(106.xx.xx.xxx) 56(84) bytes of data. From 192.168.1.1 icmp_seq=1 Destination Net Unreachable ` 大神们有没有什么建议,能不能帮忙分析下域名,ping www.baidu.com其它站点都能正常ping通,frp所在主机域名没法正常ping; 树莓派重启后(不会!!)变好,这个要投入生产环境的,好想可以稳定工作啊 四、其它描述 这是第二次发现这种问题,在做crontab forever自动加载之前发生过一次。 要是需要完整域名和账号配置测试可以私信 ma_thilda@126.com 五、图片 ![img_1172 -](https://user-images.githubusercontent.com/650114/27170343-20fa2784-51e0-11e7-9870-b2b3658430dd.JPG)
Author
Owner

@mymmoonoa commented on GitHub (Jun 15, 2017):

ping www.baidu.com 都是 64Bytes from 180.97.33.108: ...这样的字段
为什么frpc不能正常工作ping 自己的frps服务器都是From 192.168.1.1

<!-- gh-comment-id:308656300 --> @mymmoonoa commented on GitHub (Jun 15, 2017): ping www.baidu.com 都是 `64Bytes from 180.97.33.108: ...`这样的字段 为什么frpc不能正常工作ping 自己的frps服务器都是`From 192.168.1.1`啊
Author
Owner

@mymmoonoa commented on GitHub (Jun 15, 2017):

@fatedier 或者谁能能帮忙解释下原因,怎样才能修复这个问题吗,我这边补充些脚本的方式都可以,Linux用的比较少,很多东西不太懂的希望多多指导

<!-- gh-comment-id:308656825 --> @mymmoonoa commented on GitHub (Jun 15, 2017): @fatedier 或者谁能能帮忙解释下原因,怎样才能修复这个问题吗,我这边补充些脚本的方式都可以,Linux用的比较少,很多东西不太懂的希望多多指导
Author
Owner

@mymmoonoa commented on GitHub (Jun 15, 2017):

看了下路由表 http://www.ehowstuff.com/how-to-check-routing-table-on-linux-centos-6-2/
对比自己的稍有不同,不知道哪里有问题

pic2

<!-- gh-comment-id:308685803 --> @mymmoonoa commented on GitHub (Jun 15, 2017): 看了下路由表 [ http://www.ehowstuff.com/how-to-check-routing-table-on-linux-centos-6-2/ ](url) 对比自己的稍有不同,不知道哪里有问题 ![pic2](https://user-images.githubusercontent.com/650114/27176061-c0291168-51f3-11e7-86c5-94f31ba0f45a.JPG)
Author
Owner

@wxlg1117 commented on GitHub (Jun 15, 2017):

先看看frps的log判断是frpc主动掉的还是frps踢的,然后再分析

<!-- gh-comment-id:308687290 --> @wxlg1117 commented on GitHub (Jun 15, 2017): 先看看frps的log判断是frpc主动掉的还是frps踢的,然后再分析
Author
Owner

@wxlg1117 commented on GitHub (Jun 15, 2017):

而且我试过,lan内机器配置frpc转发服务到外网,lan网关(掉线)或者lan机器网络发生问题(比如网卡禁用)然后隔一段时间恢复正常,frpc重连正常的啊

<!-- gh-comment-id:308688039 --> @wxlg1117 commented on GitHub (Jun 15, 2017): 而且我试过,lan内机器配置frpc转发服务到外网,lan网关(掉线)或者lan机器网络发生问题(比如网卡禁用)然后隔一段时间恢复正常,frpc重连正常的啊
Author
Owner

@mymmoonoa commented on GitHub (Jun 15, 2017):

@wxlg1117

  1. 我有到服务器端看log, 发现这段时间记录为空;
  2. 我在树莓派的ubuntu mate上,其它所有的网址都能正常浏览和ping通,唯独frps阿里云服务器不能ping通和访问(ip和域名都不行!)(取名树莓派1号),我试了另外一台同一个无线网段下的树莓派(2号)下,是可以直接ping通和连接上frps阿里云服务器的。
    错误的信息
    PING 106.xx.xx.xxx(106.xx.xx.xxx) 56(84) bytes of data. From 192.168.1.1 icmp_seq=1 Destination Net Unreachable
    看了下Destination Net unreachable的解释

感觉好像是192.168.1.1网关没资格替我管frps服务器的ip了,它直接不知道找谁了

<!-- gh-comment-id:308695412 --> @mymmoonoa commented on GitHub (Jun 15, 2017): @wxlg1117 1. 我有到服务器端看log, 发现这段时间记录为空; 2. 我在树莓派的ubuntu mate上,其它所有的网址都能正常浏览和ping通,唯独frps阿里云服务器不能ping通和访问(ip和域名都不行!)(取名树莓派1号),我试了另外一台同一个无线网段下的树莓派(2号)下,是可以直接ping通和连接上frps阿里云服务器的。 错误的信息 PING 106.xx.xx.xxx(106.xx.xx.xxx) 56(84) bytes of data. From 192.168.1.1 icmp_seq=1 Destination Net Unreachable 看了下Destination Net unreachable的[解释](http://www.firewall.cx/networking-topics/protocols/icmp-protocol/153-icmp-destination-unreachable.html) 感觉好像是192.168.1.1网关没资格替我管frps服务器的ip了,它直接不知道找谁了
Author
Owner

@mymmoonoa commented on GitHub (Jun 15, 2017):

我刚试了
sudo ifdown -a; sudo ifup -a
sudo /etc/init.d/networking restart; ... stop, ... start
sudo wlan0 down; ... up
网络重新连上后,问题依旧,其它网址都能正常访问,唯独frps的阿里云不行,看来只能reboot了

<!-- gh-comment-id:308702678 --> @mymmoonoa commented on GitHub (Jun 15, 2017): 我刚试了 sudo ifdown -a; sudo ifup -a sudo /etc/init.d/networking restart; ... stop, ... start sudo wlan0 down; ... up 网络重新连上后,问题依旧,其它网址都能正常访问,唯独frps的阿里云不行,看来只能reboot了
Author
Owner

@mymmoonoa commented on GitHub (Jun 15, 2017):

好消息是,好像把路由器弄挂了, 我对树莓派gracefully reboot和直接断电后开机后,ping frps域名依旧是 Destination Net Unreachable错误提示,ping ip变了,一直挂着没反应。明天来公司看下路由器情况,再重启试验下

<!-- gh-comment-id:308704278 --> @mymmoonoa commented on GitHub (Jun 15, 2017): 好消息是,好像把路由器弄挂了, 我对树莓派gracefully reboot和直接断电后开机后,ping frps域名依旧是 Destination Net Unreachable错误提示,ping ip变了,一直挂着没反应。明天来公司看下路由器情况,再重启试验下
Author
Owner

@mymmoonoa commented on GitHub (Jun 16, 2017):

  1. 早上树莓派1号开机, 直接又能ping通了frps域名服务器了,但是test.xxx.club:10001的访问仍不能用; sudo reboot后,树莓派1号又跟昨天一样不能ping通frps服务器了,返回Destination Net Unreachable.
  2. 我用手机网络共享热点后,树莓派1号连接上手机wifi后,又能ping通frps服务器了。(所以是路由器192.168.1.1问题?)
    但这个时候我仍然不能直接访问test.xxx.club:10001;
    我这时kill -9 frpc的进程, 手动执行./frpc -c ./frpc03.ini后;报错提示
    ...[I][control.go:255] [...] login to serer success, get run id [...]
    ...[W][control.go:345][...] [web] start error: proxy name [web] is already in use

树莓派2号的frpc.ini的配置与树莓派1号一样,只有subdomain不同,我把树莓派2号关机后,就一切正常了
难道不能在所有的客户端的ini文件中都用 [web]吗??

<!-- gh-comment-id:308913787 --> @mymmoonoa commented on GitHub (Jun 16, 2017): 1. 早上树莓派1号开机, 直接又能ping通了frps域名服务器了,但是test.xxx.club:10001的访问仍不能用; sudo reboot后,树莓派1号又跟昨天一样不能ping通frps服务器了,返回Destination Net Unreachable. 2. 我用手机网络共享热点后,树莓派1号连接上手机wifi后,又能ping通frps服务器了。(所以是路由器192.168.1.1问题?) 但这个时候我仍然不能直接访问test.xxx.club:10001; 我这时kill -9 frpc的进程, 手动执行./frpc -c ./frpc03.ini后;报错提示 ...[I][control.go:255] [...] login to serer success, get run id [...] ...[W][control.go:345][...] [web] start error: proxy name [web] is already in use 树莓派2号的frpc.ini的配置与树莓派1号一样,只有subdomain不同,我把树莓派2号关机后,就一切正常了 难道不能在所有的客户端的ini文件中都用 `[web]`吗??
Author
Owner

@mymmoonoa commented on GitHub (Jun 16, 2017):

  1. 1号树莓派再连回局域网内网wifi,手动./frpc -c ./frpc03.ini后,是好的,也能ping通。
    所以结论是多个客户端frpc.ini中不能用相同的[web]??
    我要再去读读文档了。。:-(
<!-- gh-comment-id:308914628 --> @mymmoonoa commented on GitHub (Jun 16, 2017): 3. 1号树莓派再连回局域网内网wifi,手动./frpc -c ./frpc03.ini后,是好的,也能ping通。 所以结论是多个客户端frpc.ini中不能用相同的`[web]`?? 我要再去读读文档了。。:-(
Author
Owner

@wxlg1117 commented on GitHub (Jun 16, 2017):

貌似是不能有重复的,你干嘛不加个标识,人家文档都说了[web1]...[web2]...

<!-- gh-comment-id:308949496 --> @wxlg1117 commented on GitHub (Jun 16, 2017): 貌似是不能有重复的,你干嘛不加个标识,人家文档都说了[web1]...[web2]...
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#268
No description provided.