1

So I've looked a lot into accessing devices with the same IP and haven't been able to find much of an answer, but I imagine there is some solution and that this issue is somewhat common.

I often find myself in a situation where I need to configure a bunch of hardware devices that have a factory IP. The conventional method is to connect to them individually and configure them, then take them off the network for deployment elsewhere.

I was sick of the repetition in this, so I create a node JS application to do it for me, the problem is they are still all on the same IP so I still have to do them one at a time. What I envision is some router configuration in which every physical port has a predetermined IP address. I would need to configure these ports to forward the traffic to the factory IP of the hardware, but once that is done I could connect them all to the router and then have my node application configure them at the same time using the port-assigned IP address instead of the factory IP.

Any information or even a nudge in the right direction would be greatly appreciated!

I saw this post: Assign an IP address based on switch port

It seems pretty close to what I need except it looks like it requires the devices to be set to DHCP. This isn't an option for hardware that comes with a static IP as the factory default settings.

1
  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Commented Aug 10, 2017 at 14:01

5 Answers 5

2

Even if each device has the same IP, it has another address that is unique to each device: the Media Access Control (MAC) address.

So you must find a way to access the devices with this MAC address.

IP to MAC address binding is done through Address Resolution Protocol (ARP). An arp resolution is normally performed to associate them, but you can do it manually with a static ARP entry on your management station.

You could try to :

  • gather all MAC addresses of the devices, put them in a file
  • connect all your devices plus your management station to a switch (without a router)
  • have your application to read the MAC list file, set a static arp entry for the first device, configure it, change the static ARP entry to the second device, etc...

This will probably require you software to run with administrative privilege on the station to be allowed to set static ARP entry.

1

This can be done using a Linux box. It can probably also be done with some high-end routers from the likes of cisco but I have no experience of those.

Linux supports what are known as "network namespaces". Each "network namespace" is a separate logical instance of the network stack.

Either install lots of network controllers or connect a VLAN-supporting switch, set up the port connected to the Linux box as a trunk and create a virtual interface for each VLAN.

Then move each of the network interfaces that will be used to connect devices to it's own network namespace. Connect the secondary network namespaces back to the main network namespace using virtual Ethernet (veth) devices.

Now implement NAT in each of the secondary network namespaces. You will probablly want to change both the source and destination IP.

0

The problem is that each router interface must be in a different network; routers route between networks, not from a network back to the same network. A router with multiple interfaces in the same network would not know which interface to use.

0

The layer 2 approach:

Use static ARP entries mapped to the device you currently want to talk to. If they're behind a router, you need to configure the static ARP on the router.

The (simple) layer 3 approach:

Put every device behind its own router. Configure your local route to use the router in front of the device you currently want to talk to.

The layer 3 with NAT approach:

Put every device behind its own router. On the router, configure destination NAT / port forwarding / virtual IP to forward the required port (e.g. 80) to the device behind it. Talk to the router instead and you've got the device behind it. This allows you to talk to several devices at the same time.

Realizing the last approach with a single router will regularly fail due to port forwarding relying on (simple) routing when you need to force the route through a specific interface. If you find a router able to do that, it's what you need. Additionally, you'll need to use an ingress IP pool or several ports on a single IP to separate port forwarding. Probably it's much cheaper to use a bunch of simple SOHO routers.

0

If you know the Mac addresses ahead of time and your using a windows machine you can make your js application create an arp entry for each device. (You can do this is most OS's but I'm showing an example for windows). The arp entry will make windows use a diffrent ip for each device you have by turning it into a frame right out of windows (using the Mac address). arp -s 192.168.1.10 ff:ff:ff:ff:ff:ff' and the next Mac you'll do arp -s '192.168.1.11 ff:ff:ff:gg:gg:gg and so on. This ip address can be anything that's on the same subnet as the programming computer.

So in your application have it collect the Mac addresses up front from the user or spreadsheet or whatever. Enter the "duped" ip address matched to a real Mac address in the arp table, the run your app against it. Don't forget to clear all the arp entries when it's done. arp -d * or use an ip address in place of * if you don't want to clear them all.

We use this technique in the field quit a bit with device we don't know the ip address too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.