Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docs:guide-user:network:wifi:relay_configuration [2018/11/14 14:27] – moved to infobox, added link to source, added inter-wiki links bobafetthotmail | docs:guide-user:network:wifi:relay_configuration [2024/08/31 18:25] (current) – skip redirect richardkiss | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Wifi Extender | + | ====== Wi-Fi Extender/Repeater |
| + | This article describes how to make an OpenWrt router into a Wi-Fi extender/ | ||
| + | The extender makes an " | ||
| + | and acts as an AP (access point) for local devices with its other radio(s). | ||
| + | The extender then relies on the '' | ||
| - | <WRAP center round important 80%> | + | For simplicity, |
| - | Using relayd as instructed in this article | + | |
| - | The most common problem is that the client router cannot pass the DHCP message between the main router and the client connected to the client router. Currently it seems to be the hardware/ | + | |
| - | You may also consider to use [[docs: | + | |
| - | Instead of relayd it should be possible to use **kmod-trelay**, | + | |
| - | </ | + | |
| + | Use this configuration in situations when you do not control the main router, | ||
| + | or the main router does not run OpenWrt, | ||
| + | or the main router does not support the preferred | ||
| + | [[: | ||
| + | or [[docs: | ||
| - | In this article you will see how to configure your device to become | + | The image below shows the normal configuration. |
| + | The **main router** is on the right: | ||
| + | its LAN port (192.168.1.1/ | ||
| + | while its WAN port (not shown) connects | ||
| + | The **Wi-Fi extender** is on the left. | ||
| + | It makes a wireless uplink connection (labeled "W-LAN (Client)" | ||
| + | The Wi-Fi extender' | ||
| - | Since opensource wireless drivers used in LEDE do not support bridging in client mode, the traffic between LAN and the wireless client must be joined by routing it.\\ The **relayd** package implements | + | There is a Youtube video that shows substantially this procedure: |
| + | https:// | ||
| + | which has been tested | ||
| - | {{ docs: | + | \\ {{ docs: |
| - | This image shows an example setup. **LAN** interface of the wifi extender device MUST be on a different subnet for relayd to work (since it is routing traffic, it expects 2 different subnets). | + | ===== Setup with LuCI Web GUI ===== |
| - | Since both ethernet ports and Access Point WiFi network are on the same **LAN** interface, all clients connecting to the Ethernet ports and to the Access Point Wifi network of the WiFi extender device will be routed by **relayd** and will be connected to your main network. | + | ==== Configure |
| - | The **LAN** interface subnet will be used only as a " | + | This article assumes |
| + | and the "Wi-Fi extender | ||
| + | These subnets MUST be different. | ||
| - | ==== Required packages ==== | + | * Remove any wired connections between the Wi-Fi extender and the main router. |
| - | You must install | + | * Connect a computer with Ethernet to a LAN port on the Wi-Fi extender and log into LuCI web UI at 192.168.1.1 (default address) |
| - | If you want to use Luci GUI to set up your wifi extender, install | + | |
| + | | ||
| + | * Go to **Network -> Interfaces**, | ||
| + | * Set **LAN protocol** | ||
| + | * Assign an IP address using the "Wi-Fi extender subnet" | ||
| + | * Click **Save** | ||
| + | * Click **Save and Apply** | ||
| - | ==== Setup with Luci GUI ==== | + | \\ {{media: |
| - | As shown in the image above, the **LAN** interface must be set in a different subnet than the wifi network you are connecting to. | + | |
| - | Begin by configuring and enabling the normal WiFi network and configure it as you want it.\\ | + | ---- |
| - | If you are making a simple WiFi Repeater (a device that extends the same wifi network' | + | |
| - | But you can also choose to have a different name/ | + | |
| - | Setting up a WiFi network at this stage is not necessary if you want a "WiFi bridge", | + | |
| - | {{docs: | + | * Reconnect to the extender at its new IP address |
| + | * From **Network -> Interfaces**, | ||
| + | * Click the **DHCP Server** tab and disable DHCP, IPv6 RA-Service, and DHCP-v6 Service. To do this: | ||
| + | * On the **General Setup** tab (image below), check the " | ||
| + | * On the **IPv6 Settings** tab (image below), choose " | ||
| + | * Click **Save**. | ||
| + | * Click **Save and Apply**. | ||
| + | * Finally, set your **PC's Ethernet port** to use a static IP in the Wi-Fi extender subnet (e.g., 192.168.2.10) and default gateway (e.g., 192.168.2.1), | ||
| + | |||
| + | \\ {{media: | ||
| + | ---- | ||
| + | \\ {{media: | ||
| - | ---- | + | ==== Configure Wi-Fi Uplink ==== |
| - | Set your PC's ethernet or wifi settings at static IP 192.168.2.10 and default gateway 192.168.2.1, | + | The extender typically will have multiple radios that could serve as the uplink. |
| + | Choose one that works best for your environment. | ||
| + | 5GHz (n/ac/ax) radios have higher transmit speeds, but 2.4GHz (b/g/n) radios have longer range. | ||
| + | * Keep your PC connected | ||
| + | * Navigate to the **Network -> Wireless** page | ||
| + | * Choose | ||
| + | * Click on **Scan** button for that radio. | ||
| - | We will now set up the client wifi network, the configuration needed to connect to another wifi network.\\ Once you are connected again to the wifi extender, go in the wireless networks page, and click on **Scan** button. | + | \\ {{media: |
| + | |||
| + | * From the list of SSIDs found in the scan, choose the main router' | ||
| - | {{docs:guide-user:wifirepeater_joinnetwork_wifi_scan.png?direct& | + | \\ {{media:docs:howto:relay_join_wifi_2.jpg?800|}} \\ |
| ---- | ---- | ||
| - | {{docs: | + | * You'll see the " |
| + | * Set the "Name of new network" | ||
| + | * Enter any Wi-Fi credentials such as WPA passphrase | ||
| + | * Select | ||
| + | * Click **Save**. | ||
| + | * Click **Save & Apply**. | ||
| - | ---- | + | \\ {{media: |
| ---- | ---- | ||
| - | {{docs: | + | You will see the client |
| + | The most important settings are on the **Operating Frequency** line. | ||
| + | |||
| + | * Set the **Mode** to **Legacy** if you are connecting to a Wi-Fi g network, or **N** if you are connecting to a Wi-Fi n (and so on).\\ | ||
| + | * Set the **Width** to the same channel width as the main router | ||
| + | * Keep the same Wi-Fi channel number as was discovered during the scan. This will match the main router. | ||
| + | * Click **Save** when finished. | ||
| + | * Click **Save & Apply**. | ||
| - | ---- | + | \\ {{media: |
| + | ==== Remove redundant WAN interface and firewall zones ==== | ||
| + | |||
| + | Although it's optional, it is recommended to delete the redundant WAN interfaces and firewall zones. | ||
| + | |||
| + | * Go to **Network | ||
| + | * Delete both '' | ||
| + | * Go to **Network > Firewall** (image below) | ||
| + | * Delete the '' | ||
| + | * Click **Save & Apply** | ||
| - | ---- | + | **Note:** These actions will also automatically remove any redundant firewall traffic and port forwarding rules. |
| - | Go in the **Interfaces** page, we will now add the relayd interface that will join the **lan** and **wwan** interfaces.\\ | + | \\ {{media: |
| - | Click on **Add New Interface**. | + | |
| - | {{docs:guide-user:wifirepeater_newinterface.png?direct& | + | \\ {{media:docs:howto:relay_firewall_delete_wan.jpg?800|}} \\ |
| + | ==== Add static IP on '' | ||
| + | |||
| + | Assign | ||
| + | that is in the same subnet as the main router' | ||
| + | You can then manage | ||
| + | that will also be used later when creating | ||
| - | ---- | + | * Go to **Network |
| + | * Click **Edit** for the '' | ||
| - | {{docs:guide-user:wifirepeater_relaybridge1.png?direct& | + | \\ {{media:docs:howto:relay_wwan_static_1.jpg?800|}} \\ |
| - | This interface needs to have an IP address from 192.168.1.0/24 zone otherwise this bridge will not be accessible from the clients connected directly to the primary router. | + | * On the **General Settings** tab, change the protocol |
| - | ---- | + | * Enter an IP address from the main router' |
| - | ---- | + | \\ {{media: |
| - | {{docs: | + | * On the **Advanced Settings** |
| + | | ||
| + | * Press **Save** | ||
| + | * Press **Save & Apply** | ||
| - | ---- | + | \\ {{media: |
| + | ==== Test Connection ==== | ||
| - | ---- | + | At this point, the Wi-Fi extender should be wirelessly connected to the main router. |
| + | To verify the connection: | ||
| + | * Go to **Network | ||
| + | * Perform a ping test by clicking the "IPv4 Ping" button. | ||
| + | * A few moments later, you should see ping results if the main router is connected to the internet. | ||
| + | * | ||
| + | \\ {{media: | ||
| - | After you have done this, it might be necessary to reboot the wifi extender. | + | ==== Install relayd package ==== |
| - | {{docs: | + | * Go to **System |
| + | * Click **Update List** button. If the Wi-Fi extender | ||
| + | * Enter **luci-proto-relay** into the Filter box (image below), and click **Install**. | ||
| + | * When that completes, reboot the router from **System -> Reboot** (image below). | ||
| - | ---- | + | \\ {{media: |
| - | ---- | + | \\ {{media: |
| - | :!: The following part of the configuration should not be necessary (already default options or changed automatically), | + | ==== Add Relay Interface ==== |
| - | {{docs: | + | Add the '' |
| + | extender' | ||
| + | | ||
| + | | ||
| - | ---- | + | \\ {{media: |
| + | * In the **Add new interface** window (image below) | ||
| + | * Enter a name (" | ||
| + | * Select **Relay bridge** protocol as shown below. (Reboot your device if the **Relay bridge** option fails to appears.) | ||
| + | * Click **Create Interface** | ||
| - | ---- | + | \\ {{media: |
| - | :!: if you are doing this with a device that has a single radio, both wifi networks will stay on the same channel, and total bandwith will be halved as the same radio is used for 2 different wifi networks. | + | * In **Network -> Interfaces**, click **Edit** for the new " |
| + | * Ensure that the **Protocol** | ||
| + | * Enter the IP address assigned to the '' | ||
| + | * Select both **lan** and **wwan** in the **Relay between | ||
| + | * Click **Save**. | ||
| + | * Click **Save & Apply**. | ||
| + | * After you have completed above steps, **reboot** the router. | ||
| + | \\ {{media: | ||
| + | ==== Enable the AP ==== | ||
| + | Enable and configure the Wi-Fi extender to be an access point for local devices. | ||
| - | ==== Setup with CLI ==== | + | You may use the same Wi-Fi network name (SSID) and encryption, password, etc. |
| + | settings as your main router. | ||
| + | This allows wireless devices to roam to the best Wi-Fi network. | ||
| + | Alternatively, | ||
| + | SSID/ | ||
| - | Before doing any actual configuration, | + | * Go to **Network -> Wireless** |
| + | * Click **Edit** button for any **SSID** with " | ||
| + | * In the **Interface Configuration** section, configure SSID, security and other parameters so the Wi-Fi extender can act like an access point. | ||
| + | * If you are configuring the radio that also serves as the uplink connection, ensure the **Operating frequency** remains the same. | ||
| + | * Click **Save** | ||
| + | * **Enable** that wireless network. | ||
| + | * You may edit/enable other radios (for example, enabling both the b/g/n and n/ | ||
| + | * Click **Save & Apply**. | ||
| - | < | + | ==== You're Done! More Testing ==== |
| + | |||
| + | You're done! The Wi-Fi extender should be extending the network from your main router. | ||
| + | Change your computer back to DHCP client mode | ||
| + | and connect to the newly-configured Wi-Fi. | ||
| + | Your computer should be fully on the internet, having acquired a DHCP IP address from your main router. | ||
| + | |||
| + | The **Status -> Overview** window (image below) shows the final result. | ||
| + | '' | ||
| + | The client Wi-Fi has a ? in the **Host** column instead of a IP address | ||
| + | because its '' | ||
| + | In the image below,'' | ||
| + | But it would show the SSID that you configured for the extender. | ||
| + | |||
| + | \\ {{media: | ||
| + | |||
| + | ===== Setup with CLI ===== | ||
| + | |||
| + | Before doing any actual configuration, | ||
| + | |||
| + | < | ||
| + | uci set wireless.@wifi-device[0].disabled="0" | ||
| uci commit wireless | uci commit wireless | ||
| - | wifi</ | + | wifi |
| + | </ | ||
| * Set the disabled option to 0 (to enable wireless) | * Set the disabled option to 0 (to enable wireless) | ||
| Line 113: | Line 237: | ||
| '' | '' | ||
| - | < | + | < |
| + | # iw dev wlan0 scan | ||
| BSS c8: | BSS c8: | ||
| TSF: 24324848870 usec (0d, 06:45:24) | TSF: 24324848870 usec (0d, 06:45:24) | ||
| Line 159: | Line 284: | ||
| * Pairwise ciphers: TKIP CCMP | * Pairwise ciphers: TKIP CCMP | ||
| * Authentication suites: PSK | * Authentication suites: PSK | ||
| - | * Capabilities: | + | * Capabilities: |
| + | </ | ||
| - | In the example, there are two networks, a Wifi g one called Violetta and a Wifi n one called GOinternet_EB20FB. | + | In the example, there are two networks, a Wi-Fi g one called Violetta and a Wi-Fi n one called GOinternet_EB20FB. |
| The device was configured to connect to the one called Violetta. | The device was configured to connect to the one called Violetta. | ||
| These are the uci values that were added or changed by the configuration procedure.\\ | These are the uci values that were added or changed by the configuration procedure.\\ | ||
| - | For SSID, BSSID, and encryption you must use the info you got from the wifi scan above.\\ | + | For SSID, BSSID, and encryption you must use the info you got from the Wi-Fi scan above.\\ |
| For an explanation of why these values were changed, please read the luci tutorial above.\\ | For an explanation of why these values were changed, please read the luci tutorial above.\\ | ||
| - | < | + | < |
| + | network.lan.ipaddr=' | ||
| network.repeater_bridge=interface | network.repeater_bridge=interface | ||
| network.repeater_bridge.proto=' | network.repeater_bridge.proto=' | ||
| Line 184: | Line 311: | ||
| wireless.@wifi-iface[0].mode=' | wireless.@wifi-iface[0].mode=' | ||
| wireless.@wifi-iface[0].encryption=' | wireless.@wifi-iface[0].encryption=' | ||
| - | wireless.@wifi-iface[0].ssid=' | + | wireless.@wifi-iface[0].ssid=' |
| wireless.@wifi-iface[0].network=' | wireless.@wifi-iface[0].network=' | ||
| wireless.@wifi-iface[1]=wifi-iface | wireless.@wifi-iface[1]=wifi-iface | ||
| Line 196: | Line 323: | ||
| </ | </ | ||
| - | Please note that the wifi network generated by the device in this example (the one called | + | Please note that the Wi-Fi network generated by the device in this example (the one called |
| This was done because the focus of this article was getting the relay bridge up and running.\\ | This was done because the focus of this article was getting the relay bridge up and running.\\ | ||
| - | You will likely want to set up your device' | + | You will likely want to set up your device' |
| - | ==== Accessing the LEDE device | + | ===== Networking Details ===== |
| - | With this setup your LEDE device itself may only be accessible from those computers directly connected | + | As an alternative |
| + | [[: | ||
| + | if a bridged network is not required. | ||
| + | The Wi-Fi extender can be managed through its static '' | ||
| - | < | + | Even though all end devices on the Wi-Fi extender will get a DHCP address from the main router' |
| - | iface eth0 inet dhcp | + | |
| - | gateway 192.168.1.1 | + | |
| - | auto eth0:1 | + | Since both ethernet ports and Access Point Wi-Fi network are on the same **LAN** interface, all clients connecting to the Ethernet ports and to the Access Point Wi-Fi network of the Wi-Fi extender device will be routed by **relayd** and will be connected to your main network. |
| - | iface eth0:1 inet static | + | |
| - | address 192.168.2.102 | + | |
| - | netmask 255.255.255.0 | + | |
| - | broadcast 192.168.2.255 | + | |
| - | </ | + | |
| - | //[If someone can describe | + | The **LAN** interface subnet will be used only as a " |
| - | ==== Adding IPv6 support | + | ===== Troubleshooting |
| + | ==== Accessing the Extender ==== | ||
| + | If you find the Wi-Fi extender itself is only accessible from computers | ||
| + | directly connected to the W-LAN AP, not from the ones connected to the OpenWrt W-LAN client, | ||
| + | when in the 192.168.1.0 subnet, make sure the '' | ||
| + | in the '' | ||
| + | (The alternative is tedious: It is possible to access the OpenWrt box via | ||
| + | its '' | ||
| - | Activate IPv6 support on your Internet box, this will get you a public IPv6 prefix. | + | ==== Check Firewall zones ==== |
| + | |||
| + | :!: The following part of the configuration should not be necessary. | ||
| + | The default operations should have changed them automatically. | ||
| + | In case something isn't working, check this too. | ||
| + | |||
| + | \\ {{media: | ||
| + | \\ | ||
| + | ---- | ||
| + | \\ {{media: | ||
| + | |||
| + | ==== Adding IPv6 support ==== | ||
| + | Activate IPv6 support on your main router to get you a public IPv6 prefix. | ||
| + | Activate | ||
| + | [[https:// | ||
| + | of your public IPv6 addresses and IPv6 traffic. | ||
| 1. Go to Network / Interfaces and create a new interface. Name it '' | 1. Go to Network / Interfaces and create a new interface. Name it '' | ||
| Line 226: | Line 371: | ||
| 3. Open a SSH session on your OpenWrt device. Issue the following commands:\\ | 3. Open a SSH session on your OpenWrt device. Issue the following commands:\\ | ||
| - | < | + | < |
| uci set dhcp.wan.interface=wwan | uci set dhcp.wan.interface=wwan | ||
| uci set dhcp.wan.ra=relay | uci set dhcp.wan.ra=relay | ||
| Line 233: | Line 378: | ||
| uci commit | uci commit | ||
| </ | </ | ||
| - | We suppose | + | We assume |
| + | as suggested earlier in this guide. | ||
| + | If not, change the '' | ||
| - | That's it. Restart '' | + | That's it. Restart '' |
| + | and your IPv6-network should begin to configure itself. | ||
| + | Connected IPv6-enabled devices should get their public IPv6 addresses, | ||
| + | derived from your public IPv6 prefix, and IPv6 traffic should go through your Wi-Fi extender. | ||
| + | ==== Known Issues ==== | ||
| + | |||
| + | Here are a list of some recently reported issues: | ||
| + | |||
| + | - DHCP issue caused by Access Point. [[https:// | ||
| + | - Extremely poor upstream transfer speeds with some MT762x devices. [[https:// | ||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | - Additional instruction for backdoor to router since once dhcp is disabled on LAN, the router become unreachable. | ||
| + | - Connect a computer using ethernet cable to LAN port of the Wifi bridge. | ||
| + | - Configure a static IP address on the computer. eg. if the Wifi bridge uses LAN IP address of 192.168.2.1 in above example, use static IP address: 192.168.2.10. | ||
| + | - Access LuCI at 192.168.2.1 for above example. | ||
| + | - [[https:// | ||
| + | - Alternative detailed Relayd setup instructions can also be found in section 9.10 of the [[https:// | ||
| + | - IPv6 on macOS 10.15+ does not work with a ULA prefix set on LAN [[https:// | ||
| + | |||
| + | ==== Using NAT ==== | ||
| + | |||
| + | **<color # | ||
| + | \\ | ||
| + | \\ | ||
| + | |||
| + | This method basically puts a second Wi-Fi router in cascade on the first one; i.e. usually this means that the extender' | ||
| + | |||
| + | It's like connecting with a cable the WAN port on the Wi-Fi extender to the LAN ports of the main router, the Wi-Fi extender creates a new network for itself and the devices connected to it, that can go on the Internet and reach devices in the LAN network of the main router. But in this case we are doing it with wireless networks instead. | ||
| + | |||
| + | prerequisites: | ||
| + | - router with two initial interfaces (LAN, WAN) | ||
| + | |||
| + | Setup with WebUI: | ||
| + | * Go in the Network -> Interfaces page, click on edit lan interface, | ||
| + | * Set LAN as static IPv4 address as 192.168.x.1 (with x different from the network to which you will connect via Wi-Fi), | ||
| + | * Go in the Network -> Wi-Fi, click on scan and choose the " | ||
| + | * Enter the Wi-Fi password, leave the "name of new network" | ||
| + | * Go in the Network -> Interfaces page, click on edit wwan interface, | ||
| + | * Move to the Firewall tab. Click on Save and Apply. | ||
| + | * Go in the Network -> Firewall, click edit in wan zone and check WAN and WWAN in " | ||
| + | |||
| + | Now you've correctly bounded WWAN with WAN, and consequently WWAN with LAN. | ||
| + | |||
| + | ==== Potentially Obsolete ==== | ||
| + | |||
| + | //This section collects all the uncertain statements and provisos from earlier in this document. | ||
| + | Any that are still valid should be moved to the relevant section.// | ||
| + | |||
| + | <WRAP center round important 90%> | ||
| + | Using relayd as instructed in this article isn't guaranteed to work with all Openwrt compatible devices or wifi networks - use only as a last resort. | ||
| + | |||
| + | |||
| + | If supported by both devices, consider using preferred [[docs: | ||
| + | |||
| + | If vlan support is required you can use Layer 2 GRE tunnels (" | ||
| + | |||
| + | |||
| + | The most common problem is that the client router cannot pass the DHCP message between the main router and the client connected to the client router. Currently it seems to be the hardware/ | ||
| + | |||
| + | Instead of relayd it should be possible to use **kmod-trelay**, | ||
| + | |||
| + | In this article you will see how to configure your device to become a Wi-Fi extender/ | ||
| + | |||
| + | In some cases, the wireless drivers used in OpenWrt do not support "Layer 2" bridging in client mode with a specific " | ||
| + | |||
| + | When other options don't work, the **relayd** package implements a bridge-like behavior for IPv4 (only), complete with DHCP and broadcast relaying. This configuration can be done through SSH (remote terminal) or through Luci GUI. | ||
| + | |||
| + | /*** | ||
| + | For the sake of simplicity, I'll call the device we are working on "Wi-Fi extender" | ||
| + | ***/ | ||
| + | |||
| + | This image shows an example setup. **LAN** interface of the relayd device MUST be on a different subnet for relayd to work (since it is routing traffic, it expects 2 different subnets). | ||
| + | |||
| + | Since both ethernet ports and Access Point Wi-Fi network are on the same **LAN** interface, all clients connecting to the Ethernet ports and to the Access Point Wi-Fi network of the Wi-Fi extender device will be routed by **relayd** and will be connected to your main network. | ||
| + | |||
| + | The **LAN** interface subnet will be used only as a " | ||
| + | </ | ||