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:connect_client_wifi [2019/03/25 17:41] – Section heading levels corrected tmomasdocs:guide-user:network:wifi:connect_client_wifi [2022/08/18 04:23] – [Web interface instructions] bill888
Line 1: Line 1:
-====== Connect to client wifi network ======+====== Connect to client Wi-Fi network ====== 
 +This page will explain how to connect your OpenWrt device to another Wi-Fi network by using its own radio. Due to technical limitations, your OpenWrt device will create its own subnet (in the example below it's **192.168.2.x** while the Wi-Fi router's subnet is **192.168.1.x** ) just as it would when connected to a modem, your OpenWrt device and devices connected to it will be able to reach the Internet, but won't see devices connected to the other Wi-Fi/router).
  
-This page will explain how to connect your OpenWrt device to another wifi network by using its own radio. Due to technical limitations, your OpenWrt device will create its own subnet (in the example below it's **192.168.2.x** while the wifi router'subnet is **192.168.1.x** ) just as it would when connected to a modem, your OpenWrt device and devices connected to it will be able to reach the Internetbut won't see devices connected to the other wifi/router).+If you want to actually set up a Wi-Fi repeater or keep devices connected to this device in the same subnet as the devices connected to the other routeryou will need to follow [[docs:guide-user:network:wifi:relay_configuration| this tutorial ]] instead.
  
-If you want to actually set up a wifi repeater or keep devices connected to this device in the same subnet as the devices connected to the other router, you will need to follow [[docs:guide-user:network:wifi:relay_configuration| this tutorial ]] instead.+===== Web interface instructions =====
  
-===== Setup with Luci GUI ===== +\\  
-As said above, the **LAN** interface must be set in a different subnet than the wifi network you are connecting toIn our example the wifi network we are connecting to is using **192.168.1.x** addresses, so we will need to change the IP address of the LAN interface first to **192.168.2.1**+Refreshed with 21.02 LuCI images\\  
 +\\ 
  
 +As said above, the **LAN** interface must be set in a different subnet than the Wi-Fi network you are connecting to. In our example the Wi-Fi network we are connecting to is using **192.168.1.x** addresses, so we will need to change the IP address of the LAN interface first to **192.168.2.1**
 +
 +/*** old LEDE17 image
 {{:docs:guide-user:network:wifi:set_different_subnet_ip.png|}}\\ Set LAN as static address 192.168.2.1 Apply the setting change.\\ {{:docs:guide-user:network:wifi:set_different_subnet_ip.png|}}\\ Set LAN as static address 192.168.2.1 Apply the setting change.\\
 +***/
 +
 +\\ 
 +The **LAN** interface must be set in a different subnet than the Wi-Fi network you are connecting to.
 +
 +  * Do NOT wire the router to your main router.
 +  * Reset the router to return to default openwrt settings.
 +  * Connect a computer to a LAN port and log into LuCI web UI at 192.168.1.1.
 +  * Set **LAN protocol** as **static address** (default setting)
 +  * Assign an IP address in a **different** subnet (e.g. 192.168.2.1). Click Save.
 +  * Click **Save and Apply**.
 +
 +\\ {{media:docs:howto:relay_lan_changeip.jpg?400|}} \\ 
  
 ---- ----
 +   * Disconnect and connect again computer to the device to force change of IP address.
 +
 +\\ 
 +\\ 
 +\\ 
 +
 +We will now set up the client Wi-Fi network, the configuration needed to connect to another Wi-Fi network.\\ 
 +\\ 
 +Once you are logged into the router, 
 +   * go in the wireless networks page, and click on **Scan** button.
 +
 +/*** old LEDE17 image
 +{{:docs:guide-user:wifirepeater_joinnetwork_wifi_scan.png|}}\\ 
 +***/
 +\\ {{media:docs:howto:relay_join_wifi_1.jpg?800|}} \\
 +\\ 
 +\\ 
 +
 +   * Choose the Wi-Fi network you want to connect to from the page and click "Join Network".\\ 
  
-Disconnect and connect again to the device (when you change the IP you need to do this).+\\ {{media:docs:howto:relay_join_wifi_2.jpg?800|}} \\ 
 +\\  
 +\\ 
  
-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:guide-user:wifirepeater_joinnetwork_wifi_scan.png|}}\\ Choose the wifi network you want to connect to from the page and click "Join Network".\\  
  
 ---- ----
  
-{{:docs:guide-user:wifirepeater_joinnetwork_settings.png|}}\\ Enter the wifi password, leave the "name of new network" as "wwan" and select **wan** firewall zone. Click Save. If you have no *wan* firewall zone you need to create it, don't save the wifi configuation and see the next step.\\+/*** old LEDE17 image 
 +{{:docs:guide-user:wifirepeater_joinnetwork_settings.png|}}\\  
 +***/ 
 + 
 +   * Recommend to tick the 'Replace wireless configuration' to delete the wireless access point (Master) for the chosen radio. 
 +   Enter the wifi password. 
 +   * The firewall zone should already be set to wan/wan6 (default). 
 + 
 +\\ {{media:docs:howto:wireless_client_wifi_1.jpg?500|}} \\ 
 + 
 + 
 +   * If there is no *wan* firewall zone you need to create it, don't save the Wi-Fi configuration.  Go to bottom of this section describing how to create *wan* firewall zone. 
 +   * Enter the Wi-Fi password, leave the "name of new network" as "wwan" and select **wan** firewall zone.  
 +   Click Save.  
 +    
 +\\  
 +\\ 
  
 ---- ----
 +/*** lede17 image
 +{{:docs:guide-user:wifirepeater_clientwifi_settings.png|}}\\ 
 +***/
 +
 +You will land in the client Wi-Fi settings page.  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 value that you set on the Wi-Fi you are connecting to (to avoid bottlenecking the connection for no reason).
 +  * Do **NOT** change the wifi channel number !
 +\\  
 +\\  
 +
 +\\ {{media:docs:howto:relay_join_wifi_5.jpg?500|}} \\
 +\\ 
 +Press **Save** \\  
 +Press **Save & Apply**. \\  
 +Configuration is now complete.
 +\\ 
 +\\ 
  
