Class InetUtils

java.lang.Object
com.alibaba.nacos.sys.utils.InetUtils

public class InetUtils extends Object
Network card operation tool class.
Author:
Nacos
  • Constructor Details

    • InetUtils

      public InetUtils()
  • Method Details

    • getNacosIp

      public static String getNacosIp()
      Get ip address from environment System property nacos.server.ip Spring property nacos.inetutils.ip-address.
      Returns:
      ip address
    • getSelfIP

      public static String getSelfIP()
    • findFirstNonLoopbackAddress

      public static InetAddress findFirstNonLoopbackAddress()
      findFirstNonLoopbackAddress.
      Returns:
      InetAddress
    • isUp

      public static boolean isUp(NetworkInterface ifc)
      check network intreface isUp, not throw SocketException.
      Parameters:
      ifc - network interface
      Returns:
      true or false;
    • getGrpcListenIp

      public static String getGrpcListenIp()