Package com.netflix.discovery.util
Class SystemUtil
- java.lang.Object
-
- com.netflix.discovery.util.SystemUtil
-
public final class SystemUtil extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetServerIPv4()Returns server IP address (v4 or v6) bound to local NIC.static voidmain(java.lang.String[] args)
-
-
-
Method Detail
-
getServerIPv4
public static java.lang.String getServerIPv4()
Returns server IP address (v4 or v6) bound to local NIC. If multiple NICs are present, choose 'eth0' or 'en0' or any one with name ending with 0. If non found, take first on the list that is not localhost. If no NIC present (relevant only for desktop deployments), return loopback address.
-
main
public static void main(java.lang.String[] args)
-
-