Table of Contents
Wireless Distribution System.
Same channel, Encryption KEY of WDS link， SSID可以不一样。
- Bridge (Ap without beacon sending)
- Repeater (Ap with beacon sending)
No Loop Topology:
1.1 Setting up a WDS peer
WDS是IEEE 802.11的一个非标准扩展。 由于它是一个非标准扩展，各家芯 片厂商的驱动和固件实现都不一样，无法做到兼容，所以为了使用WDS， AP 和Repeater等无线设备的硬件和软件必须相同，以保证兼容。（不能是AP属 于一个厂商，Repeater来自另外一个厂商）。
iw phy phy0 interface add wds0 type wds iw dev wds0 set peer <MAC address>
set_wds_peer() 。 由于mac80211已经实现了该回调函数，所以对应的基
1.2 Using 4-address for AP and client mode
In some situations it might be useful to run a network with an Access Point and multiple clients, but with each client bridged to a network behind it. For this to work, both the client and the AP need to transmit 4-address frames, containing both source and destination MAC addresses.
Linux wireless has support for 4-address mode for AP and STAs but each driver needs to define this capability explicitly. All mac80211 drivers support 4-address mode if AP or STA modes of operation are supported respectively.
On the AP side you can enable 4-address frames for individual clients by isolating them in separate AP VLANs which are configured in 4-address mode. Such an AP VLAN will be limited to one client only, and this client will be used as the destination for all traffic on its interface, regardless of the destination MAC address in the packet headers.
wds_sta 必须置为1. 对于AP端时，驱动必须支持
NL80211_IFTYPE_AP_VLAN 接口类型，以及 wiphy flag
WIPHY_FLAG_4ADDR_AP 必须置起。 对于Client端，驱动必须支持
NL80211_IFTYPE_STATION 以及wiphy flag
1.3 Setting Up WDS
- On AP side, when writing hostapd configuration file, make sure
4-addressenabled WDS client connects, an interface appears with a name of
wlan0.sta1(I am assuming additional interfaces will appear as
wlan0.sta2and so on if more 4-address enabled clients connect).
wds_bridgeline in the hostapd configuration file will automatically add the wlan0.sta to your nominated bridge, e.g. br0. Alternatively, you can always do
brctl addifand so on.
As one would hope, non 4-address clients continue to work as normal and co-exist with 4-address clients.
- On STA side, as specified in documentation, the interface has
to be brought up with 4addr on option, e.g.
iw phy phy0 interface add wlan_sta0 type station 4addr on
Bridge the 4-addr mode client interface (which is now connected to AP side) wlansta0 to AP, e.g.
brctl addif br0 wlan_sta0 wlan0
Make sure you disable DHCP on this device as DHCP is already enabled on AP side and remember STA is simply a layer 2 device now.
- Simple WDS without security between WDS peers, use recommendations on https://wireless.wiki.kernel.org/en/users/documentation/iw#setting_up_a_wds_peer
- Not-so simple WDS, where WDS link is secured by the fact that it is really a modified STA-AP link (with all supported authentication options available), use recommendations on https://wireless.wiki.kernel.org/en/users/documentation/iw#using_4-address_for_ap_and_client_mode .