-If you have no "wan" firewall zone you must create itClick on Network and then on Firewall, then click on the Add button, and set up the new zone as you see in the following screenshot (which is default wan firewall interface),\\+This is the final resultNote how the client network has ? instead of a IP address. \\   
 +The wwan IP address is only visible in the Network Interfaces page.
  
 +\\ {{media:docs:howto:relay_status_1.jpg?800|}} \\
  
-{{:docs:guide-user:network:wifi:firewall_settings.png|}}\\ Note that in "Covered networks" you will probably have "**lan**" and "**wwan**" instead of the ones shown in the screenshot. My router (used for the screenshot) has WAN ethernet ports and a default wan firewall zone already, and also I'm doing a tethering with my smartphone. If you are doing this step you probably don't have either. 
  
-After you have done this, go back and repeat the other steps to add and save the wifi connection.+\\  
 +\\  
 +\\ 
  
 ---- ----
  
-{{:docs:guide-user:wifirepeater_clientwifi_settings.png|}}\\ 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).+\\ 
  
-===== Setup with CLI =====+:!: This step should not be necessary if you had reset the router to OpenWrt defaults.  If you have no "wan" firewall zone you must create it.  
 +   * Click on Network and then on Firewall, then click on the Add button, and set up the new zone as you see in the following screenshot (which is a default wan firewall interface),\\
  
-Before doing any actual configuration, the wifi interface must be enabled in order to be able to scan for networks in the vicinity:+/*** lede17 image 
 +{{:docs:guide-user:network:wifi:firewall_settings.png|}}\\  
 +***/ 
 +\\ {{media:docs:howto:wireless_client_wan_zone.jpg?800|}} \\
  
-<code>uci set wireless.@wifi-device[0].disabled=0+/*** 
 +Note that in "Covered networks" you will probably have "**lan**" and "**wwan**" instead of the ones shown in the screenshot. My router (used for the screenshot) has WAN ethernet ports and a default wan firewall zone already, and also I'm doing a tethering with my smartphone. If you are doing this step you probably don't have either. 
 +***/ 
 + 
 +After you have done this, go back and repeat the other steps to add and save the Wi-Fi connection. 
 + 
 + 
 + 
 +===== Command-line instructions ===== 
 +Before doing any actual configuration, the Wi-Fi interface must be enabled in order to be able to scan for networks in the vicinity: 
 + 
 +<code bash> 
 +uci set wireless.@wifi-device[0].disabled="0"
 uci commit wireless uci commit wireless
-wifi</code>+wifi 
 +</code>
  
-:!: if you have more than one wifi radio in your device, then you can use the others in this tutorial instead by substituting their number. For example to enable the second wifi radio (usually a 5Ghz radio) you would need to **uci set wireless.@wifi-device[1].disabled=0** and then use **wlan1** instead of **wlan0** in the command below.+:!: if you have more than one Wi-Fi radio in your device, then you can use the others in this tutorial instead by substituting their number. For example to enable the second Wi-Fi radio (usually a 5Ghz radio) you would need to **uci set wireless.@wifi-device[1].disabled=0** and then use **wlan1** instead of **wlan0** in the command below.
  
   * Set the disabled option to 0 (to enable wireless)   * Set the disabled option to 0 (to enable wireless)
Line 49: Line 141:
   * Start wireless using the //wifi// command   * Start wireless using the //wifi// command
  
-Now we can list networks in range using ''iw dev wlan0 scan'', substituting your actual wireless interface for //wlan0// if different (''ifconfig'' lists all available interfaces to find how your wlan is called)+Now we can list networks in range substituting your actual wireless interface for ''wlan0''
 +<code bash> 
 +iw dev 
 +iw dev wlan0 scan 
 +</code>
  
-''iw dev wlan0 scan'' output example:\\ +Example output: 
- +<code bash> 
-<code>root@LEDE:/# iw dev wlan0 scan+# iw dev wlan0 scan
 BSS c8:d5:fe:c8:61:b0(on wlan0) -- associated BSS c8:d5:fe:c8:61:b0(on wlan0) -- associated
         TSF: 24324848870 usec (0d, 06:45:24)         TSF: 24324848870 usec (0d, 06:45:24)
Line 99: Line 195:
                  * Pairwise ciphers: TKIP CCMP                  * Pairwise ciphers: TKIP CCMP
                  * Authentication suites: PSK                  * Authentication suites: PSK
-                 * Capabilities: 1-PTKSA-RC 1-GTKSA-RC (0x0000) </code>+                 * Capabilities: 1-PTKSA-RC 1-GTKSA-RC (0x0000) 
 +</code>
  
-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.\\
  
-<code>network.lan.ipaddr='192.168.2.1'+<code bash> 
 +network.lan.ipaddr='192.168.2.1'
 network.wwan=interface network.wwan=interface
 network.wwan.proto='dhcp' network.wwan.proto='dhcp'
  • Last modified: 2024/12/20 08:47
  • by adelton