Not binding to IPv4 Interface
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
- Create the frps.toml config file with the configuration mentioned
- Run the server using ./frps -c ./frps.toml
- 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
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
frp 监听 :: 时,没有附加 V6ONLY 套接字选项。所以 :: 监听,可以接受 IPv4 连接
Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.