1

I have two devices which come up with default IP addresses:

  • Device 1 - 192.168.168.168 mask 255.255.255.0
  • Device 2 - 192.168.1.254 mask 255.255.255.0

I can commonly deduce that both the devices are part of the 192.168.0.0/16 network. Is that a correct assumption?

The reason I ask is because I want to manage both the devices at the same time, and I will be connecting both of these devices to a dumb ethernet switch (no VLANs etc. - really dumb). I plan to also connect a PC to the switch.

I am thinking of using 192.168.2.5/16 as the IP address of the PC. Let me know if I will be able to access the device, or is this not a good practice.

Edit:

I cannot change the default IP addresses the devices have when they come up. When the devices go to a bad state, and I factory default them, these are the IP addresses they come up with.

So when the packet from the PC with src-ip : 192.168.2.5/16 & dst-ip : 192.168.168.168

comes to device 1 (assuming that the dumb switch just sent it on all ports), why will device-1 not respond?

1
  • The problem is all your PCs are in different subnets. So it would not work. Apr 25, 2020 at 8:56

4 Answers 4

7

Now I can commonly deduce that both the devices are part of the 192.168.0.0/16 network. Is that a correct assumption.

No, that's incorrect. You're using netmask 255.255.255.0, so that are two different /24s. Just because you can summarize them to a /16 doesn't make it a /16.

If you want this to work, you'll need to change the netmask on all devices to /16, or place a router which is connected to both /24s and routes packets between them.

4
  • 2
    or simply change the IP address of one of the device...
    – JFL
    Mar 17, 2016 at 7:36
  • 2
    True, I was assuming that was not an option, but it could be of course.
    – Teun Vink
    Mar 17, 2016 at 7:37
  • Yes.. I can't change the ips.. When the devices run into a errored state and i facyory default them.. They come with these ips as default. Mar 17, 2016 at 17:12
  • @TeunVink : Thanks.. I have edited the question. Can you please throw some light. Mar 17, 2016 at 18:13
2

Switches are not hubs. Hubs repeat a signal on all ports, but switches selectively send frames to only the ports where the host with the destination MAC address is connected.

You don't seem to understand the difference between layer-2 and layer-3.

An IP address is a layer-3 address. A host will have an IP address, mask, and configured gateway. If the destination IP address is not on the same network, as defined by the mask, it will send the packet to its configured gateway.

Switches don't see layer-3 IP addresses since they don't strip off the layer-2 frame to inspect the IP packet; they look at the layer-2 MAC addresses.

A switch learns which MAC addresses are connected to which ports by inspecting the source MAC address of any frames coming into the ports, and it populates its MAC address table with this. If the switch doesn't have a MAC address in its table, it will flood the frame to all ports. Switches will quickly learn MAC addresses since it only takes one frame from a host to populate the MAC address table with a MAC address. If the switch has the MAC address in its MAC address table, it will only send frames destined to that MAC address to the port it finds in its MAC address table.

When a host wants to send something to a particular IP address, it needs to get the layer-2 destination MAC address (resolve the layer-3 IP address to a layer-2 MAC address). To do this, it looks in its ARP cache to see if there is an entry for this. If it doesn't have this in its ARP cache, it will send an ARP request to find the MAC address. Once it has the MAC address, it will create an ethernet frame which encapsulates the IP packet. It then sends the frame to the switch.

When the IP address is on a different network, as defined by the mask, it will use the MAC address of the configured gateway, and it will use the above process to get the MAC address of the gateway.

4
  • The dumb switch is almost a hub but commercially called switch. Eg. something like this .. us.dlink.com/products/business-solutions/… So given that I have that, the PC should be able to learn the devices1&2's MAC addresses.. right? Mar 17, 2016 at 19:44
  • That's not a hub, it's a switch, and it will learn MAC addresses, and it won't flood every port with every frame. The devices which think they are on different networks than other devices will not try to communicate via layer-2 (on the switch) with devices they think are on different networks. It just doesn't work that way. To communicate between networks, you need a router. Switches switch frames on the same network, routers switch packets between different networks. You want the switch to route, but it doesn't know anything about IP addresses.
    – Ron Maupin
    Mar 17, 2016 at 19:51
  • Ron: Based on your profile, you seem to be an expert. Let me rephrase my original question, why is 192.168.168.168/24 ip not part of 192.168.0.0/16 network. Isn't 192.168.168.0/24 network inside of 192.168.0.0/16 network. Mar 17, 2016 at 21:07
  • 2
    A device which is limited by its mask to a /24 network will recognize that any IP address outside the /24 is actually outside its local network. It will not attempt to connect to any address outside the local LAN using the local LAN, but send any packets destined for any address outside the /24 to its configured gateway. Network aggregation such as you describe happens in a router, not on a LAN. You can say every IP address in the world is part of 0.0.0.0/0, so why do we need routing?
    – Ron Maupin
    Mar 17, 2016 at 21:11
1

I want to manage both the devices at the same time, and I will be connecting both of these devices to a dumb ethernet switch (no VLANs etc. - really dumb)

If you can't change the (borked) address setup, you need to work around it.

While those devices belong to different IP networks, you can configure the management PC with two IP addresses, one from each network, on a single NIC. If you configure the NIC with addresses 192.168.168.2/24 and 192.168.1.2/24, for instance, it'll be able to talk to both devices without a problem.

You might need to configure a third address for your normal network and Internet access. If you must use DHCP there, you should use one NIC for your normal network (with DHCP) and a second NIC (with two static IP addresses) for the management of those devices.

2
  • you can configure the management PC with two IP addresses, one from each network, on a single NIC - Can you do that on a single NIC or did you mean two different NICs? Aug 27, 2020 at 5:12
  • One NIC or two NICs doesn't really matter, unless you need to use DHCP (then it's two NICs).
    – Zac67
    Aug 27, 2020 at 7:23
0

@KingkongJnr may be do this the PC you intend to use as a sort of server , if by chance is a windows or a Linux (non Apple) have 3 USB to Ethernet (if not use a USB Hubs) so statically configure each of the 2 Device subnets 2 different USB to Ethernet on your PC. Also connect the 3rd USB to Ethernet to a backhaul that is accessible via the internet. So if there is a need for Device A to Communicate with Device B. Then get a L2+L3 Managed Plus switch or use Linux as choice for the PC that you are going to control, and turn into router mode ??

The first option with 3 USB it works (I use it every day)

Thanks Bharat C P

Your Answer

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

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