Skip to main content

1E 8.1 (on-premises)

Network.GetIpAddresses

Method

GetIpAddresses

Module

Network

Library

Core

Action

Gets IP addresses assigned to the machine.

Parameters

(None)

Return values

IpAddress (string): The IP address of the adapter

IpVersion (string): IPv4/IPv6

MacAddress (string): Physical address. Not available on Android. This field is empty if there is no hardware MAC address assigned to the adapter, for example on a loopback address.

AdapterName (string): Friendly name of the adapter to which the IP address is assigned. Not available on Android.

AdapterType (string): Type of the adapter. For Windows, 'friendly' strings returned are based off IP_ADAPTER_INFO type defines. Not available on Android. If available, this will describe the adapter hardware type. If it is unknown, it will report "Unknown: x" where x is a number corresponding to the device type returned by the operating system. These enumerations can differ between operating systems, though they are typically based off defines in RFC1573. If just "Unknown" is returned, the operating system has returned the enumeration for "Other/Unknown".

SubnetMask (string): Subnet mask for the IP address. This is only supplied for IPv4 addresses. It is implicit in an IPv6 address. Not available on Android.

DefaultGateway (string): The IP address of the default network gateway. New in v8.0.

Description (string): Description of the network adapter. New in v8.0.

DhcpEnabled (bool): Indicates if DHCP is enabled. New in v8.0.

DhcpLeaseExpiry (string): DHCP lease expiry time. New in v8.0.

DhcpServer (string): The IP address of any configured DHCP server. New in v8.0.

PrimaryDnsServer (string): IP address of primary DNS Server. New in v8.0.

RouteMetric (string): The route metric used to compute the route preferences. Given a routing choice, the route with the lowest metric will be selected. New in v8.0.

SecondaryDnsServers (string): A comma-separated list of IP addresses of any secondary DNS servers. New in v8.0.

HardwareInterface (bool): The Adapter is an actual physical hardware interface or not. New in v8.0.

Example

Network.GetIpAddresses();

Platforms

  • Windows

  • Linux

  • MacOS

  • Solaris Intel

  • Solaris Sparc

  • Android

Notes

On Solaris (Intel, at least - SPARC requires testing), the mac address is part of the ifreq structure, but the pointer appears to be off by 2 bytes. Not sure why this is occurring, but we're currently adjusting, and it seems we're getting the correct mac address.

DefaultGateway, DhcpEnabled, DhcpLeaseExpiry, DhcpServer, PrimaryDnsServer and SecondaryDnsServers are new for v8.0 and are null on every platform but Windows and MacOS.

Description, RouteMetric, HardwareInterface are only available on Windows.