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.
For Communication between different subnets packet has to reach router or layer3 devices to process this packet . If another networks is directly connected then forwards packets on basis of ARP table . If destination is on another networks means forwards packet to next hops on basis of route entry Configured on network .
However layer2 device cannot understand IP address . Only same subnets traffic can be handle by layer2 device, traffic is forwarded based on mac-address table
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.