--- UID: NF:netioapi.SetIpNetEntry2 title: SetIpNetEntry2 function (netioapi.h) description: Sets the physical address of an existing neighbor IP address entry on the local computer. helpviewer_keywords: ["SetIpNetEntry2","SetIpNetEntry2 function [IP Helper]","iphlp.setipnetentry2","netioapi/SetIpNetEntry2"] old-location: iphlp\setipnetentry2.htm tech.root: IpHlp ms.assetid: 4f423700-f721-44a9-ade3-ea5b5b86e394 ms.date: 12/05/2018 ms.keywords: SetIpNetEntry2, SetIpNetEntry2 function [IP Helper], iphlp.setipnetentry2, netioapi/SetIpNetEntry2 req.header: netioapi.h req.include-header: Iphlpapi.h req.target-type: Windows req.target-min-winverclnt: Windows Vista [desktop apps only] req.target-min-winversvr: Windows Server 2008 [desktop apps only] req.kmdf-ver: req.umdf-ver: req.ddi-compliance: req.unicode-ansi: req.idl: req.max-support: req.namespace: req.assembly: req.type-library: req.lib: Iphlpapi.lib req.dll: Iphlpapi.dll req.irql: targetos: Windows req.typenames: req.redist: ms.custom: 19H1 f1_keywords: - SetIpNetEntry2 - netioapi/SetIpNetEntry2 dev_langs: - c++ topic_type: - APIRef - kbSyntax api_type: - DllExport api_location: - Iphlpapi.dll api_name: - SetIpNetEntry2 --- # SetIpNetEntry2 function ## -description The SetIpNetEntry2 function sets the physical address of an existing neighbor IP address entry on the local computer. ## -parameters ### -param Row [in, out] A pointer to a MIB_IPNET_ROW2 structure entry for a neighbor IP address entry. ## -returns If the function succeeds, the return value is NO_ERROR. If the function fails, the return value is one of the following error codes.
Return code | Description |
---|---|
|
Access is denied. This error is returned under several conditions that include the following: the user lacks the required administrative privileges on the local computer or the application is not running in an enhanced shell as the built-in Administrator (RunAs administrator). |
|
An invalid parameter was passed to the function. This error is returned if a NULL pointer is passed in the Row parameter, the Address member of the MIB_IPNET_ROW2 pointed to by the Row parameter was not set to a valid unicast, anycast, or multicast IPv4 or IPv6 address, the PhysicalAddress and PhysicalAddressLength members of the MIB_IPNET_ROW2 pointed to by the Row parameter were not set to a valid physical address, or both the InterfaceLuid or InterfaceIndex members of the MIB_IPNET_ROW2 pointed to by the Row parameter were unspecified. This error is also returned if a loopback address was passed in the Address member. |
|
The specified interface could not be found. This error is returned if the network interface specified by the InterfaceLuid or InterfaceIndex member of the MIB_IPNET_ROW2 pointed to by the Row parameter could not be found. |
|
The request is not supported. This error is returned if no IPv4 stack is on the local computer and an IPv4 address was specified in the Address member of the MIB_IPNET_ROW2 pointed to by the Row parameter or no IPv6 stack is on the local computer and an IPv6 address was specified in the Address member. |
|
Use FormatMessage to obtain the message string for the returned error. |