public static Tuple2<Boolean, String> getValidIPV4Address(
            NetworkInterface networkInterface, String checkIp) {
        try {
            if (networkInterface == null
                    || !networkInterface.isUp()
                    || networkInterface.isLoopback()
                    || "docker0".equals(networkInterface.getName())) {
                return new Tuple2<>(false, null);
            }
            String fstV4IP = null;
            Enumeration<InetAddress> addrs = networkInterface.getInetAddresses();
            while (addrs.hasMoreElements()) {
                InetAddress address = addrs.nextElement();
                if (address == null
                        || address.isLoopbackAddress()
                        || address instanceof Inet6Address) {
                    continue;
                }
                String localIP = address.getHostAddress();
                if (TStringUtils.isEmpty(localIP)
                        || localIP.startsWith("127.0")) {
                    continue;
                }
                if (!TStringUtils.isEmpty(checkIp)) {
                    if (TStringUtils.isEmpty(fstV4IP)) {
                        fstV4IP = localIP;
                    }
                    if (localIP.equals(checkIp)) {
                        return new Tuple2<>(true, localIP);
                    }
                    continue;
                }
                return new Tuple2<>(true, localIP);
            }
            return new Tuple2<>(false, fstV4IP);
        } catch (Throwable e) {
            throw new AddressException(new StringBuilder(256)
                    .append("Illegal parameter: ")
                    .append("unable to obtain valid IP from network card ")
                    .append(networkInterface).toString(), e);
        }
    }
get valid IPV4 address from networkInterface.

@param networkInterface need check networkInterface
@param checkIp The IP address to be searched,
               if not specified, set to null
@return Search result, field 0 indicates whether it is successful,
                       field 1 carries the matched IP value;
                       if the checkIp is specified but not found the IP,
                       field 1 will return the first IPV4 address
@throws AddressException throw exception if found no ipv4 address
inlong-tubemq/tubemq-core/src/main/java/org/apache/inlong/tubemq/corebase/utils/AddressUtils.java