Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:network:wifi:atheroswds [2023/04/18 14:44] – Major revision to the page. Attempt to simplify the content and improve style. Removed dead link. icecreamdocs:guide-user:network:wifi:atheroswds [2024/02/15 05:28] – [Wireless Repeater (Wireless Extender)] add relayd as alternative. bill888
Line 1: Line 1:
-====== Wireless network bridge (wireless repeater) ======+====== Wireless Repeater (Wireless Extender) ======
  
-This network setup consists of a wireless access point and a wireless repeater. The access point is the device that connects to the main network using a wired connection and enables access to the internet. The repeater connects wirelessly to the access point as a station or client device. Once connected, it acts as a bridge to provide access to that main network and to the internet for any wireless and wired client devices connected to the repeater.+This network setup consists of a wireless access point and a wireless repeater. The access point is the device that connects to the main network using a wired connection and enables access to the internet. The repeater connects wirelessly to the access point as a station or client device. Once connected, it acts as a "bridge" or more accurately a point to point link, to provide access to that main network and to the internet for any wireless and wired client devices connected to the repeater. This setup is useful to extend the reach of your network, such as the Wi-Fi coverage on your location.
  
-The method described in this article results in a transparent bridge at layer 2 in the OSI model. All broadcast packets, such as DHCP requests, are sent in both directions over the wireless bridge. The original source MAC address of the network devices on both sides are preserved over the bridge.+The method described in this article results in a backhaul link at layer 2 in the OSI model. All broadcast packets, such as DHCP requests, are sent in both directions over the link. The original source MAC address of the network devices on both sides are preserved over the bridge.
  
 The client devices connected to the upstream access point and those connected to the repeater will be on the same subnet. In other words, they will be visible to each other and, therefore, enable the use of discovery and configuration protocols such as zeroconf. The upstream access point and the repeater remain accessible over the network. The client devices connected to the upstream access point and those connected to the repeater will be on the same subnet. In other words, they will be visible to each other and, therefore, enable the use of discovery and configuration protocols such as zeroconf. The upstream access point and the repeater remain accessible over the network.
  
