SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
18.55k stars 2.22k forks source link

tun接口IP地址/30使用后一位可用IP 异常 #2005

Closed luweijun1992 closed 1 month ago

luweijun1992 commented 1 month ago

操作系统

Linux

系统版本

Debian 12.6

安装类型

sing-box 原始命令行程序

如果您使用图形客户端程序,请提供该程序版本。

No response

版本

sing-box version 1.10.0-alpha.28

Environment: go1.22.5 linux/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api
Revision: 3c21bd7f6bfdff0f01a523ab6a5d6734e339e6af
CGO: disabled

描述

tun接口IP地址使用/30掩码,且使用后一个可用IP地址 比如使用172.31.255.254/30 无法正常使用,无报错 使用172.31.255.253/30 正常使用

重现方式

{ "inbounds": [ { "address": "172.31.255.254/30", "auto_route": true, "gso": true, "interface_name": "tun0", "route_address": [ "198.18.0.0/16" ], "sniff": true, "sniff_override_destination": false, "stack": "system", "strict_route": true, "tag": "tunIn", "type": "tun" } ] }

日志

`journalctl -xf -u sing-box.service  | grep tun`

无日志打印

支持我们

完整性要求

dyhkwong commented 1 month ago

广播地址用不了很正常?

luweijun1992 commented 1 month ago

广播地址用不了很正常?

30掩码 是有2个可用IP 比如 172.31.255.252/30;网络号:172.31.255.252;可用IP:172.31.255.253~172.31.255.254;广播地址:172.31.255.255

你也用172.19.0.2/30也是不能用,但是用172.19.0.1/30就可以

dyhkwong commented 1 month ago

Inet4Address 前缀的第一个地址作 tun 网卡 ipv4 地址,第二个地址作 tun ipv4 dns,并不是用该 cidr 的首个和第二个地址的

于 2024年8月6日 GMT+08:00 17:46:20,luweijun1992 @.***> 写道:

广播地址用不了很正常?

/30 是有2个可用IP 比如 172.31.255.252/30;网络号:172.31.255.252;可用IP:172.31.255.253~172.31.255.254;广播地址:172.31.255.255

你也用172.19.0.2/30 也是不能用,但是用172.19.0.1/30就可以

-- Reply to this email directly or view it on GitHub: https://github.com/SagerNet/sing-box/issues/2005#issuecomment-2270856553 You are receiving this because you commented.

Message ID: @.***>

luweijun1992 commented 1 month ago

Inet4Address 前缀的第一个地址作 tun 网卡 ipv4 地址,第二个地址作 tun ipv4 dns,并不是用该 cidr 的首个和第二个地址的 于 2024年8月6日 GMT+08:00 17:46:20,luweijun1992 @.***> 写道:

广播地址用不了很正常? /30 是有2个可用IP 比如 172.31.255.252/30;网络号:172.31.255.252;可用IP:172.31.255.253~172.31.255.254;广播地址:172.31.255.255 --- 你也用172.19.0.2/30 也是不能用,但是用172.19.0.1/30就可以 -- Reply to this email directly or view it on GitHub: #2005 (comment) You are receiving this because you commented. Message ID: @.***>

所以tun接口的IP地址比如用的/30 ,配置只能使用第一个IP,第二个IP默认会特别用途? 导致我故意设置/30 第二个可用IP的时候,sing-box异常了?