Access IPs who's subnets differ

I have one system that is on 10.0.x.21 and another that is on 10.0.y.21

Is there a simple way to allow those two IPs to communicate? I am trying to create a setup where X and Y can both potentially vary from 0-255 and any combination of x and y will still allow for the systems to communicate.

Thank you for your help.


Solution 1:

Is there a simple way to allow those two IPs to communicate?

Yes, a router. Routers route between subnets.

Assuming a /24 network mask for each of your addresses, they belong to different subnets (10.0.x.0/24 and 10.0.y.0/24), requiring a router in between.

If you use a /16 network mask, both IP addresses belong to the same subnet and talk to each other directly, so you can use a simple L2 switch or a direct cable.

The same network mask needs to be used for all devices in a subnet.