Setting Up OpenWRT as a WiFi Client: A Complete Guide

Turning a standard router into a wireless bridge is one of the most powerful uses of firmware. OpenWRTThe situation where it is necessary to distribute the Internet to a remote part of the home or office, where laying a cable is physically impossible, is common. Using the mode Station (client) allows a second device to receive a signal from the main router over the air and broadcast it further through LAN ports or its own access point.

Unlike stock firmware, which often offers limited functionality, OpenWRT gives you full control over network interfaces. You can configure complex routes, packet filters, or simply create a transparent bridge. The main advantage is flexibility, allowing you to adapt the device to any non-standard needs, whether it's a hotel's Wi-Fi or a summer cottage's internet connection.

However, before you begin, please note that the process requires attention to detail. Incorrect network zone configuration or IP address conflicts may result in loss of access to the device. Before making changes to the /etc/config/network file, be sure to make a backup copy of the current configuration., to be able to roll back in case of an error.

Necessary hardware and software requirements

To implement this setup, you'll need two wireless devices. The primary device will act as the access point (AP), and the router running OpenWRT will act as the client. It's crucial that the router's wireless module supports the wireless mode. StationNot all chipsets can operate in this mode, especially in the 5 GHz range.

Compatibility is checked using the hardware table on the project's official website or in the documentation for a specific chipset (Atheros, MediaTek, Broadcom). It often happens that a device can function as an access point but cannot connect to another network. Make sure the device has the latest firmware version that supports the required drivers. mac80211.

⚠️ Note: Some proprietary drivers (such as older versions for Broadcom) may not support client mode or may be unstable. Always check the support status of your specific chipset in the latest repositories, as the driver situation is constantly changing.

You'll also need a computer with a network card for the initial setup. It's best to connect via a LAN cable, as the wireless connection will be lost during the interface reconfiguration process. Make sure your PC has a static IP address on the router's subnet or is configured to obtain an address automatically.

Basic preparation and installation of packages

After successfully installing OpenWRT and accessing it for the first time via the LuCI web interface or SSH, you should ensure that you have the basic utilities. A standard, minimalist build may not include all the necessary components for working with wireless clients, especially for older versions or specific builds.

First, update your package lists to avoid dependency errors. This is a standard maintenance procedure for any Linux system. In the terminal, it looks like this:

opkg update

Next you need to install the package wpad (or its full version wpad-openssl), which is responsible for the security of WPA/WPA2 wireless connections. Without it, connecting to the secure networks of your provider or a neighbor's router will be impossible. You may also need a package kmod-cfg80211, if it is not installed by default.

☑️ Preparing the router

Completed: 0 / 4

After installing the packages, it is recommended to reboot the network services or the device itself to ensure the new kernel modules and libraries are properly initialized. Only then can you proceed with the actual wireless interface configuration.

Wireless interface configuration

Configuration is done via a file /etc/config/wirelessYou can edit it manually using a text editor. vi or nano, or use the web interface. In the section config wifi-device make sure the radio is on (option disabled'0'). Next we are interested in the section config wifi-iface.

You need to create a new configuration or modify an existing one by specifying the operating mode option mode'sta'This is a key parameter that switches the card from access point mode to client mode. You also need to specify option network'wan'so that traffic from this network goes to the external network, and enter the network name (SSID) and password.

Example configuration for connecting to a network with WPA2 encryption:

config wifi-iface

option device'radio0'

option network'wan'

option mode'sta'

option ssid'Name_Provider_Wifi'

option encryption'psk2'

option key'SuperSecretPassword'

option disabled'0'

Pay attention to the field option device. It should match the name of your radio device (often this is radio0 or radio1). If you have a dual-band router, make sure you're configuring the module that's physically capable of receiving the signal. 5 GHz modules typically have higher gain and less congestion.

Configuring network interfaces and zones

Once the wireless card is configured to receive a signal, it must be properly "associated" with the system's logical interfaces. In OpenWRT, this is accomplished by the file /etc/config/networkYou need to find the interface. wan and make sure it uses the protocol dhcp (or a static IP, if required by the provider) and is linked to the previously created WiFi interface.

