public static List<String> getLocalV4IpList() {

        Enumeration<NetworkInterface> interfaces = null;
        try {
            interfaces = NetworkInterface.getNetworkInterfaces();
        } catch (SocketException ignored) {
            // skip
        }

        if (interfaces == null) {
            return Collections.emptyList();
        }

        List<String> result = new ArrayList<>();
        while (interfaces.hasMoreElements()) {
            NetworkInterface current = interfaces.nextElement();
            if (isSkipIp(current)) {
                continue;
            }

            Enumeration<InetAddress> addresses = current.getInetAddresses();
            while (addresses.hasMoreElements()) {
                InetAddress address = addresses.nextElement();
                if (address.isLoopbackAddress() || !(address instanceof Inet4Address)) {
                    continue;
                }

                if (validationIpV4FormatAddress(address.getHostAddress())) {
                    result.add(address.getHostAddress());
                }
            }
        }

        return result;
    }
Returns a list of ip addresses on this machine that is accessible from a remote source.
If no network interfaces can be found on this machine, returns an empty List.
commons/src/main/java/com/navercorp/pinpoint/common/util/NetUtils.java