OpenWrt支持多种客户端模式，包括使用WDS (Wireless Distribution System)的桥接模式, 客户端路由模式和仅在（老的）brcm-2.4硬件上实现的客户端桥接模式。
The setup of Broadcom WDS is explained in the recipe article WDS (Broadcom).
The setup of Madwifi or mac80211 WDS is explained in the recipe article WDS (atheros).
This option is the preferred approach for wireless chipsets that support the Linux mac80211 wireless drivers (e.g. Atheros wireless chipsets). If the file /etc/config/wireless looks like the following, then mac80211 drivers are in use.
config wifi-device 'radio0' option type 'mac80211' ...
The routed client mode is the most generic wireless option. It is supported by all chipsets and drivers and requires no special modifications. The downside of routed client mode is the inability to bridge network segments or relay broadcast traffic. This affects for example the Windows Network Neighbourhood where hosts from two network segments cannot “see” each other without a domain controller. Connection by IP address or host name is still possible.
With routed client mode there are two possibilities to implement the network topology, depending on the specific requirements.
Using masquerading (NAT) on a client router connects a network segment behind the client to an existing wireless network without further modifications to the access point. The downside is that hosts on the AP side cannot access hosts behind the client router.
Hosts from the client network (red) are able to reach hosts in the AP network (blue), the client router masquerades outgoing traffic. Hosts on the AP side only see the client router, all traffic originating from client hosts uses 192.168.1.30 as source address. No direct connection from LAN Host 1 or 2 to Client Host 1 or 2 is possible.
See the Routed Client (Using MASQUERADE) article for configuration instructions.
This option requires a static route on the AP pointing to the subnet behind the client router using the client router's IP on the AP network as a gateway. This allows hosts on both segments to reach each other directly, but it requires administrative access to the AP in order to configure the static route.
Hosts from the client network (red) are able to directly communicate with hosts in the AP network (blue) and vice versa. The rectangles represent static route entries. See the Routed Client (Using Routing) article for configuration instructions.
The bridged client mode is a proprietary Broadcom extension called WET (Wireless Ethernet Transceiver) mode. It is mostly Layer 2 transparent but has some disadvantages that may hinder network connectivity under certain circumstances (see technical background section).
All hosts are within the same subnet, W-LAN and LAN are bridged on both the AP and the client router. For a configuration example of bridged client mode, read the Bridged Client (Broadcom) article.
It is possible to achieve a bridge-like client mode setup with the help of relayd.
The setup is explained in the Routed Client with relayd (Pseudobridge) article.
Transparent client bridging or bridged client mode is not possible with vanilla OpenWrt on all platforms except brcm-2.4 with the proprietary Broadcom driver. It is possible to achieve this goal by using WDS, the background is explained below.
There are 3rd-party patches to implement ARP-NAT for platforms other than brcm-2.4 but those are not part of OpenWrt. The Kamikaze based Gargoyle firmware has support for it but is not officially supported by the OpenWrt developers.
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.
If WDS is used, both the AP and the Station switch to the 4-address-mode which enables transparent bridging on the client side.
The proprietary wl.o Broadcom wireless driver implements an ARP-NAT (Layer 2 address translation) mechanism called WET mode. ARP-NAT is comparable to Masquerading used on Layer 3 to connect multiple hosts using only one globally routed public IP address.
However, the address translation used by the Broadcom driver is not fully transparent and can cause various hard to debug network issues:
Bridged client mode only works on brcm-2.4 all other platforms need non-standard patches or other workarounds
There are no bridged and routed modes on Kamikaze, per se. Instead, multiple interfaces are bridged with an entry in /etc/config/network like this:
/etc/config/wireless, set the network to the same network specified in the bridge:
Alternatively, but a little less flexibly, you can use this line in
For routed mode, the wireless device needs to be used in a normal network configuration in /etc/config/network. Then, iptables rules are used to forward packets between the networks. The default gateway on each network (this is routing; you're connecting two networks together) needs to forward packets destined for the other network to the wifi router, or each host on each network needs to know that the wifi router is the router for packets to the respective network.
Both Broadcom and Atheros chipsets support scanning with the iwlist command. This command will scan all interfaces for networks:
If you're having trouble connecting to either a hidden AP or a virtual AP (usually because wpa_supplicant doesn't list it in a scan), make sure these options are set correctly in the wpa_supplicant config file: