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/12/28 12:16] – enlarge the thumbnails brianpow | docs:guide-user:network:wifi:relay_configuration [2024/06/22 06:26] – Final editorial pass 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", | ||
| - | \\ {{ : | + | ===== Setup with LuCI Web GUI ===== |
| - | Set LAN as static address | + | ==== Configure |
| + | The **LAN** interface of the Wi-Fi extender must be set in a different subnet than the main router. | ||
| + | |||
| + | * Remove any wired connections between your Wi-Fi extender and your main router. | ||
| + | * 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) | ||
| + | * (Optional) Update the firmware of the Wi-Fi extender to the current release. | ||
| + | * On **System -> Backup/ | ||
| + | * Go to **Network -> Interfaces**, | ||
| + | * Set **LAN protocol** to **static address**, click **Change protocol** | ||
| + | * Assign an IP address using the "Wi-Fi extender subnet" | ||
| + | * Click **Save and Apply**. | ||
| + | |||
| + | \\ {{media: | ||
| ---- | ---- | ||
| - | Set your PC's ethernet or wifi settings | + | * Reconnect to router |
| + | * From **Network -> Interfaces**, click **Edit** for the LAN interface | ||
| + | * 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' | ||
| + | (e.g., 192.168.2.10) and default gateway (e.g., | ||
| + | then connect again to the Wi-Fi extender via Ethernet. | ||
| + | |||
| + | \\ {{media: | ||
| + | ---- | ||
| + | \\ {{media: | ||
| - | 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.\\ | + | ==== Configure Wi-Fi Interface ==== |
| - | \\ {{ :docs:guide-user: | + | 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 -> Wireless** page | ||
| + | * 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. | ||
| - | Choose | + | \\ {{media: |
| + | |||
| + | * From the list of SSIDs found in the scan, choose the Wi-Fi SSID from the main router | ||
| + | |||
| + | \\ {{media: | ||
| ---- | ---- | ||
| - | \\ {{ :docs:guide-user: | + | * 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**. | ||
| - | Enter the wifi password, leave the "name of new network" | + | \\ {{media: |
| ---- | ---- | ||
| - | ---- | + | You will see the client Wi-Fi settings page (image below). Edit as required. |
| + | 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_clientwifi_settings.png |}} \\ | + | \\ {{media:docs:howto:relay_join_wifi_5.jpg?550|}} \\ |
| + | ==== 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 -> Interfaces** (image below) | ||
| + | * Delete both '' | ||
| + | * Go to **Network > Firewall** (image below) | ||
| + | * Delete the '' | ||
| + | * Click **Save & Apply** | ||
| - | You will land in the client wifi settings page, set other things as needed.\\ The most important settings are on the **Operating Frequency** line.\\ Set the **Mode** to **Legacy** if you are connecting to a wifi g network (like in my example) or **N** if you are connecting to a wifi n (and so on).\\ Set the **Width** to the same value that you set on the wifi you are connecting to (to avoid bottlenecking the connection for no reason). | + | **Note:** These actions will also automatically remove any redundant firewall traffic |
| - | ---- | + | \\ {{media: |
| - | ---- | + | \\ {{media: |
| + | ==== Add static IP on wwan ==== | ||
| + | |||
| + | It is recommended to assign a static IP address to newly created wwan interface. | ||
| + | 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 will also be used later when creating the Relay interface. | ||
| - | Go in the **Interfaces** | + | * Go to **Network -> Interfaces** |
| - | Click on **Add New Interface**.\\ | + | |
| - | \\ {{ :docs:guide-user:wifirepeater_newinterface.png |}} \\ | + | \\ {{media:docs:howto:relay_wwan_static_1.jpg?800|}} \\ |
| - | Write a name for it (**repeater_bridge** is the name I used in the example), and then choose **Relay bridge** in the **Protocol | + | |
| + | * Enter an IP address from the main router' | ||
| - | ---- | + | \\ {{media: |
| - | \\ {{ : | + | * On the **Advanced Settings** tab (image below) |
| + | * Set **Use custom DNS Servers** to the IP address of the main router (e.g., 192.168.1.1). | ||
| + | * Press **Save** | ||
| + | * Press **Save & Apply** | ||
| - | In this new interface' | + | \\ {{media: |
| + | ==== Test Connection ==== | ||
| - | This interface needs to have an IP address from 192.168.1.0/ | + | At this point, |
| - | ---- | + | 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 ==== |
| - | \\ {{ :docs:guide-user: | + | * Go to **System |
| - | Move to the Firewall tab of this interface settings page and select | + | * Click **Update List** button. If the Wi-Fi extender is connected |
| + | * Enter **luci-proto-relay** into the Filter box (image below), | ||
| + | | ||
| - | ---- | + | \\ {{media: |
| - | ---- | + | \\ {{media: |
| - | After you have done this, it might be necessary to reboot the wifi extender. | + | ==== Create Relay Interface ==== |
| - | \\ {{ :docs:guide-user: | + | Add the '' |
| + | * Go to **Network | ||
| + | * Click on **Add New Interface** (image below) | ||
| - | This is the final result. Note how the client network has a ? instead of a IP address. | + | \\ {{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: |
| - | ---- | + | * In **Network |
| + | * 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. | ||
| - | :!: The following part of the configuration should not be necessary (already default options or changed automatically), | + | \\ {{media:docs:howto: |
| - | \\ {{ : | + | ==== Enable the AP ==== |
| - | Under the **Network** tab, click on the **Firewall** tab. Under **Zones**, change the forwarding for **lan** and **wwan** to **accept** | + | Enable and configure |
| - | ---- | + | * Go to **Network |
| + | * 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 ==== |
| - | :!: 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. | + | After configuring |
| + | and connect to the newly-configured Wi-Fi. | ||
| + | Your computer should | ||
| + | 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 ==== | + | ===== Setup with CLI ===== |
| - | Before doing any actual configuration, | + | 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 129: | 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 175: | 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 200: | 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 212: | 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 242: | 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 249: | Line 359: | ||
| uci commit | uci commit | ||
| </ | </ | ||
| - | We suppose that you created a '' | + | We suppose that you created a '' |
| + | |||
| + | 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) | ||
| - | That's it. Restart '' | + | Setup with WebUI: |
| + | * Go in the Network -> Interfaces | ||
| + | * 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" as " | ||
| + | * Go in the Network | ||
| + | * 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. | ||