frp icon indicating copy to clipboard operation
frp copied to clipboard

Not binding to IPv4 Interface

Open rcarlet opened this issue 1 year ago • 2 comments

Bug Description

Hello,

I currently have the following frps.toml

bindPort = 7000
bindAddr = "0.0.0.0"

But after running the server (./frps -c ./frps.toml) it binds to the IPv6 interface:

$ netstat  -tnlp
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::7000                 :::*                    LISTEN      6155/./frps         
tcp6       0      0 :::111                  :::*                    LISTEN      -                   
tcp6       0      0 :::22                   :::*                    LISTEN      -      

When trying directly from the command line (./frps -p 7000), it binds only via IPv6. I found no way to force only IPv4, besides the binding Address, which is not followed.

frpc Version

0.60.0

frps Version

0.60.0

System Architecture

linux/amd64

Configurations

frps.toml bindPort = 7000 bindAddr = "0.0.0.0"

Logs

2024-09-26 18:47:05.043 [I] [frps/root.go:107] frps uses command line arguments for config 2024-09-26 18:47:05.949 [I] [server/service.go:237] frps tcp listen on 0.0.0.0:7000 2024-09-26 18:47:05.950 [I] [frps/root.go:114] frps started successfully

Steps to reproduce

  1. Create the frps.toml config file with the configuration mentioned
  2. Run the server using ./frps -c ./frps.toml
  3. Check the listening connections using netstat -tnlp

Affected area

  • [ ] Docs
  • [ ] Installation
  • [ ] Performance and Scalability
  • [ ] Security
  • [ ] User Experience
  • [ ] Test and Release
  • [ ] Developer Infrastructure
  • [ ] Client Plugin
  • [X] Server Plugin
  • [ ] Extensions
  • [ ] Others

rcarlet avatar Sep 26 '24 18:09 rcarlet

Displayed as::: 7000, can be connected using IPv4 and IPv6。 To force only IPv4, requires setting bindAddr to the actual IPv4 address or domain, not 0.0.0.0

superzjg avatar Sep 27 '24 00:09 superzjg

frp 监听 :: 时,没有附加 V6ONLY 套接字选项。所以 :: 监听,可以接受 IPv4 连接

xqzr avatar Sep 30 '24 16:09 xqzr

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

github-actions[bot] avatar Oct 22 '24 00:10 github-actions[bot]