I know that the layer 2 doesn't understand IP, and the broadcast domain is same.
Why can't devices talk, how does it happen?
Network Engineering Stack Exchange is a question and answer site for network engineers. It only takes a minute to sign up.Sign up to join this community
Devices in different subnets can communicate. That is the purpose of a router. Routers route packets between different networks.
Even if devices in different networks are on the same layer-2 broadcast domain, you need a router to let the devices communicate at layer-3. That is because each host will compare the destination layer-3 address and its own layer-3 address and mask to see if they are on the same network. If the destination host is on a different network, the host will send the packets in layer-2 frames to its configured gateway (router).
The host must assume that the destination network could be across the world from its network, and the gateway is the host on the network that knows how to forward packets toward the destination network.
Three computers, one has two interfaces, the other two on different subnets. The one with two is technically a router in function. And a router would be simpler.
The missing parts for me was the -A FORWARD in both directions on the bridging computer for iptables. And the remote clients need a route to respond to each other.
for one client
for the other client
Where the bridging computer has two interfaces, one statically assigned 192.168.2.1 and one statically assigned 192.168.7.1.
I needed this to use my pulseaudio server that I put on a different subnet and because I ran out of ports on various switches / routers. And I wanted to keep audio/file traffic different from internet traffic.