NetX Duo Multiple IP Addresses

This post is an extension of a previous post I made for the same topic which hasn't received any feedback or updates in about a week:  

I have spent countless hours over the last week attempting to get a device to respond to multiple IP addresses using one Ethernet port with no luck.  I have tried on my custom board, and S7G2-SK and and S7G2-DK.  Is there any known way to get one Ethernet port to respond to multiple IP address and/or is what I trying to do even possible?

I have tried countless different configurations and setting without success.  

  1. I have created a second, identical except the name, instance of the ethernet driver using the configurator but fails during build since it assigns many of the same variable names. 
  2. I have tried using the EPTPC relay mode to relay packets between port0 and port1 but doesn't seem to work how I would expect based on what I read in the user manual.
  3. I've create an ethernet driver manually configured similar to the working port, but changed the variable names.  When I attempt to attach the second interface the primary stops working.  

For all different scenarios I have tried using IP addresses on the same subnet, different subnets, the same MAC, different MAC and any other configuration I can think of.  

Is it possible for one Ethernet port to respond to multiple IP addresses?  If so, could you provide an example?

Thanks for your time!

  • I have never tried to do this, but I suspect the low level Ethernet driver does not support it.
  • Do you want multiple IP4 addresses assigned on the same physical interface e.g. 192.1..168.2, , or on separate physical (network) interfaces e.g. 192.1..168.2, ? You mentioned creating a second driver instance but you didn't say anything about nx_ip_interface_attach or setting the Max Physical Interfaces to greater than the default value of 1.

    I will check with our development team but I don't think NetX Duo supports multiple IPv4 addresses on the same network interface. NetX Duo does support multiple IPv6 global addresses on the same interface.

  • My old post covers the details a little more. I am trying to assign multiple IP addresses to the same network interface. for instance the IP addresses may be assigned and both assigned to Ethernet port 1. It's a little unusual but I found that it is supported by Windows and Linux.

    The old post describes different things I have tried including using the nx_ip_interface_attach and increasing the Max Physical Interfaces.

    I would really appreciate it if you could reach out to the development team to see if what I am trying to accomplish is even possible.

  • Hi Kurt

    The dev team is based on Shanghai to whom I already sent off a request. I should get an answer back this evening. IP has support for a 'forwarding' feature which I think is what they will suggest to accomplish what you are trying to do. If so, I'll see if I can find an example of that because it involves NAT ( available in Synergy).

    So hopefully we'll find a workaround.

  • Hi Kurt,

    I discussed this with our dev team. You need to provide two driver entries to handle interface attachment OR handle multiple driver events in one driver entry. They are not familiar with the Synergy environment, and I suspect with all the internal processing in Synergy that *one* driver would be the easier way to go. But you will have to exclude it from the build and modify it. No need to attach any interfaces.

    Sending packets out should not require any modifications (I think). For the incoming packet, the driver passes it to IP layer. If IP forward feature is enabled (nx_ip_forwarding_enable) , then it will be dispatched to the NetX Duo packet receive handler.

    The ARP table should be ok in spite of one mac address shared between two IP addresses. For outgoing packets, NetX Duo can pick up the ARP entry which matches the destination IP, but not source IP. There could be only one entry for each IP address. The other devices on the network will see different IP addresses with same MAC address. But it does not matter. It is very common to have one physical interface with multiple IP addresses. Other devices only care about what MAC address is for specific IP address.

    I should have time to try to get this to work later today. Someone else is bound to ask about it down the road so it would be good to know how to do it. If you are able to get it to work, I'd be very interested to know how you did so.

  • Thanks for the update.
    I will dig around a little bit, but I am not sure how I would go about handling multiple driver events in one driver entry. I have been attaching interfaces so I could set two unique IP addresses.
    Through all of my testing I never enabled forwarding so I can try enabling it and running some tests to see if I make any progress

    Thanks again
  • Hi Kurt

    Sorry to be so long in responding. I have been working on this off and on for the last week or so. I think I might have it working. Here are some of the steps:

    Include NetX Duo source to change the max interface property
    Set max physical interfaces to 2
    Add a second driver instance g_sf_el_nx1.
    Both drivers' Channel 0 and 1 mac addresses are the same 0x2D090A0076C8
    Modified the sf_el_nx driver to make sure the mac address is the same for both interfaces (I have to track down exactly where I did that)
    Call nx_ip_interface_attach with the second driver instance
    Set up two sockets to receive on different source ports and send out to the same PC/different destination ports
    Compile and run
    Start up two perl scripts on a windows PC to send out UDP packets to the two separate IP addresses and ports
    Start wireshark so I can see what is going on
    Verify the sf_el_nx driver sets the same mac address for both interfaces (line 326 of nx_renesas_synergy.c,

    For the longest time it looked like it didn't work. THen I realized that Wireshark was not grouping the packets on the second address with the UDP sent to the first address, so that in fact it was working. I have to iron out a few details to make sure I really have the whole process figured out. Then I'll send you my project and where I modified nx_renesas_synergy.c. Hopefully I'm not chasing a phantom here!

  • Hi Janet,

    (SK-S7G2 / SSP 2.2.0)

    I would like to pick up this thread. I'm not able to make this work. I have a SK-S7G2 with a http server working fine. Then, I have added the second instance g_sf_el_nx1, etc... (following your steps)

    But second ip address doesn't work. In fact:

     status = nx_ip_status_check(&g_ip0, NX_IP_LINK_ENABLED, &actual_status, 100);

    returns always 0x43 (NX_NOT_SUCCESSFUL)

    I have serious doubts that SK-S7G2 could have two ip ranges working at once with only one port (only one PHY routed).

    Does anyone have a reference project with two ip address working in a same ethernet port?

    Thank you very much for your help!

  • The Azure NetZX manual (formerly the Express Logic NetX manual) says to multihome (which is what you want to do), you need to do the folllowing:

    NetX Duo supports systems connected to multiple physical devices using a single IP instance. Each physical interface is assigned to an interface control block in the IP instance. Applications wishing to use a multihome system must define the value for NX_MAX_PHSYCIAL_INTERFACES to the number of physical devices attached to the system, and rebuild NetX Duo library. By default NX_MAX_PHYSICAL_INTERFACES is set to one, creating one interface control block in the IP instance.

    The NetX Duo application creates a single IP instance for the primary device using the nx_ip_create service. For each additional network devices, the application attaches the device to the IP instance using the nx_ip_interface_attach service.

    Each network interface structure contains a subset of network information about the network interface that is contained in the IP control block, including interface IPv4 address, subnet mask, IP MTU size, and MAC-layer address information.


    NetX Duo with multihome support is backward compatible with earlier versions of NetX Duo. Services that do not take explicit interface information default to the primary network device.

  • Thank you very much Larry! I really appreciate your help.

    I try it again with NX_MAX_PHYSICAL_INTERFACES setted to 2 and using nx_ip_interface_attach

    Still doesn't work. But i have a doubt, maybe is the origin of my troubles here: even with channel 0 un routed (hardware level) I could select it for the nx_ip_interface_attach ? Maybe is a kind of virtual port...

    I only have one channel routed (channel 1 --> S7G2) to the PHY and RJ45 connector. When I select channel 0 in the Properties tab, how synergy manages this no-routed channel to have multihome?

    My purpose is to have two IP ranges but only one channel routed. For instance, having and as my IP addresses. And I want the S7G2 to respond (ping) for both IP.

    Thank you very much for your support.