Configuring the HotSpot router as a Wi-Fi client

In some cases it may be necessary to provide internet connectivity to the router via a wi-fi connection instead of a traditional cable connection.
Many wirless router (eg TP-Link 841N), equipped with OpenWrt firmware, can operate simultaneously as Wi-Fi client (getting internet connection) and as hotspots (supplying internet connection).

Now we configure our wireless router by following the normal procedure for configuring OpenWrt firmware.
Then we connect via browser at the web interface of the router , and after click on Network | WiFi, then click Scan.
The Wi-Fi networks available will be displayed. Click on the button "Join Network" on the right side of the network from which we want to get the internet connection.
Uncheck the "Replace the wireless configuration" option, insert the WPA password and click on "Submit". In the next window, click on "Save & Apply".

Configuring the Hotspot router as a client Wi-Fi

At this point we have to access to the router through terminal using an SSH client (eg putty.exe). Let's connect via SSH to the address and insert the username (root) and password.
To complete the procedure it's necessary to edit the file /etc/chilli/defaults (for example, using the vi editor ) by replacing the line:

HS_WANIF=`uci -P/var/state get network.wan.ifname`

with the line


Finally , restart the router with the reboot command.