[GH-ISSUE #837] frps不设置bind_addr时默认绑定到IPv6 #655

Closed
opened 2026-05-05 12:25:28 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @qakcn on GitHub (Jun 22, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/837

frp版本0.20.0

这似乎是golang的通病了,之前在kcptun和ngrok上都发现过。

当不设置bind_addr时,默认只会绑定到IPv6地址::,不会绑定到IPv4地址0.0.0.0

如果我想同时绑定到IPv4和IPv6,该怎么办?

Originally created by @qakcn on GitHub (Jun 22, 2018). Original GitHub issue: https://github.com/fatedier/frp/issues/837 frp版本0.20.0 这似乎是golang的通病了,之前在kcptun和ngrok上都发现过。 当不设置`bind_addr`时,默认只会绑定到IPv6地址`::`,不会绑定到IPv4地址`0.0.0.0`。 如果我想同时绑定到IPv4和IPv6,该怎么办?
Author
Owner

@qakcn commented on GitHub (Jun 22, 2018):

设置了bind_addr = 0.0.0.0还是绑定到IPv6。

运行环境:

Ubuntu 18.04 x64

设置:

[common]
bind_addr = 0.0.0.0
bind_port = 7000
kcp_bind_port = 7000

log_file = /var/log/frps.log
log_level =info
log_max_days = 5

结果:
运行netstat -nl46得到

Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:23333           0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN
tcp6       0      0 :::23333                :::*                    LISTEN
tcp6       0      0 :::7000                 :::*                    LISTEN
udp     2304      0 127.0.0.53:53           0.0.0.0:*
udp        0      0 0.0.0.0:68              0.0.0.0:*
udp6       0      0 :::7000                 :::*
<!-- gh-comment-id:399356375 --> @qakcn commented on GitHub (Jun 22, 2018): 设置了`bind_addr = 0.0.0.0`还是绑定到IPv6。 运行环境: Ubuntu 18.04 x64 设置: [common] bind_addr = 0.0.0.0 bind_port = 7000 kcp_bind_port = 7000 log_file = /var/log/frps.log log_level =info log_max_days = 5 结果: 运行`netstat -nl46`得到 Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:23333 0.0.0.0:* LISTEN tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN tcp6 0 0 :::23333 :::* LISTEN tcp6 0 0 :::7000 :::* LISTEN udp 2304 0 127.0.0.53:53 0.0.0.0:* udp 0 0 0.0.0.0:68 0.0.0.0:* udp6 0 0 :::7000 :::*
Author
Owner

@fatedier commented on GitHub (Jun 22, 2018):

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 将会直接关闭。)

<!-- gh-comment-id:399370728 --> @fatedier commented on GitHub (Jun 22, 2018): 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 将会直接关闭。)
Author
Owner

@MYZ6 commented on GitHub (Nov 29, 2018):

貌似原因:我换了一台新的阿里云服务器,公网IP变成了所谓的松耦合;这就叫人郁闷了,我有root权限,但是没有相应的阿里云账号

<!-- gh-comment-id:442798526 --> @MYZ6 commented on GitHub (Nov 29, 2018): 貌似原因:我换了一台新的阿里云服务器,公网IP变成了所谓的松耦合;这就叫人郁闷了,我有root权限,但是没有相应的阿里云账号
Author
Owner

@SeanDemo2017 commented on GitHub (Nov 29, 2018):

font{
    line-height: 1.6;
}
ul,ol{
    padding-left: 20px;
    list-style-position: inside;
}




    

    你们为啥不设置?

 

    
                
        
            
                
                        
                            
                        
                        
                            xiao940213
                        
                
                    
                        
                                xiao940213@gmail.com
                        
                    
            
        
    
    


    签名由
    网易邮箱大师
    定制



在2018年11月29日 19:21,z<notifications@github.com> 写道: 

同求解决办法,在centos上正常,在ubuntu下就见鬼了

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.

<!-- gh-comment-id:442799801 --> @SeanDemo2017 commented on GitHub (Nov 29, 2018): font{ line-height: 1.6; } ul,ol{ padding-left: 20px; list-style-position: inside; } 你们为啥不设置? xiao940213 xiao940213@gmail.com 签名由 网易邮箱大师 定制 在2018年11月29日 19:21,z<notifications@github.com> 写道: 同求解决办法,在centos上正常,在ubuntu下就见鬼了 —You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.
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#655
No description provided.