I'm developing openWRT SDK AA version. How do I set bridge interface between ethernet and wireless interface? Can I create extra interface, say A besides those existing WAN and LAN and then bridge interface A and LAN tog
1 Answer
You cannot bridge WiFi client interfaces. The reason is explained on the OpenWrt Wiki:
The 802.11 standard only uses three MAC addresses for frames transmitted between the Access Point and the Station. Frames transmitted from the Station to the AP don't include the ethernet source MAC of the requesting host and response frames are missing the destination ethernet MAC to address the target host behind the client bridge.
- Bridged Host sends a packet to the Target host
- Frame is relayed via the W-LAN Client and the MAC address of the transmitting wireless adapter is used as source MAC, the sending ethernet MAC is discarded
- W-LAN AP receives the frame and redirects it to the Target
- Target receives the frame and generates a response
- Target responds to the received frame using the (wrong) source MAC as destination
- W-LAN AP relays the frame to the W-LAN Client with the given destination MAC W-LAN Client receives the frame and assumes it is the final destination since it's wireless MAC is used in the frame, the packet is not forwarded Bridged Host never sees a response frame since the W-LAN Client became the destination, no connection is possible
However, in access point mode, bridging is possible. Just use the following in /etc/config/wireless
:
config 'wifi-iface'
option 'network' 'lan'
...
In /etc/config/network
the lan
interface has to be a bridge interface:
config 'interface' 'lan'
option 'type' 'bridge'
...
Of course, you can use any name, not just lan
.
If you just want a bridge with multiple interfaces, you can create a VLAN interfaces that aren’t “connected” to anything.
-
Thanks Daniel. Actually I'm referring how to bridge the eth and ath interface of Access Point (AP). =)– JessJul 29, 2016 at 9:46
-
That’s described below the quote. Do you need additional information?– Daniel BJul 29, 2016 at 9:56
-
-
Just create another config section for it in
/etc/config/network
. You might need to adjust the firewall rules, too.– Daniel BJul 29, 2016 at 10:00