The router don't allow both to be on the same subnet.
Yes, that is why it is called a router: routers "route" data between two different subnets. Subnets cannot have any overlap in their address ranges.
The definition of a subnet is the four octets (32-bits) that are the bit-wise AND result of
- the subnet bitmask (e.g. 255.255.255.0)
- with any IP address that can be on that subnet
- e.g. say an IP addres is 192.168.1.123:
- 255 AND 192 => 192
- 255 AND 168 => 168
- 255 AND 1 => 1
- 0 AND123 => 0
A subnet is designated by that ANDed result plus the bitmask e.g. in the example above
- 192.168.1.0/255.255.255.0 (also 192.168.1.0/24)
- This subnet covers addresses from 192.168.1.0 to 192.168.1.255, but that means 192.168.1.1 through 192.168.1.254 in practice*
* addresses that cannot be used are 192.168.1.0 and 192.168.1.255 because binary addresses with a host portion of all ones and all zeros are invalid. The zero address is .0 because it is used to specify a network without specifying a host. The .255 address is used to broadcast a message to every host on a network.
All hosts know two, and sometimes three things:
- their own IP address
- their subnet bitmask
- the IP of the router(s) to other subnets
The point is that, if a host is told to connect to a destination IP, and the bitwise AND of its own source IP with its subnet mask is the same as the bitwise AND of the destination IP with its subnet mask, then it knows the destination IP is on the same subnet, and it can communicate directly via ethernet ("link layer" - MAC address**) to the host that owns that destination IP via tricks (ARP - address resolution protocol) that can be performed on the local subnet.
If the masks do not match, then it can pass the packet to be sent to the router, and the router will figure out the next step (probably another router on the next subnet).
** Another name for the local subnet is "ethernet broadcast domain," although that phrase probably dates me. Because any ethernet packet that is sent by an ethernet card on a local subnet is seen by every other host on that local subnet; in other words, all ethernet packets are broadcast***. All ethernet cards looks at every ethernet packet in its "ethernet broadcast domain" that comes by and chooses, based on the destination MAC address of the packet, whether to pass that packet up to its host.
*** although that does not mean they use a broadcast MAC address; and yes I know switches can muck with this, but logically it can be treated as true.
N.B. THIS EXPLANATION IS ***EEXXTTRREEMMEELLYY*** SIMPLIFIED, AND THERE ARE MANY SPECIAL CASES, BUT IT WILL COVER ALMOST EVERY ETHERNET OR WIFI CONFIGURATION MOST OF US WILL EVER SEE.
So maybe now you understand why I asked for all of that information, because the IP addresses you are showing have all of the devices on the same subnet (192.168.1.0/24) and nothing on the other subnet (192.168.0.0/24), so the router would seem to be irrelevant, because all of the addresses would have to be on the same side of the router.
We use the acronyms LAN and WAN, but really both of those are subnets, with the distinction that the WAN is usually closer to "The Internet," and the LAN has only one router i.e. the one that routes packets to the WAN and beyond.