The most important thing is to avoid IP address conflicts. If the main router (the one you're connecting to) has an address such as 192.168.1.1, then your OpenWRT router in client mode must have an address in a different subnet, for example, 192.168.2.1Otherwise, a routing conflict will arise and packets will not know where to go.

How to change the IP address of an OpenWRT router

To change the address, go to Network → Interfaces → LAN. In the IPv4 Address field, enter the new address, for example, 192.168.2.1. After saving, the router will reboot, and you will need to connect to the new address. Don't forget to also change the DHCP server settings so that it issues addresses from the new subnet.

You also need to check your firewall settings. The interface through which you access the internet (in our case, this is the created WiFi client mapped to the WAN) must be in the zone WAN. The LAN zone must remain in the zone LANThe Masquerading rule in the WAN zone must be enabled for your devices to access the Internet.

Diagnosing and resolving connection problems

Often, after applying the settings, the connection fails the first time. Use the utility for diagnostics. logread or the web interface System → Log. Look for messages from the daemon. hostapd or wpa_supplicantAuthentication errors will indicate an incorrect password or encryption type.

If there is a connection, but the Internet does not work, check the routing table with the command ip routeThere must be a default route (default via...) via the WAN interface. Also, make sure the DNS servers are correctly retrieved. Manually entering public DNS, such as Google's, often helps (8.8.8.8) or Cloudflare (1.1.1.1), in the WAN interface settings.

Problem Possible cause Solution method
There is no network in the list of available networks. Invalid region or channel Check your wireless country settings.
Authentication error Incorrect password or encryption type Check the key and method (psk2 vs psk)
There is a connection, but no internet No route or DNS Check the gateway and DNS in the WAN interface
Low speed Interference or 802.11b/g mode Switch to 5 GHz or change channel

Pay special attention to channel selection. In client mode, the router should scan the air. If the main router changes channels dynamically, the client will have to reconnect. It's best to lock the channel on the main access point.

📊 What was the main problem you encountered while setting it up?
Doesn't see the network
Password error
No internet after connecting
Low speed
Everything worked right away.

Speed ​​and stability optimization

To achieve maximum performance in client mode, it is important to minimize overhead. Using the protocol WPA3 It's preferable if both routers support it, as it provides better security and efficiency. However, compatibility in client mode with WPA3 may still be limited by drivers.

It's recommended to disable unnecessary services on an OpenWRT router if it's used solely as a bridge. For example, you can disable IPv6 if it's not in use, or limit logging to avoid memory overhead and CPU load. It's also worth experimenting with the channel width: 40 MHz or 80 MHz will provide a speed boost, but may be less stable in noisy environments.

Keep in mind that client mode introduces additional latency. Each packet undergoes two rounds of conversion: one received over WiFi and one transmitted further. Therefore, this setup may not be ideal for online gaming or VoIP if the signal is unstable. For video streaming or web surfing, this is generally unnoticeable.

⚠️ Important: When using client mode, the router's battery must be stable. Power surges can cause the wireless module to freeze, requiring a physical reboot of the device, as remote access will be lost.

FAQ: Frequently Asked Questions

Is it possible to broadcast and receive Wi-Fi at the same time?

Yes, this is possible, but it requires the wireless module to support interface virtualization. You'll need to create two interfaces. wifi-iface on one device radio: one in mode sta (client), another in mode ap (access point). However, this will reduce the overall channel throughput by half, since the radio operates in half-duplex.

Why doesn't the router see 5 GHz networks?

Most likely, in the settings of the wireless device (config wifi-device) The wrong region or operating mode (HT20/HT40/HE20) is selected. Some regions block certain 5 GHz channels. Try changing your country to US or DE and check the list of available networks.

How do I regain access to my router if I've lost the connection?

If you've lost WiFi access, try connecting via a LAN cable. If that doesn't work (due to a subnet change), use Failsafe mode. To do this, quickly blink the router's indicator LED when booting (usually by pressing the Reset button in the first few seconds after powering on), then connect via Telnet to 192.168.1.1 and correct the configuration settings.

Will this scheme increase internet speed?

No, the speed cannot exceed the download speed from the main router. Moreover, due to the overhead of encryption and double data transfer, the actual speed will be lower than with a direct cable connection. The purpose of this setup is to provide access in areas where cable installation is impossible.