Hi,
we are currently trying to use multiple IPs on the same Interface.
After reading multiple threads in this forum we are now aware that NDK does not support multiple IPs on a single interface (unless using different subnets) as of today.
We are using the ethernetip_adapter example from the sdk package (version 1.1.0.5). In this example the part of the cfg-script for NDK is bypassed with the line
"Global.stackThreadUser = "&NDKACD_stackThread";"
Even after multiple attempts (using different interfaces, subnets, add CFG_ADDMODE_DUPLICATE as mode attribute etc.) it was not possible to get 2 different IPs running. Only the first IP is working.
This is the current attempt to get 2 IPs running:
CfgAddEntry(hCfg, CFGTAG_SYSINFO, CFGITEM_DHCP_HOSTNAME, 0,
strlen(ti_ndk_config_Global_HostName),
(UINT8 *)ti_ndk_config_Global_HostName, 0);
/* Configure IP address manually on interface 1 */
bzero(&NA, sizeof(NA));
NA.IPAddr = htonl(eipDevInitConfig.tcpipConfig.deviceIP);
NA.IPMask = htonl(eipDevInitConfig.tcpipConfig.networkMask);
strcpy(NA.Domain, DomainName);
NA.NetType = 0;
CfgAddEntry(hCfg, CFGTAG_IPNET, 1, CFG_ADDMODE_DUPLICATE,
sizeof(CI_IPNET), (UINT8 *)&NA, 0);
bzero(&RT, sizeof(RT));
RT.IPDestAddr = 0;
RT.IPDestMask = 0;
RT.IPGateAddr = htonl(0xC0A80201);
CfgAddEntry(hCfg, CFGTAG_ROUTE, 0, CFG_ADDMODE_DUPLICATE,
sizeof(CI_ROUTE), (UINT8 *)&RT, 0);
/* Configure IP address manually on interface 2 */
NA.IPAddr = htonl(0xC0A8218A);
u = CfgAddEntry(hCfg, CFGTAG_IPNET, 2, CFG_ADDMODE_DUPLICATE,
sizeof(CI_IPNET), (UINT8 *)&NA, 0);
RT.IPGateAddr = htonl(0xC0A80101);
a = CfgAddEntry(hCfg, CFGTAG_ROUTE, 0, CFG_ADDMODE_DUPLICATE,
sizeof(CI_ROUTE), (UINT8 *)&RT, 0);
a and u are integers to fetch the errors returned from the last two CfgAddEntry functions.
Both return -101.
Not many more changes were made (except for adding a HTTP server). So, it's basically the same as the source file "eip_ndk.c" from the ethernetip_adapter example.
So it would be nice to get it running with any constellation and if there are any updates on multiple IPs on the same interface (IP aliasing).
Thanks in advance for any help provided.
Regards,
Timo