0

I have an hardware-based line with two network devices: one PC (windows 10) and special controller (for working with hardware buttons).

Controller has ip-address 192.168.0.10 and connected to pc via a switch (not router). After connecting to customer network (cable plugged into my switch), PC get ip-address 192.168.1.10 via DHCP, and access to 192.168.0.10 is lost

I trying add static route on PC by :

route add 192.168.0.10 192.168.1.10

but ping did not working. Customer rules don’t give me the opportunity to configure devices addresses, but I need the controller address to be static. DHCP also does not allow me to set two addresses on a network interface

Is there anyway to access a controller from the PC in this case, when the equipment is physically plugged in one switch? Or is the only option to replace the switch with a router?

The switch is built into the controller (the device has two network inputs) and is not a separate device.

Update

Thanks to u1686_grawity, my working script (dhcp + 192.168.0.11 on interface LAN):

set name=LAN

netsh interface ip set address "%name%" dhcp

netsh inter ip set int interface="%name%" dhcpstaticipcoexistence=enable || pause

netsh interface ip add address "%name%" 192.168.0.11 255.255.255.0 || pause

ipconfig /release %name% || pause

ipconfig /renew %name% || pause

netsh interface ip show config name="%name%"

pause

1 Answer 1

2

Customer rules don’t give me the opportunity to configure devices addresses, but I need the controller address to be static

That's something you really need to work out with your customer first. At the very least, they need to know what static IP address you'll be assigning to the controller after everything is done, so that they could exclude it from their DHCP pool... and so that the next person who works on it 5 years later knows what the address belongs to.

DHCP also does not allow me to set two addresses on a network interface

That's a Windows-specific limitation, but apparently it is in fact possible to add static IP addresses alongside a DHCP address in recent Windows versions. See this and this post, but the gist is:

  1. Enable the feature with:

    netsh inter ip set int interface="Ethernet" dhcpstaticipcoexistence=enable
    
  2. Add the static IP address:

    netsh interface ip add address "Ethernet" 192.168.0.99 255.255.255.0
    

An alternative method would be… to have two Ethernet ports: one connected to the main LAN (with DHCP) and the other connected to your controller (static IP). There are Ethernet USB adapters (for laptops) as well as Ethernet expansion cards for PCI and PCI-Express (for desktops).

I trying add static route on PC by [...] but ping not working

Unlike e.g. phone calls, IP configuration is unidirectional – it must work in both directions separately. That is, it is not enough for your computer to know how to reach the device directly; that device must also know how to reach the computer directly as well.

So even though routes on your side may be correct, and you might be actually sending those ping requests to 192.168.0.10, that won't help at all if the controller still considers your 192.168.1.10 to be outside of its subnet and has no idea how to send the ping reply.

There are a few ways to solve this:

  1. Add the correct IP address to your computer, so that it would be able to send packets from an address that the device considers local.

    If you just need this temporarily – you could disable DHCP on your computer for a moment and set up a static IP address instead, then perform the configuration of the controller, finally switch the computer back to DHCP.

    If you need it somewhat permanently – see the previous section of the post; it is possible to have both static and DHCP on Windows.

  2. It is likely that the controller is capable of indirect communication through a gateway; it just needs a gateway to be present. Most likely it is configured with 192.168.0.1 or 192.168.0.254 as its gateway to other subnets.

    So depending on situation, there would be various ways to place a router to handle the forwarding between the two subnets (e.g. by configuring the existing upstream router to handle both subnets on the same ethernet).

Is there anyway to access a controller from the PC in this case, when the equipment is physically plugged in one switch? Or is the only option to replace the switch with a router?

The switch is built into the controller (the device has two network inputs) and is not a separate device.

That situation isn't really different from having a router. Keep in mind, if you're talking about the kind of router with 4 LAN ports – that's a built-in switch too.

1
  • Thanks very much for "netsh inter ip set int interface="Ethernet" dhcpstaticipcoexistence=enable". Locally I got the desired result, tomorrow I will go and check with the customer. Regarding the fact that “That’s something you really need to work out with your customer first”, in this case it is a thousand times easier and cheaper to install another router on our line than to get a static ip from the customer. Commented Nov 26, 2023 at 10:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .