Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next 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/06/22 06:34] – Retrieved all the warnings from the top of the original article richb-hanover | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Wifi Extender or Repeater | + | ====== Wireless |
| + | This article describes how to make an OpenWrt router into a Wi-Fi repeater/ | ||
| + | It makes a Wi-Fi connection to the "main router" | ||
| + | and acts as an AP (access point) for local devices with another radio. | ||
| + | The extender then relies on the '' | ||
| - | <WRAP center round important 80%> | + | For the sake of simplicity, this article |
| - | Using relayd as instructed in this article isn't guaranteed to work.\\ | + | |
| - | 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 | + | |
| - | </ | + | |
| + | This configuration is useful where you do not control the main router, | ||
| + | where the main router does not run OpenWrt, | ||
| + | or does not support preferred [[docs: | ||
| + | or [[docs: | ||
| + | You may also wish to consider using an alternate [[: | ||
| - | In this article you will see how to configure your device to become | + | There is a Youtube video that shows substantially the same procedure as described below: |
| + | https://www.youtube.com/ | ||
| - | 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 a bridge-like behavior 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 | + | The image below shows the normal configuration. |
| + | The "main router" | ||
| + | and its LAN port (192.168.1.1/ | ||
| + | The Wi-Fi extender is on the left. | ||
| + | It makes a wireless connection (labeled | ||
| + | The Wi-Fi extender' | ||
| - | {{ 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). | + | Other notes on the configuration: |
| - | 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 | + | Even though all end devices |
| + | The rest of this article uses 192.168.2.1 as the "Wi-Fi extender subnet" | ||
| - | The **LAN** | + | Since both ethernet ports and Access Point Wi-Fi network are on the same **LAN** interface, |
| - | ==== Required packages ==== | + | The **LAN** interface subnet will be used only as a " |
| - | You must install | + | |
| - | If you want to use Luci GUI to set up your wifi extender, install | + | |
| - | ==== Setup with Luci GUI ==== | + | You may use the same Wi-Fi network name (SSID) and encryption, password, etc. |
| - | As shown in the image above, the **LAN** interface must be set in a different subnet than the wifi network you are connecting | + | settings on the Wi-Fi extender as your main router. |
| + | This allows wireless devices connected to your (wider) network to roam to the best Wi-Fi network. | ||
| + | Alternatively, | ||
| + | |||
| + | This procedure has been tested with OpenWrt 23.05.3 | ||
| - | 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: | + | ===== Setup with LuCI Web GUI ===== |
| - | ---- | + | ==== Configure LAN Interface ==== |
| + | The **LAN** interface of the Wi-Fi extender must be set in a different subnet than the main router. | ||
| - | Set your PC's ethernet or wifi settings at static IP 192.168.2.10 | + | * Remove any wired connections between |
| + | * Connect a computer with Ethernet to a LAN port on the Wi-Fi extender | ||
| + | * (Optional) Update the firmware | ||
| + | * On **System -> Backup/ | ||
| + | * Go to **Network -> Interfaces**, | ||
| + | * Set **LAN protocol** to **static | ||
| + | * Assign an IP address using the "Wi-Fi extender subnet" | ||
| + | * Click **Save and Apply**. | ||
| - | 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. | + | \\ |
| - | {{docs: | + | ---- |
| + | * Reconnect to router at its new IP address (eg. 192.168.2.1) | ||
| + | * From **Network -> Interfaces**, | ||
| + | * Click the **DHCP Server** tab and disable DHCP, IPv6 RA-Service, and DHCP-v6 Service. To do this: | ||
| + | * On the **General Settings** tab, check the " | ||
| + | * On the **IPv6 Settings** tab, choose " | ||
| + | * See images below | ||
| + | * 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), | ||
| + | then connect again to the Wi-Fi extender via Ethernet. | ||
| + | |||
| + | \\ {{media: | ||
| ---- | ---- | ||
| + | \\ {{media: | ||
| - | {{docs: | + | ==== Configure Wi-Fi Interface ==== |
| - | ---- | + | To configure the Wi-Fi connection to the main router. |
| + | * Keep your PC connected to the Wi-Fi extender via Ethernet. Remove any other physical connections. | ||
| + | * Navigate to the **Network | ||
| + | * Choose a radio to connect to the main router. Typically this should be a b/g/n radio, since they have longer range than 5GHz radios | ||
| + | * Click on **Scan** button for that radio. | ||
| - | ---- | + | \\ {{media: |
| + | |||
| + | * From the list of SSIDs found in the scan, choose the Wi-Fi SSID from the main router and click **Join Network**. | ||
| - | {{docs:guide-user:wifirepeater_clientwifi_settings.png?direct& | + | \\ {{media:docs:howto:relay_join_wifi_2.jpg?800|}} \\ |
| ---- | ---- | ||
| + | |||
| + | * You'll see the " | ||
| + | * Set the "Name of new network" | ||
| + | * Enter any Wi-Fi credentials such as WPA passphrase | ||
| + | * Select **lan** firewall zone. | ||
| + | * Click **Save**. | ||
| + | * Click **Save & Apply**. | ||
| + | |||
| + | \\ {{media: | ||
| ---- | ---- | ||
| - | Go in the **Interfaces** page, we will now add the relayd interface that will join the **lan** and **wwan** interfaces.\\ | + | You will see the client Wi-Fi settings page (image below). Edit as required. |
| - | Click on **Add New Interface**. | + | 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. The extender must match the main router. | ||
| + | * Click **Save** when finished. | ||
| + | * Click **Save & Apply**. | ||
| - | {{docs:guide-user:wifirepeater_newinterface.png?direct& | + | \\ {{media:docs:howto:relay_join_wifi_5.jpg?550|}} \\ |
| + | ==== Remove redundant WAN interface and firewall zones ==== | ||
| + | |||
| + | Although | ||
| + | |||
| + | | ||
| + | * Delete both '' | ||
| + | | ||
| + | | ||
| + | | ||
| - | ---- | + | **Note:** These actions will also automatically remove any redundant firewall traffic and port forwarding rules. |
| - | {{docs:guide-user:wifirepeater_relaybridge1.png?direct& | + | \\ {{media:docs:howto:relay_wan_delete.jpg?800|}} \\ |
| - | This interface needs to have an IP address | + | \\ {{media: |
| - | ---- | + | ==== Add static IP on wwan ==== |
| + | |||
| + | It is recommended | ||
| + | This should be in the same subnet as the main router' | ||
| + | You can then manage the router using this static IP address. | ||
| + | This static IP address | ||
| - | ---- | + | * Go to **Network |
| + | * Click **Edit** for the '' | ||
| - | {{docs:guide-user:wifirepeater_relaybridge2.png?direct& | + | \\ {{media:docs:howto:relay_wwan_static_1.jpg?800|}} \\ |
| - | ---- | + | * On the **General Settings** tab, change the protocol to ' |
| + | * Enter an IP address from the main router' | ||
| - | ---- | + | \\ {{media: |
| - | After you have done this, it might be necessary | + | * On the **Advanced Settings** tab (image below) |
| + | * Set **Use custom DNS Servers** | ||
| + | * Press **Save** | ||
| + | * Press **Save & Apply** | ||
| - | {{docs:guide-user:wifirepeater_final_result.png?direct& | + | \\ {{media:docs:howto:relay_wwan_statis_3.jpg?500|}} \\ |
| + | ==== Test Connection ==== | ||
| - | ---- | + | At this point, the Wi-Fi extender should be wirelessly connected to the main router. |
| + | To verify the 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: | ||
| - | ---- | + | ==== Install relayd package ==== |
| - | :!: The following part of the configuration should not be necessary | + | * Go to **System -> Software**. |
| + | * Click **Update List** button. If the Wi-Fi extender is connected to the main router, and that is connected to the internet, a few moments later, the results | ||
| + | * Enter **luci-proto-relay** into the Filter box (image below), and click **Install**. | ||
| + | * When that completes, reboot the router from **System -> Reboot** (image below). | ||
| - | {{docs:guide-user:wifirepeater_firewall.png?direct& | + | \\ {{media:docs:howto:relay_package_1.jpg?800|}} \\ |
| - | ---- | + | \\ {{media: |
| - | ---- | + | ==== Create Relay Interface ==== |
| - | :!: if you are doing this with a device | + | Add the '' |
| + | * Go to **Network -> Interfaces** | ||
| + | * Click on **Add New Interface** (image below) | ||
| + | \\ {{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: | ||
| - | ==== Setup with CLI ==== | + | * In **Network -> Interfaces**, |
| + | * Enter the IP address assigned to the '' | ||
| + | * Select both **lan** and **wwan** in the **Relay between networks** list. | ||
| + | * Click **Save**. | ||
| + | * Click **Save & Apply**. | ||
| + | * After you have completed above steps, reboot the router. | ||
| - | Before doing any actual configuration, | + | \\ {{media:docs: |
| - | < | + | ==== Enable the AP ==== |
| + | Enable and configure the Wi-Fi extender to be an access point for local devices. | ||
| + | |||
| + | * Go to **Network -> Wireless** | ||
| + | * Click **Edit** button for any item with **Mode: Master**. (Don't edit your Client connection to the main router.) | ||
| + | * In the Interface Configuration section, configure SSID, security and other parameters of your Wi-Fi extender so it can act like an access point. | ||
| + | * If you are configuring the same radio that also serves as the client connection to the main router, ensure the **Operating frequency** matches the Client network. | ||
| + | * Click **Save** | ||
| + | * **Enable** the wireless network. | ||
| + | * You might edit/enable other radios (for example, enabling both the b/g/n and n/ | ||
| + | * Click **Save & Apply**. | ||
| + | |||
| + | ==== You're Done - More Testing ==== | ||
| + | |||
| + | After configuring the Wi-Fi extender' | ||
| + | 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 Wi-Fi extender can be managed through its static '' | ||
| + | |||
| + | 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 '' | ||
| + | |||
| + | \\ {{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 240: | ||
| '' | '' | ||
| - | < | + | < |
| + | # 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 287: | ||
| * 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 314: | ||
| 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 326: | ||
| </ | </ | ||
| - | 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 | + | ===== Troubleshooting ===== |
| + | ==== Accessing the Extender | ||
| + | If you find the Wi-Fi extender itself is only accessible from those 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 '' | ||
| + | (The alternative is tedious: It is possible to access the OpenWrt box via its '' | ||
| - | With this setup your LEDE device itself may only be accessible from those computers directly connected to the W-LAN AP, not from the ones connected to the LEDE W-LAN client only, when in the 192.168.1.0 subnet. It is however still possible to access the LEDE box via its 192.168.2.1 address, when you are in that subnet. One way of being in both subnets at the same time with a Linux client is by adding a second, a virtual network interface to / | + | ==== Check Firewall zones ==== |
| - | < | + | :!: The following part of the configuration should not be necessary (already default options or changed automatically), |
| - | iface eth0 inet dhcp | + | |
| - | gateway 192.168.1.1 | + | |
| - | auto eth0:1 | + | \\ {{media:docs:howto:relay_firewallzone_checkLAN.jpg?800|}} \\ |
| - | iface eth0:1 inet static | + | \\ |
| - | address 192.168.2.102 | + | ---- |
| - | | + | \\ {{media: |
| - | | + | |
| - | </ | + | |
| - | + | ||
| - | //[If someone can describe a solution without modifications to the client network configuration that would be appreciated!]// | + | |
| ==== Adding IPv6 support ==== | ==== Adding IPv6 support ==== | ||
| - | + | Activate IPv6 support on your Internet box, this will get you a public IPv6 prefix. We will now activate IPv6 on our Wi-Fi extender | |
| - | Activate IPv6 support on your Internet box, this will get you a public IPv6 prefix. We will now activate IPv6 on our WiFi Extender | + | |
| 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 352: | ||
| 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 359: | ||
| uci commit | uci commit | ||
| </ | </ | ||
| - | We suppose that you created a '' | + | We suppose that you created a '' |
| - | That's it. Restart '' | + | That's it. Restart '' |
| + | ==== 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. | ||
| + | |||
| + | ==== Possibly Obsolete ==== | ||
| + | |||
| + | <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 " | ||
| + | </ | ||