??
You simply don't run logically distinct networks on the same segment! As mentioned below, if the need for that arise (say, you're an ISP doling out IP address ranges on a given subnet) then you manage it with custom netmasks.
This is elementary IP networking.