[GH-ISSUE #905] 腾讯云无法作为frps的问题 #716

Closed
opened 2026-05-05 12:27:33 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @chendeshen on GitHub (Aug 28, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/905

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.
(为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。)

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.21.0

What operating system and processor architecture are you using (go env)?
both server (frps) and client (frpc) are CentOS 7.5.1804, x64

Configures you used:
#frps.ini
[common]
bind_addr = 0.0.0.0
bind_port = 7000

#frpc.ini
[common]
server_addr = [此处为我的腾讯云公网IP]
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000

Steps to reproduce the issue:

  1. already disable all iptables and firewalld serives to allow any port traffic
  2. server side: nohup ./frps -c ./frps.ini &
  3. client side: nohup ./frpc -c ./frpc.ini &
  4. open new terminal: ssh -oPort=6000 root@[此处为我的腾讯云公网IP]
  5. server side log no output, cient side log shows: 2018/08/28 15:01:05 [W] [control.go:113] login to server failed: dial tcp [此处为我的腾讯云公网IP]:7000: connect: connection timed out

Describe the results you received:
本来期望成功利用frp达到内网ssh转发。

Describe the results you expected:
相同设置下Vultr服务器成功。

Additional information you deem important (e.g. issue happens only occasionally):
腾讯云的CentOS输入ip addr是无法看到外网IP(外网网卡),因为有一层NAT。

Can you point out what caused this issue (optional)
腾讯云服务器外网IP与内网IP之间是通过一对一的NAT实现的,内网Ip配置在网卡上,外网Ip配置在网关上。如有需要绑定IP的场景,直接绑定内网IP即可,可以转发到外网IP上。
关于外网ip配置的问题,腾讯云的外网ip没有直接配置服务器上,就像是您看到的,服务器只有一张网卡,且绑定的是内网ip。 服务器的外网ip是绑定在外层TGW网关,内网ip和外网ip之间可以理解为一对一的NAT映射,不会对您的服务产生任何影响。
参考链接:
http://bbs.qcloud.com/thread-2133-1-1.html
http://bbs.qcloud.com/thread-3412-1-1.html

Originally created by @chendeshen on GitHub (Aug 28, 2018). Original GitHub issue: https://github.com/fatedier/frp/issues/905 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. (为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。) 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.21.0 **What operating system and processor architecture are you using (`go env`)?** both server (frps) and client (frpc) are CentOS 7.5.1804, x64 **Configures you used:** #frps.ini [common] bind_addr = 0.0.0.0 bind_port = 7000 #frpc.ini [common] server_addr = [此处为我的腾讯云公网IP] server_port = 7000 [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 6000 **Steps to reproduce the issue:** 1. already disable all iptables and firewalld serives to allow any port traffic 1. server side: nohup ./frps -c ./frps.ini & 2. client side: nohup ./frpc -c ./frpc.ini & 3. open new terminal: ssh -oPort=6000 root@[此处为我的腾讯云公网IP] 4. server side log no output, cient side log shows: 2018/08/28 15:01:05 [W] [control.go:113] login to server failed: dial tcp [此处为我的腾讯云公网IP]:7000: connect: connection timed out **Describe the results you received:** 本来期望成功利用frp达到内网ssh转发。 **Describe the results you expected:** 相同设置下Vultr服务器成功。 **Additional information you deem important (e.g. issue happens only occasionally):** 腾讯云的CentOS输入ip addr是无法看到外网IP(外网网卡),因为有一层NAT。 **Can you point out what caused this issue (optional)** 腾讯云服务器外网IP与内网IP之间是通过一对一的NAT实现的,内网Ip配置在网卡上,外网Ip配置在网关上。如有需要绑定IP的场景,直接绑定内网IP即可,可以转发到外网IP上。 关于外网ip配置的问题,腾讯云的外网ip没有直接配置服务器上,就像是您看到的,服务器只有一张网卡,且绑定的是内网ip。 服务器的外网ip是绑定在外层TGW网关,内网ip和外网ip之间可以理解为一对一的NAT映射,不会对您的服务产生任何影响。 参考链接: http://bbs.qcloud.com/thread-2133-1-1.html http://bbs.qcloud.com/thread-3412-1-1.html
Author
Owner

@cloverzrg commented on GitHub (Aug 31, 2018):

看自己外网ip用 curl ip.cn就行了,腾讯云、阿里云的弹性ip实例都这样,ifconfig看不到公网ip的,不会影响frp的使用,我的腾讯云frps已经正常运行半年了

<!-- gh-comment-id:417530312 --> @cloverzrg commented on GitHub (Aug 31, 2018): 看自己外网ip用 `curl ip.cn`就行了,腾讯云、阿里云的弹性ip实例都这样,ifconfig看不到公网ip的,不会影响frp的使用,我的腾讯云frps已经正常运行半年了
Author
Owner

@chendeshen commented on GitHub (Aug 31, 2018):

@cloverzrg 我知道公网IP,但是frp就是不成功。可否分享frps.ini文件?
或者[common]部分的bind_addr是写0.0.0.0还是内网IP还是公网IP还是不写?
先感谢~

<!-- gh-comment-id:417686379 --> @chendeshen commented on GitHub (Aug 31, 2018): @cloverzrg 我知道公网IP,但是frp就是不成功。可否分享frps.ini文件? 或者[common]部分的bind_addr是写0.0.0.0还是内网IP还是公网IP还是不写? 先感谢~
Author
Owner

@yi-ge commented on GitHub (Aug 31, 2018):

跟服务器是哪里的无关。

<!-- gh-comment-id:417691040 --> @yi-ge commented on GitHub (Aug 31, 2018): 跟服务器是哪里的无关。
Author
Owner

@cloverzrg commented on GitHub (Sep 1, 2018):

@chendeshen

[common]
bind_port = 7721
token = 123456
vhost_http_port = 8080

[common]
dashboard_port = 7521
dashboard_user = admin
dashboard_pwd = xxxxxx
<!-- gh-comment-id:417855928 --> @cloverzrg commented on GitHub (Sep 1, 2018): @chendeshen ``` [common] bind_port = 7721 token = 123456 vhost_http_port = 8080 [common] dashboard_port = 7521 dashboard_user = admin dashboard_pwd = xxxxxx ```
Author
Owner

@flf2015 commented on GitHub (Sep 10, 2018):

我昨天也折腾了几个小时,几乎放弃了,后来才发现,原来是安全组的问题,安全组设置全部放行即可。

<!-- gh-comment-id:419773481 --> @flf2015 commented on GitHub (Sep 10, 2018): 我昨天也折腾了几个小时,几乎放弃了,后来才发现,原来是安全组的问题,安全组设置全部放行即可。
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#716
No description provided.