This commit is contained in:
2025-11-29 23:46:17 +08:00
parent 51ffefbe2f
commit c881640667
2 changed files with 2 additions and 3 deletions

View File

@@ -33,8 +33,7 @@ public class IpUtils {
// 仅保留IPv4地址且排除回环地址
if (addr instanceof Inet4Address && !addr.isLoopbackAddress()) {
String ip = addr.getHostAddress();
// 过滤掉docker等虚拟网卡的IP可选根据实际场景调整
if (!ip.startsWith("172.") && !ip.startsWith("192.168.99.")) {
if (!ip.startsWith("172.") && !ip.startsWith("192.168.31.")) {
return ip;
}
}