mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #689] [control.go:109] login to server failed: dial tcp XX.XX.XX.XX #538
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#538
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bruce916 on GitHub (Apr 4, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/689
frpc 客户端始终无法链接frps 服务器端,客户端报错。。[control.go:109] login to server failed: dial tcp XX.XX.XX.XX 。。。 connection failed because connected host has failed to respond
配置:阿里云服务器ubuntu/debian
frpc 配置内容:
[common]
server_addr = XX.XX.XX.XX
server_port = 7000
auth_token = 123
privilege_token = 12345678
[ssh]
privilege_mode = true
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
frps配置内容:
[common]
bind_port = 7000
vhost_http_port = 80
vhost_https_port = 443
dashboard_port = 7500
privilege_mode = true
privilege_token = 12345678
privilege_allow_ports = 2000-3000,4000-50000
log_level= info
[ssh]
type = tcp
auth_token = 123
bind_addr = 0.0.0.0
listen_port = 6000
端口检查如下:
root@bruce:~# netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 780/sshd
tcp6 0 0 :::443 :::* LISTEN 17442/frps
tcp6 0 0 :::7500 :::* LISTEN 17442/frps
tcp6 0 0 :::80 :::* LISTEN 17442/frps
tcp6 0 0 :::7000 :::* LISTEN 17442/frps
udp 0 0 172.31.62.13:123 0.0.0.0:* 710/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 710/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:* 710/ntpd
udp6 0 0 :::123 :::* 710/ntpd
端口对应防火墙均已打开:
root@bruce:~# ip6tables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all anywhere anywhere
ACCEPT tcp anywhere anywhere tcp dpt:ssh
ACCEPT tcp anywhere anywhere tcp dpt:https
ACCEPT tcp anywhere anywhere tcp dpt:http
ACCEPT all anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
但还是一直链接不上frps,怎么解决呢?
@wxlg1117 commented on GitHub (Apr 4, 2018):
阿里云web管理页面有安全组设置,有可能默认block掉所有非22的流量了吧
你试试本地tcp ping你指定的端口试试通不通
@poppingcode commented on GitHub (Apr 5, 2018):
ssh -oPort=6000 test@x.x.x.x
我想问问这个 test是哪里设置的用户名,以及这个x.x.x.x是什么东西?
@nnfewl commented on GitHub (Apr 6, 2018):
test是你的公网VPS上的用户,后边那个是VPS的IP地址2333
@poppingcode commented on GitHub (Apr 6, 2018):
不对啊,我是从公网连接到内网,怎么是VPS上的用户呢?
@nnfewl commented on GitHub (Apr 6, 2018):
2333,我脑抽了,test应该是你内网机器的帐号,sorry
@fatedier commented on GitHub (Apr 9, 2018):
连接不上请仔细仔细再仔细地排查下自己的网络环境。
@nyhpro commented on GitHub (Apr 12, 2018):
这个TCP 应该是VPS上的防火墙没有打开吧
@ghwyf commented on GitHub (Sep 4, 2018):
This is because you haven't open port on the server side.
You should close firewall OR add
bind_portandvhost_http_portinto /etc/sysconfig/iptables.这个问题是由于服务端的端口被防火墙拦截导致的,你可以关闭防火墙或者在防火墙中允许
bind_port和vhost_http_port的端口。linux:
vi /etc/sysconfig/iptables开放端口
-A INPUT -p tcp -m state --state NEW -m tcp --dport bind_port -j ACCEPT-A INPUT -p tcp -m state --state NEW -m tcp --dport vhost_http_port -j ACCEPT注意,这两行必须加在以下代码之上,否则规则会被拦截。
-A INPUT -j REJECT --reject-with icmp-host-prohibited重启防火墙
service iptables restart, 可能会对shadowsock产生影响。或者先关闭防火墙测试连接是否可行
service iptables stop@mlmk6698 commented on GitHub (Dec 17, 2023):
我发现了,校园网穿不出去