mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #452] frps能否强制只监听ipv4端口 #345
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#345
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 @iceking2001 on GitHub (Sep 4, 2017).
Original GitHub issue: https://github.com/fatedier/frp/issues/452
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)?
./frps
What operating system and processor architecture are you using (
go env)?centos 7.3 x64
Configures you used:
frps_full.ini 默认配置
Steps to reproduce the issue:
tcp6 0 0 :::7500 :::* LISTEN 2311/./frps
tcp6 0 0 :::8080 :::* LISTEN 2311/./frps
tcp6 0 0 :::7000 :::* LISTEN 2311/./frps
tcp6 0 0 :::443 :::* LISTEN 2311/./frps
udp6 0 0 :::7000 :::* 2311/./frps
Describe the results you received:
无法访问dashboard
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)
@fatedier commented on GitHub (Sep 4, 2017):
首先你要确定是否是由于这个原因造成的,还是说是因为其他原因。你要提供推理和分析的结果。
@qingyuan0o0 commented on GitHub (Nov 29, 2017):
我也碰到类似的问题,在ubuntu本地是有ipv6的网络,但是在客户端连接后,在Ubuntu中使用


netstat -an|grep : 发现显示的都是tcp6 udp6,呈现出客户端的连接
frps.ini的设置
[common]
local_ip = 0.0.0.0
bind_port = 7000
客户端配置大致是下图
但是显示
@qingyuan0o0 commented on GitHub (Nov 29, 2017):
额,虽然显示是这样,但是后续测试中发现,居然可以正常访问。。。ipv4的
@xiahuaijia commented on GitHub (Jun 21, 2018):
遇到同样问题 ,阿里云主机突然监听ipv6 无法访问
@LiuGaoyong commented on GitHub (Jul 22, 2019):
所以,这个问题怎么解决??
@hao222 commented on GitHub (Aug 27, 2020):
腾讯云监听了ipv6,但是我设置放在同一个安全组下的,其他大部分是ipv4 只有mysql是ipv6, 然后本地客户端访问不了,connected refused
@RenJunFeng commented on GitHub (Oct 12, 2020):
如何解决?我本地运行也是这样,设置了
[common]
bind_addr = 0.0.0.0 也是不行
@marcuswang6 commented on GitHub (Apr 5, 2022):
同无法解决 2022
@zhjou commented on GitHub (May 1, 2022):
ubuntu 20.04 LTS, bind_addr = 0.0.0.0 还是不行
@gldsly commented on GitHub (Nov 29, 2022):
腾讯云服务器也发现这个问题了。不知道为啥在云服务器上访问 127 + frps 监听的端口 全是无数据,然后就 502 错误了
客户端是正常的,配置测试信息如下
@netfun2000 commented on GitHub (Apr 5, 2023):
今天用阿里云安装frps,同样出现了这个问题。frps显示ipv6
本机可以访问frps端口,外网无法访问。
@VCE1 commented on GitHub (Jul 19, 2023):
我在Ubuntu 20上也遇到了这个问题,尽管我已经在/etc/sysctl.conf中设置了以下内容:
并且在frps.ini中填写了bind_addr = 0.0.0.0,但是frps仍然监听IPv6地址,
不知道具体的原因,但是能正常访问。
@shuguang101 commented on GitHub (May 7, 2024):
刚刚也遇到了这个问题,调查了一下,是golang的问题。 golang 0.0.0.0 确实会监听ipv6, 这与nginx,apache等软件的行为并不相同。从直观上来说当用户指定一个ipv4地址时不应该去监听ipv6, 但golang无论是使用0.0.0.0或[::] 都会同时监听ipv4和ipv6, 并且为了backwards compatibility不会对这个行为进行修改。。。。。
https://github.com/golang/go/issues/48723
https://github.com/golang/go/issues/17615
@xingon commented on GitHub (Jun 30, 2024):
同样的问题啊,Fasttunnel也是这样的,其实就是配置0.0.0.0的时候他默认使用的TCP,应该显式使用TCP4才行,
@zasray commented on GitHub (Oct 29, 2024):
腾讯云 2024-10-29,还是这样子!无法解决
@tomjerrygood commented on GitHub (Feb 18, 2025):
me too。远端fprs服务端在ipv4环境。我在的客户端frpc.ini 配置了
server_addr = Ipv4域名(a.b.c)
bind_address = 0.0.0.0,
本地frpc 运行优先解析ipv6,所以总是不能连接到服务器。
执行
/system/etc/frpc$ /system/etc/frpc/frpc -c /system/etc/frpc/frpc.ini
显示错误
2025/02/18 05:35:48 [1;33m[W] [service.go:128] login to server failed: dial tcp: lookup a.b.c on [::1]:53: read udp [::1]:42425->[::1]:53: read: connection refused[0m
dial tcp: lookup green86.asuscomm.com on [::1]:53: read udp [::1]:42425->[::1]:53: read: connection refused
服务器域名改为固定ipv4 地址就能连接成功。但是域名是动态的,不能固定IP地址。
希望大佬能否给出强制IPv4的选项