Access linux device through bridged interface

1

I'm currently trying to set up a device with a bridge in my network. The device used for the Bridge has two eth interfaces and a wlan interface.

I managed to create the bridge from eth1 to wlan0. The bridge itself is working fine, I can ping the PC2 connected to the bridge at eth1 from the wlan0

Right now I can only use eth0 for ssh or accessing its page set up with lighttpd.

Is there a way to configure the network so I can use the wlan0-interface too? I tried to look into iptables but I could not find any solution.

That's the setup:

PC 1                       Bridge                  PC 2
-----------------------------------------------------
Lan--------------------->|eth0   |
                         |eth1   |--------------->Lan
                         |wlan   |

Edit:

Trying to go a bit more into detail. Both PC2 and the Bridge-device have installed lighttpd and own a homepage which can be accessed by their IP.

The bridge looks like this

$ brctl show 
bridge name        bridge id              stp enabled          interfaces
br0                8000.1cba8ca5cb94      no                   eth1
                                                               wlan0

Know, what I want: While I'm connected via wlan0: insert the PC2's IP into the browser and view the Homepage -> this worked

While I'm connected via wlan0: insert the Bridge-device's IP into the browser and view the Homepage -> this does not work ... I guess because that's because I had to "ifconfig wlan 0.0.0.0 down" before creating the bridge.

I hope it gets more clear now... :)

Vilanoil

Posted 2015-11-18T09:01:09.810

Reputation: 11

Answers

0

Most wireless devices do not allow traffic to be sent over them with a non-local MAC.

I would suggest just not bridging your wireless device.

You might be able to get around this with ebtables NAT. External URLs are usually discouraged on the StackExchange network, but the following is a good source of explanation and example config and has been around for years:

https://wiki.debian.org/BridgeNetworkConnections#Bridging_with_a_wireless_NIC

suprjami

Posted 2015-11-18T09:01:09.810

Reputation: 543

Right. There are two different LAN technologies in play (IEEE 802.3 and IEEE 802.11), so you can't use a transparent bridge; it requires a translational bridge. You can bridge different IEEE LAN types, but you need a translational bridge. It used to be common to bridge 802.3 (ethernet) and 802.5 (token ring) with translational bridges. Transparent bridges only work with the same LAN type. – Ron Maupin – 2015-11-29T05:22:29.433

That's not the reason though. The Linux bridge will pass Ethernet frames from an Ethernet 802.3 device to a Wireless 802.11 device. The problem is that the firmware on the wireless device probably has a rule which says "if Source Mac is not My MAC, drop the traffic". – suprjami – 2015-11-29T05:34:47.123

Since one side is ethernet, and one side is Wi-Fi, the frames must be translated from ethernet frames to Wi-Fi frames, or vice versa. Wi-Fi (IEEE 802.11) is not ethernet (802.3), or any other LAN type. A translational bridge translates from on LAN type to another LAN type. I can believe that Linux can do the translation, and it can probably do the translation to token ring, FDDI, etc., too.. – Ron Maupin – 2015-11-29T05:40:10.990

That is Layer 1 receive and transmit, on Linux that is handled by the device driver transparently to upper layers. By the time the traffic reaches the bridge, the traffic is a Layer 2 Ethernet frame. The bridge just knows "ports" and the underlying Layer 1 device type of the port is abstracted away from the bridge. – suprjami – 2015-11-29T05:44:14.210

The Wi-Fi frame header is different than the ethernet frame header. An ethernet frame won't work on Wi-Fi, or vice versa. The frame must be translated from one to the other. – Ron Maupin – 2015-11-29T05:47:45.943