apollo-core/src/main/java/com/ctrip/framework/foundation/internals/NetworkInterfaceManager.java/NetworkInterfaceManager/load
class NetworkInterfaceManager:  private void load() {
    String ip = getProperty("host.ip");

    if (ip != null) {
      try {
        m_local = InetAddress.getByName(ip);
        return;
      } catch (Exception e) {
        System.err.println(e);
        // ignore
      }
    }

    try {
      Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
      List<NetworkInterface> nis = interfaces == null ? Collections.<NetworkInterface>emptyList()
          : Collections.list(interfaces);
      //sort the network interfaces according to the index asc
      Collections.sort(nis, new Comparator<NetworkInterface>() {
        @Override
        public int compare(NetworkInterface nis1, NetworkInterface nis2) {
          return Integer.compare(nis1.getIndex(), nis2.getIndex());
        }
      });
      List<InetAddress> addresses = new ArrayList<>();
      InetAddress local = null;

      try {
        for (NetworkInterface ni : nis) {
          if (ni.isUp() && !ni.isLoopback()) {
            addresses.addAll(Collections.list(ni.getInetAddresses()));
          }
        }
        local = findValidateIp(addresses);
      } catch (Exception e) {
        // ignore
      }
      if (local != null) {
        m_local = local;
        return;
      }
    } catch (SocketException e) {
      // ignore it
    }

    m_local = InetAddress.getLoopbackAddress();
  }