OpenWRT is a special operating system designed for installation on small devices with a limited set of characteristics. For example, routers.
System Information
The OpenWRT operating system, like almost everyone else, is based on the Linux kernel. For management, a command line mechanism or a shell for the graphical interface are used. The system has its own repository from which you can install packages using opkg.
Of the features we can highlight the use of the JFFS2 file system. This allows you to use the OpenWRT OS in a wide variety of devices.
The basic firmware has a limited set of functions, which can be expanded by installing the necessary packages. Using the system in routers is possible thanks to the support of various data transfer methods. For example, such:
- Static IP.
- DHCP Client.
- PPTP
- PPPoE
Configure OpenWRT
Many firmware do not support the out-of-box graphical interface. And that means you need to install it. But until then you have to use the command line.
This will help ssh. In order to connect to the router on the OpenWRT operating system, you need to type the command in the terminal: ssh root@192.168.1.1.
While there is no password in the system, therefore, the router will let the user go, and so on. This means that after entering you need to create it immediately. To do this, there is a command: passwd - the desired password.
Now you need to connect the Internet, which, by the way, is also missing. All actions will occur on the command line. To configure, you need to edit the file at the address: etc / config / network . You can edit using the vi text editor. For PPPoE, it will be sufficient to indicate in it the username and password provided by the provider.
After saving the file, you need to restart the network. This is done as follows:
/etc/init.d/network reload
Now the network should appear, and you can finally download and install a convenient graphical interface. To do this, use the opkg package mechanism:
- opkg update;
- opkg install luci.
Now you need to start the web server:
- /etc/init.d/uhttpd start;
- /etc/init.d/uhttpd enable.
After all the manipulations, the router settings will be available at the same address from the browser.
Inside the admin panel
After entering the standard IP address in the address bar, an authorization window will open in which you need to specify the username and previously created password. The interface is a set of tabs with fields for settings.
You can change or configure the network on the Network tab. It lists the available interfaces, among which it is easy to find LAN and WAN. The second one also provides communication with the provider. You can edit it by clicking the Edit button.
Wifi
Setting up an OpenWRT Wi-Fi network is not much different from other devices and firmware. This operation is also carried out through the Network tab. It has a Wifi sublay.
To create a new network, use the Add button, and to edit an existing network - Edit. In any case, the settings are the same.
In the General Setup section, the network name is set in the ESSID field. This name will be displayed in the list of networks available for connection via any Wi-Fi device.
The Wireless Security section contains security settings. In particular, you can set the authentication method and password for the connection. Other parameters are optional. WiFi settings in OpenWRT can be considered installed.
Additional settings
For more convenient use by Russian-speaking users, the OpenWRT settings in Luci can be localized. This is done using the Software tool built into the firmware, located on the System tab. Here the Update Lists button is of interest. On the Available packages tab, a list of packages available for installation will be presented. Among them you can find Luci-i18n-russian. This is the crack for the settings of OpenWRT in Luci. The Install button will be located on the left, with which the package is installed on the system.
After a successful installation, you need to activate the Russian language. You can do this on the System tab and the sub-tab of the same name. Here you need to find the Language and Style section. It contains a list of installed languages, among which you must select Russian and click Save and Apply.
It is sometimes useful to reset OpenWRT. This may be necessary after unsuccessful experiments with firmware or other software. There is no standard solution for this in OpenWRT. Therefore, you will have to perform all operations through the command line. It is necessary to execute several commands:
rm -rf / overlay / *
sync
reboot
What's going on here? In fact, the root of the file system is a virtual image, divided into two parts. One of them is used only for reading. The second is in read and write mode. It is it that needs to be formatted, which is performed using the presented commands.
OpenWRT router and 3g modem
Sometimes routers have the ability to connect 3G devices to access the Internet. Setting up a 3G modem in OpenWRT is not as difficult as it might seem.
To do this, go to the admin panel of the router. Then the modem is connected. In the “Network” tab in the list of interfaces there is a button “Add a new interface”.
Next, you will need to specify a new name. You can use latin characters as available characters. The applicable protocol is 4G / 3G, modem is NCM. And the interface is wwan0. After specifying all the settings, click "Apply."
Now it remains to tackle the configuration of the interface itself. For this, the device is indicated. If there is only one modem, then you need to choose with a USB0 value. The APN access point field is indicated by the operator.
In the advanced settings of the OpenWRT router, you need to select the MTU packet size, the modem response initialization time, and many other subtle settings that can be useful in case of unstable router operation.
Basically, the listed settings should be enough to start and work the Internet from a router. If something went wrong, that means you need to look for additional information about a particular device and set the parameters in accordance with the recommended ones.