Generally you need a router to route between the subnets. One common configuration is to have one router interface with two IP addresses on it in two different subnets (Cisco calls the second one a “secondary IP”).
Here are some cases where that is useful:
- You originally allocated a /24 to the subnet but now have more than 254 hosts during peak times. Rather than renumbering into a /23, you add a /25 secondary.
- You are in the middle of renumbering, and have both subnets available during the transition to minimize impact.
- You provide Internet routable subnet for workstations and RFC1918 address space for IP-phones, printers, SAN infrastructure, etc... (this can make your DHCP configuration complicated, but simplifies access port provisioning).
It might be possible to configure the end hosts to talk directly on both vlans, but that can be error prone. Simpler configs are more reliable (one IP per host, one subnet per vlan).
End hosts with multiple IP addresses suffer endless problems because every time they initiate a socket they have to pick a source IP address for that socket: but end hosts don’t have the routing information to make an intelligent decision about which source IP address is optimal.
Note that every dual protocol IPv4/IPv6 network in effect has two different subnets on one vlan. Those subnets cannot talk to each other at all because they are different IP protocols. Modern operating systems incorporate substantial intelligence to decide whether to contact a destination over IPv4 or IPv6 (keyword: “happy eyeballs”).