-The wireless distribution system technology (WDS mode) is required to create a network bridge over a wireless link between the access point and the repeater device. The IEEE 802.11-1999 standard defines WDS as a mechanism for constructing 802.11 frames using a 4-address format, however, it does not define how to implement it or how stations interact to arrange for exchanging frames of this format ((https://www.ieee802.org/1/files/public/802_architecture_group/802-11/4-address-format.doc)). This may lead to problems when using WDS between network devices from different chipset and firmware vendors, so **it is advisable to use OpenWrt both on the access point and on the repeater** to use a shared implementation of this technology and increase your chances to make it work fine.+Two wireless protocols can be used to achieve this, "WDSand "802.11s-mesh"
  
-Most wireless drivers in OpenWrt support the WDS mode, including those of the type "MAC80211"Atheros drivers are generally the most reliable when working on WDS mode, however, other drivers are likely to work just as fine.+This document will describe the use of WDS. 
 +For 802.11s mesh see: [[:docs:guide-user:network:wifi:mesh:80211s]] 
 + 
 +The wireless distribution system technology (WDS mode) is required to create a network connection over a wireless link between the access point and the repeater device. The IEEE 802.11-1999 standard defines WDS as a mechanism for constructing 802.11 frames using a 4-address formathowever, it does not define how to implement it or how stations interact to arrange for exchanging frames of this format ((https://www.ieee802.org/1/files/public/802_architecture_group/802-11/4-address-format.doc)). This may lead to problems when using WDS between network devices from different chipset and firmware vendors, so **it is advisable to use OpenWrt both on the access point and on the repeater** to use a shared implementation of this technology and increase your chances to make it work fineMost wireless drivers in OpenWrt support the WDS mode
 + 
 +If you are unable to use WDS or 802.11s mesh due to limiations of the Access Point, then you may wish to consider using [[:docs:guide-user:network:wifi:relay_configuration|Relayd - Wireless Repeater/Extender]] or [[:docs:guide-user:network:wifi:connect_client_wifi|simple wireless client]]
  
 ===== Configuration ===== ===== Configuration =====
Line 19: Line 24:
   * Tested with OpenWrt 21.02.3 with Linksys WRT1900ACS v2 as upstream wireless access point, and Linksys EA8500 as the repeater.   * Tested with OpenWrt 21.02.3 with Linksys WRT1900ACS v2 as upstream wireless access point, and Linksys EA8500 as the repeater.
   * Tested with OpenWrt 22.03.2 with Banana PI BPI-R64 as upstream wireless access point, and Banana PI BPI-R2 as the repeater (AsiaRF AW7915-NP1 cards on both sides).   * Tested with OpenWrt 22.03.2 with Banana PI BPI-R64 as upstream wireless access point, and Banana PI BPI-R2 as the repeater (AsiaRF AW7915-NP1 cards on both sides).
- +The network configuration process may be performed both via the command line (with [[docs:guide-user:base-system:uci|uci]] and SSH) and via a GUI (with [[docs:guide-user:luci:luci.essentials|luci]] and a web browser). It is split in two sections:
-The network configuration process may be performed both via the command-line (with [[docs:guide-user:base-system:uci|uci]] and SSH) and via a GUI (with [[docs:guide-user:luci:luci.essentials|luci]] and a web browser). It is split in two sections:+
   - The access point or AP.   - The access point or AP.
   - The station or STA.   - The station or STA.
Line 26: Line 30:
 It is important to follow the order of the steps as failure to do so could render the routers inoperable. It is important to follow the order of the steps as failure to do so could render the routers inoperable.
  
-==== Using the command-line over SSH ====+==== Using the command line over SSH ====
  
 === The upstream access point === === The upstream access point ===
-Open a terminal and connect to this device over SSH. Make sure that this router has already been set up as a regular wireless access point and that wireless clients can connect to it fine.+Open a terminal and connect to this device over SSH. Make sure that this router has already been set up as a regular wireless access point and that wireless clients can connect to it fine. The procedure to do so is described at [[docs:guide-quick-start:basic_wifi|Enabling a Wi-Fi access point on OpenWrt]].
  
 Now, open the [[docs:guide-user:network:wifi:basic|/etc/config/wireless]] configuration file and add the following line to the ''wifi-iface'' section in use by the access point for operational network functionality: Now, open the [[docs:guide-user:network:wifi:basic|/etc/config/wireless]] configuration file and add the following line to the ''wifi-iface'' section in use by the access point for operational network functionality:
Line 36: Line 40:
 Note that there may be multiple ''wifi-iface'' sections in this file, especially if the router is a dual-band device, in which case you need to ensure that you are editing the correct section. Note that there may be multiple ''wifi-iface'' sections in this file, especially if the router is a dual-band device, in which case you need to ensure that you are editing the correct section.
  
-This is an example of the [[docs:guide-user:network:wifi:basic|/etc/config/wireless]] file on the access point device:+This is an example of the [[docs:guide-user:network:wifi:basic|/etc/config/wireless]] file on an access point for the 2.4 GHz band:
  
 /etc/config/wireless /etc/config/wireless
 <code> <code>
 config wifi-device 'radio0' config wifi-device 'radio0'
-        option type 'mac80211' + option type 'mac80211' 
-        option macaddr 'unique device MAC address here+ option path 'platform/ahb/18100000.wmac
-        option hwmode '11g+ option band '2g
-        option htmode 'HT20' + option country 'US'
-        list ht_capab 'SHORT-GI-40' +
-        list ht_capab 'DSSS_CCK-40' +
-        option txpower '27' +
-        option channel '1' +
-        option country 'CA'+
  
-config wifi-iface +config wifi-iface 'wifinet1' 
-        option device 'radio0' + option device 'radio0' 
-        option network 'lan' + option network 'lan' 
-        option ssid 'my-wireless-ssid' + option mode 'ap' 
-        option encryption 'psk2' + option ssid 'My WiFi
-        option key 'wireless-secret-password' + option encryption 'psk2' 
-        option mode 'ap+ option key 'MyWiFiPassword
-        option wds '1'+ option wds '1'
 </code> </code>
  
 Once that is done, save the file and reboot the device to apply the new network settings. Make sure that wireless clients are able to connect to this wireless access point and access the internet as well as they did with the old network configuration. Once that is done, save the file and reboot the device to apply the new network settings. Make sure that wireless clients are able to connect to this wireless access point and access the internet as well as they did with the old network configuration.
  
-The "ifconfig" command should display a new network interface whose name is in the form of: "wlan.sta**N**"; where **N** is a number. This new interface must exist alongside the base "wlan0" wireless network interface.+The ''ip address'' command should display a new network interface whose name is in the form of: "wlan.sta**N**"; where **N** is a number. This new interface must exist alongside the base "wlan**N**" wireless network interface. For example, if you get the "wlan.sta1" network interface, the base interface is "wlan1".
  
 **Note:** when tested on Barrier Breaker, there was no new interface created, neither on the AP nor on the STA, despite WDS working properly. **Note:** when tested on Barrier Breaker, there was no new interface created, neither on the AP nor on the STA, despite WDS working properly.
  
-The new wlan.staN interface will **not** be bridged by default with the originating WLAN interface if that interface is not itself part of a bridge. To correct this problem, you will need to create a new bridge interface in the wireless access point and associate only its WLAN interface to it.+**Note:** The new wlan.staN interface will **not** be bridged by default with the originating WLAN interface if that interface is not itself part of a bridge. To correct this problem, you will need to create a new bridge interface in the wireless access point and associate only its WLAN interface to it.
  
 === The repeater === === The repeater ===
-Initially, you most likely need to use an Ethernet cable to connect to the repeater device and configure it.+Initially, you might need to use an Ethernet cable to connect directly to the repeater and configure it. Open a terminal and connect to this device over SSH.
  
-There are some important settings on the repeater to take into account before creating the wireless link between the repeater and the access point. For starters, the repeater must have its DHCP server disabled (assuming there is already a different DHCP server working on the network). On fresh-installs of OpenWrt, the DHCP server is usually enabled by default, so to disable it you need to change the network settings of the repeater.+There are some important settings on the repeater to take into account before creating the wireless link between the repeater and the access point. For starters, the repeater must have its DHCP server disabled (assuming there is already a different DHCP server working on the network). On fresh-installs of OpenWrt, the DHCP server is usually enabled by default on the LAN interface, so to disable it you need to change the network settings of the repeater.
  
-Open the [[docs:guide-user:base-system:dhcp|/etc/config/dhcp]] file and add the following line to the ''config dhcp 'lan''' section:+Open the [[docs:guide-user:base-system:dhcp|/etc/config/dhcp]] file and add the following line to the ''config dhcp <nowiki>'lan'</nowiki>'' section:
 <code>option ignore '1'</code> <code>option ignore '1'</code>
  
-This line will disable the DHCP server on the LAN interface. The DHCP server should be already disabled on the WLAN interface by default, so save the file and close it.+This line will disable the DHCP server on the LAN interface. The DHCP server should be already disabled on the WLAN interface, so save and close the file.
  
-**Note:** On Chaos Calmer 15.05 / LuCI (git-15.248.30277-3836b45), the DHCP6 server had to be disabled as well, by changing+**Note:** On Chaos Calmer 15.05 / LuCI (git-15.248.30277-3836b45), the DHCP6 server had to be disabled as well, by changing ''option dhcpv6 <nowiki>'server'</nowiki>'' to ''option dhcpv6 <nowiki>'disabled'</nowiki>''.
-<code>option dhcpv6 'server'</code> +
-to+
-<code>option dhcpv6 'disabled'</code>+
  
-Now, you need to assign to the LAN interface a network address other than the default static IP assignment of 192.168.1.1/24. Open the [[docs:guide-user:base-system:basic-networking|/etc/config/network]] file and change the IP address to one from the same subnet. For example, to 192.168.1.2/24.+Now, you need to assign a network address other than the default static IP assignment of 192.168.1.1/24 to the LAN interface, if it is already being used by a different device on your network. Open the [[docs:guide-user:base-system:basic-networking|/etc/config/network]] file and change the IP address to one from the same subnet. For example, to 192.168.1.2/24. 
 +This is an example of the configuration file:
  
-Reboot the router to apply the new network settings. After the router restarts, remember to reconnect to the router via SSH on its new IP address. Keep in mind that the DHCP server is now disabled on its LAN network interface, so you might need to set a static IP address and subnet mask on the device you are using to configure the repeater.+/etc/config/network 
 +<code> 
 +config device 
 + option name 'br-lan' 
 + option type 'bridge' 
 + list ports 'eth0.1'
  
-Alternatively, you may want to configure the repeater to fetch an IP address via DHCP from the access point, but that may leave the repeater inaccessible if the WDS connection does not work and that STA router does not reach the access point with DHCP.+config interface 'lan' 
 + option device 'br-lan' 
 + option proto 'static' 
 + option ipaddr '192.168.1.2' 
 + option netmask '255.255.255.0' 
 +</code>
  
-If you want to try that: in the ''lan'' sectionremove the static IP configuration and reconfigure the interface to use DHCP. This is an example:+Alternatively, you may want to configure the repeater to fetch an IP address via DHCP from the access pointbut that may leave the repeater inaccessible if the WDS connection does not work and it becomes unable to configure its network settings with DHCP. You would need to set the interface protocol to DHCP:
  
 /etc/config/network /etc/config/network
 <code> <code>
 +config device
 + option name 'br-lan'
 + option type 'bridge'
 + list ports 'eth0.1'
 +
 config interface 'lan' config interface 'lan'
-        option ifname 'eth0+ option device 'br-lan
-        option type 'bridge' + option proto 'dhcp'
-        option proto 'dhcp'+
 </code> </code>
  
-**Note:** For the LAN interface to use a static IP addressmake sure its DHCP server is disabled. If it is set to use dynamic IP address (DHCP client), you will need to search for the repeater's IP address each time you reboot it.+Reboot the repeater to apply the new network settings. After it has restartedremember to reconnect to the repeater via SSH on its new IP address. Keep in mind that the DHCP server is now disabled on its LAN network interface, so you might need to set static IP address and subnet mask on the device you are using to configure the repeater.
  
-It is time to setup the actual wireless link. Open the [[docs:guide-user:network:wifi:basic|/etc/config/wireless]] file and make sure the wireless settings in the ''radio0'' section match the values in the same file of the access point.+**Note:** If you have set the LAN interface to use a dynamic IP address (DHCP client), you will need to search for the repeater's IP address every time you reboot it.
  
-In this file, modify the ''wifi-iface'' section to set it in "sta" (clientmode, include the desired SSID to which to connect (the one broadcasted by the access point) and ensure WDS is enabled by setting this value to 1The specific options may be different depending on the hardware but the SSIDchannel, encryption type and password must match the access point, and WDS mode must be turned on.+It is time to setup the actual wireless link. Open the [[docs:guide-user:network:wifi:basic|/etc/config/wireless]] file and make sure the corresponding settings in the ''radio**N**'' section (where **N** is a numbermatch the values in the same file of the access point. For exampleto use the same band and country code.
  
-This is an example of the [[https://openwrt.org/docs/guide-user/network/wifi/basic|/etc/config/wireless]] configuration file on the repeater.+Additionally, in this file, modify the ''wifi-iface'' section to set it in "sta" (client) mode, include the desired SSID to which to connect (the one broadcasted by the access point) and ensure WDS is enabled by setting this value to 1. The specific options may be different depending on the hardware but the SSID, channel, encryption type and password must match the access point, and WDS mode must be turned on. 
 + 
 +**If you want to enable wireless access** to the repeater and, therefore, **to the main network and the Internet**, which you might want to do if your use case is **expanding the Wi-Fi coverage on your location, an additional wireless interface (''wifi-iface'') is required in this file**. Copy over the previous wifi-iface and: 
 +  * Change the mode from ''sta'' to ''ap''
 +  * Remove the ''option wds <nowiki>'1'</nowiki>'' line. 
 + 
 +In this new Wi-Fi interface on the repeater, the SSID and the secret key may be the same as the access points to allow transparent roaming, but they can also be different. As long as you connect this new interface to the LAN network, which is the default, your other wireless devices connecting through this AP will also be seen as part of the big network. 
 + 
 +This is an example of the [[docs:guide-user:network:wifi:basic|/etc/config/wireless]] configuration file on repeater for the 2.4 GHz band.
  
 /etc/config/wireless /etc/config/wireless
 <code> <code>
 config wifi-device 'radio0' config wifi-device 'radio0'
-        option type 'mac80211' + option type 'mac80211' 
-        option macaddr 'unique device MAC address here -- NOT the same one as used in the access point configuration file+ option path 'platform/ahb/18100000.wmac
-        option hwmode '11g+ option band '2g
-        option htmode 'HT20' + option country 'US'
-        list ht_capab 'SHORT-GI-20' +
-        list ht_capab 'SHORT-GI-40' +
-        list ht_capab 'TX-STBC' +
-        list ht_capab 'RX-STBC1' +
-        list ht_capab 'DSSS_CCK-40' +
-        option txpower '27' +
-        option country 'CA' +
-        option channel '1' +
-        option disabled '0'+
  
-config wifi-iface +config wifi-iface 'wifinet1' 
-        option device 'radio0' + option device 'radio0' 
-        option network 'lan' + option network 'lan' 
-        option mode 'sta' + option mode 'sta' 
-        option wds '1' + option ssid 'My WiFi
-        option ssid 'my-wireless-ssid+ option encryption 'psk2' 
-        option encryption 'psk2' + option key 'MyWiFiPassword
-        option key 'wireless-secret-password+ option wds '1'
-</code>+
  
-See the [[docs:guide-user:network:wifi:encryption|Configure WiFi encryption]] wiki page for a reference on how to specify encryption and keys. +config wifi-iface 'wifinet2' 
- + option device 'radio0' 
-Disconnect the repeater from the wired network and reboot it.+ option network 'lan' 
 + option mode 'ap' 
 + option ssid 'My WiFi
 + option encryption 'psk2' 
 + option key 'MyWiFiPassword' 
 +</code>
  
-The repeater should boot and connect automatically to the access point wirelessly. It may take few minutes for the repeater to associate and connect to the access point. Once this has happened, the wired interface (e.g. eth0) of the repeater should succeed in getting a DHCP address through the new wireless bridge connection. The wireless interface on the repeater does not get an IP address as it is now acting as a transparent bridge.+See the [[docs:guide-user:network:wifi:encryption|Configure Wi-Fi encryption]] wiki page for reference on how to specify encryption and keys.
  
-Any client devices connected to the repeater via an Ethernet cable (wired clients) should now be transparently bridged into the main network over the wireless (WDS) link.+Disconnect the repeater from the wired network and reboot it, for example, by using its power button.
  
-**If you want to enable wireless access** to the repeater and, therefore, **to the main network and the Internet**which you might want to do if your use case is **expanding the Wi-Fi coverage on your location, an additional configuration step is required**.+The repeater should boot and connect automatically to the access point wirelessly via WDS. It may take a few minutes for the repeater to associate and connect to the access point. Once this has happenedand if you decided to enable the DHCP client on the LAN interface (dynamic address)the wired interface of the repeater should succeed in getting a DHCP address through the new wireless backhaul connection. The wireless interface on the repeater does not get an IP address as it is now acting as a transparent bridge.
  
-Create a new wireless interface. Create a new wifi-iface section in /etc/config/wireless. Copy all the values from the existing interface, but make two changes: use mode 'ap' instead of 'sta' and leave out the WDS option or set it to 0. SSID and key may be the same as with the host SSID for transparent roaming, but they can also be different. As long as you connect this new interface to lan, which is the default, your other wireless devices connecting through this AP will also be seen as part of the big network.+Any client devices connected to the repeater via an Ethernet cable (wired clients) should now be transparently connected into the main network over the wireless (WDS) link.
  
 ==== LuCI ==== ==== LuCI ====
Line 184: Line 198:
 Multiple //WDS Stations// can connect to a single //WDS Access Point//. Multiple //WDS Stations// can connect to a single //WDS Access Point//.
  
-  * On the Access Point, add ''option wds 1'' to the existing ''wifi-iface'' section and proceed with configuring SSID, channel, encryption etc. +  * On the access point, add ''option wds <nowiki>'1'</nowiki>'' to the existing ''wifi-iface'' section and proceed with configuring SSID, channel, encryption etc. 
-  * On the Client, set ''option mode'' to ''sta'and add ''option wds 1'' to the ''wifi-iface'' section. Disable the DHCP server, e.g. by adding ''option ignore 1'' for LAN interface in /etc/config/dhcp. +  * On the client, set ''option mode <nowiki>'sta'</nowiki> and add ''option wds <nowiki>'1'</nowiki>'' to the ''wifi-iface'' section. Disable the DHCP server by adding ''option ignore <nowiki>'1'</nowiki>'' for the LAN interface in /etc/config/dhcp. 
-  * To create a repeater, add a WDS Access Point along with the WDS Station on the client,(with the same ssid and key, or not). Don'forget to add the newly created AP to the LAN firewall Zone.  +  * To create a repeater, add a WDS access point along with the WDS station on the client (with the same ssid and key, or not). Do not forget to add the newly created AP to the LAN firewall Zone.  
  
-On MAC80211, OpenWrt uses 4 address (option wds 1) (with ap or sta mode) and not repeater mode. See also [[http://linuxwireless.org/en/users/Documentation/iw#Setting_up_a_WDS_peer]]+On MAC80211, OpenWrt uses 4 address (option wds 1) (with ap or sta mode) and not repeater mode.
  
  • Last modified: 2024/06/24 06:19
  • by bluewavenet