fatedier / frp

A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.
Apache License 2.0
83.92k stars 13.09k forks source link

dial tcp IP:PORT: i/o timeout #2905

Closed azbub closed 2 years ago

azbub commented 2 years ago

Bug Description

Set-up the server side of the proxy with this command ./frps -c ./frps.ini and this frps.ini config :

[common]
bind_port = 7000

I get this ouput :

2022/04/20 17:08:48 [I] [root.go:200] frps uses config file: ./frps.ini
2022/04/20 17:08:48 [I] [service.go:194] frps tcp listen on 0.0.0.0:7000
2022/04/20 17:08:48 [I] [root.go:209] frps started successfully

I run the local server with this command ./frpc -c ./frpc.ini and this frpc.ini config :

[common]
server_addr = SERVER_IP
server_port = 7000

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

I get this output :

dial tcp SERVER_IP:7000: i/o timeout

I have added bind_addr to bin to 127.0.01 / server public IP / server private IP without success. I made sure the instance ports are all open and ufw has been disabled.

frpc Version

0.41.0

frps Version

0.41.0

System Architecture

linux/amd64 && mac/arm64

Configurations

Local :

[common]
server_addr = SERVER_IP
server_port = 7000

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

server :

[common]
bind_port = 7000

Logs

server :

2022/04/20 17:08:48 [I] [root.go:200] frps uses config file: ./frps.ini
2022/04/20 17:08:48 [I] [service.go:194] frps tcp listen on 0.0.0.0:7000
2022/04/20 17:08:48 [I] [root.go:209] frps started successfully

local :

dial tcp SERVER_IP:7000: i/o timeout

Steps to reproduce

  1. default server set-up and run the command
  2. edit local server to point to server ip
  3. run the local server ...

Affected area

Becods commented 2 years ago

Check if the server port is successfully opened

Use tcping or other tools

azbub commented 2 years ago

Check if the server port is successfully opened

Use tcping or other tools

The port is closed, that's the issue. I made sure the instance security group allows inbound and outbound traffic on the 7000 TCP port.

github-actions[bot] commented 2 years ago

Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

wlf-darkmatter commented 2 years ago

我也遇到这个情况,就是 [W] [service.go:128] login to server failed: dial tcp [$IP]:7000: i/o timeout

一般是服务器的防火墙设置问题,我使用的是腾讯的轻量级服务器,通过指令可以成功开启

查看防火墙打开情况 firewall-cmd --zone=public --list-ports

添加防火墙开启端口 TCP协议 7000-7009端口 firewall-cmd --zone=public --add-port=7000-7009/tcp --permanent

更新防火墙配置 firewall-cmd --reload

github-actions[bot] commented 2 years ago

Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

liam-pat commented 1 year ago
  1. Login tecent server.
  2. Edit the firewall rule.
  3. Allow port 7000 and port 6000.
wshidaijingshen commented 1 year ago

我是客户端的 公网ip 地址写错了,好好检查下 I solved this by correcting the server_addr in frpc.ini . Then problems gone.

The firewall (or security group) on cloud servers may cause this problem.check them wisely . 还有一种,是防火墙不通,telnet 一下服务器 看看 。 云服务器有 安全组策略,或者 防火墙策略,默认是很严格的,要放开一下。