-1

I have OpenWRT set up on a router, with a wireless client connected on the LAN, and connected to another network on the WAN. wlan1 is bridged on the br-lan interface, and typically forwards to the LAN interface eth0.

I'm currently sending TCP/UDP packets from a client (192.168.1.20) on the LAN to a server (128.112.94.34) on the WAN. When I run tcpdump -len -i br-lan (viewing the packets on the br-lan interface, I can see each of these packets coming through, something like:

22:12:03.055370 58:7f:57:0c:e4:80 > c0:56:27:72:a3:5b, ethertype IPv4 (0x0800), length 73: 192.168.1.20.49437 > 128.112.94.34.12341: Flags [P.], seq 105:112, ack 1, win 4117, options [nop,nop,TS val 581515569 ecr 1500229582], length 7
22:12:04.055378 58:7f:57:0c:e4:80 > c0:56:27:72:a3:5b, ethertype IPv4 (0x0800), length 73: 192.168.1.20.49437 > 128.112.94.34.12341: Flags [P.], seq 112:119, ack 1, win 4117, options [nop,nop,TS val 581516566 ecr 1500230581], length 7
22:12:05.042628 58:7f:57:0c:e4:80 > c0:56:27:72:a3:5b, ethertype IPv4 (0x0800), length 73: 192.168.1.20.49437 > 128.112.94.34.12341: Flags [P.], seq 119:126, ack 1, win 4117, options [nop,nop,TS val 581517541 ecr 1500231577], length 7

However, when I run the command on eth0 (tcpdump -len -i eth0), I get none of the lines above. I've checked my firewall (allowing all connections from LAN to WAN already), route table (192.168.1.x routes to the default gateway), and nothing obvious to me is preventing this.

My question is: How does the linux kernel route packets from br-lan to eth0 on a router?

What kinds of subsystems or authentication mechanisms does a router go through to let a packet pass through?

1 Answer 1

1

Bridging and routing are not the same. Bridging happens at a lower layer than routing. Essentially bridging behaves like a switch. The virtual switch implemented by the Linux bridging code will have one interface attached to the upper layers of the network stack as well as a number of physical interfaces. So in your case where there are two physical interfaces in the bridge, it means you have a virtual 3-port switch.

Packets send to a known MAC address are only send to the interface the MAC address is known to be attached to - this is crucial for performance reasons. So when the switch receive a packet on wlan1 with destination MAC c0:56:27:72:a3:5b which the virtual switch knows is attached to the br-lan interface, it will bridge that packet from wlan1 to br-lan. That way it will never touch the eth0 interface.

Not the answer you're looking for? Browse other questions tagged .