📜 ⬆️ ⬇️

Reliable communication when using the Yota Street modem

In a country house, I also want to have high-quality and fast Internet access.

Unfortunately, wired Internet in the country is not always possible due to the absence of wires (telephone and / or network from an Internet provider). And even if there are telephone wires in the house and ADSL equipment installed on the PBX, the state of the “last mile” is such that data transfer using ADSL technology is impossible (or possible at such low speeds that the ADSL provider is not at all interesting).

In this situation, wireless Internet access comes to the rescue.
')
But with him, everything is not so simple, as it should be.

Some time ago, a few kilometers from my country house, Yota set up its base station and, judging by the coverage map, my house was in the “reliable reception zone” of this network.

Attempts to use a USB modem from Yota showed an unsatisfactory result: even on the third floor balcony facing the base station, the signal level is extremely low, the data exchange rate is 100–200 kilobits per second (that is, less than 25 kilobytes per second).

Just at this time, Yota began selling its new device - the street modem "Yota Street".

Pluses of this device:
  1. Directional antenna - high gain and sensitivity by orders of magnitude superior USB modem (in winter, when the leaves on the trees do not stand in the way of radio waves, the reception rate is up to 5-6 megabits per second, and the transmission is slightly less than 2 in the summer megabit in both directions).
  2. Street performance - that is, it is possible and necessary to move the antenna to the mast high above the roof.
  3. Power over Ethernet is just one wire for data and power.
  4. It is connected to the WAN port of any router, the router receives all the information about the external network via DHCP.

It would seem just a fairy tale. Turn on and enjoy. But, short was happiness.

As soon as the device went on sale, it was purchased and hoisted on the roof of the house.
The new device did not prove to be from the best side: the connection to the Yota network periodically broke off and to restore it, you had to go into the web interface of the router and click on the "Connect" button until frenzy. Sometimes the connection was resumed, sometimes not. We had to turn off the power for both the modem and the router for 15-30 minutes.

All calls to Yota technical support ended with the offer to show the modem to the service. Some owners agreed and they sometimes even changed the device entirely. However, it later turned out that a completely new device behaves exactly the same.

Then rumors began to appear that Yota is preparing the Yota Street firmware update, however, this was never to be. Yota simply turned off sales of “Yota Street” and the owners of this wonderful device were left alone with their problems.

However, as long as a lot of money was spent on the modem and the unlimited Yota tariff was more than fine for me, I decided on my own to try to get my modem working.

My experience of using “Yota Street” and discussions on the YotaTester forum led me to the following 2 conclusions:
  1. It is necessary periodically, for example once a day, to restart the modem so that it does not form too much uptime as a result of which the device ceased to work adequately.
  2. It is necessary to force the router to detect a broken connection and try to reconnect (as I previously did it with my hands from the web interface of the router).


The first task is solved simply: we buy an electric timer and program it to turn off the power at night from 3-00 to 3-15.
The second problem is somewhat more complicated. Fortunately, the router I was not simple, but well-known in narrow circles Asus Wl-500gp. For some time he has been working under the control of “firmware from enthusiasts”.

Searches on the Internet have shown that in this firmware (as well as in many other alternative firmware) it is possible to connect scripts for a set of events:

I just needed the ability to run my script after the full “normal” start of the router.

It remains to write a script that monitors the connection.

And again, searches on the Internet have brought results: the “always_on” script from the DD-WRT website turned out to be exactly what I was looking for.
The router pings the default gateway and if there is no response, it sends new discovery requests from the DHCP client.

However, I modified the script a bit so that the accidental loss of ping packets did not lead to the connection being dropped: only N consecutive failed pings lead to reconnection.

The result turned out to be very encouraging - there is almost always access to the Internet, only sometimes the connection is lost so that it can recover in a couple of minutes.

Well, if I started writing scripts, I added 2 more simple but very useful scripts:
  1. The MTU setting is equal to the recommended Yota 1400 bytes. It is difficult to say whether this has affected the speed and stability of work, but I want to believe that it did not get any worse.
  2. Forwarding the web interface of Yota-street to a local network. The fact is that this same web interface is initially available when directly connected to the device at a fixed address: 192.168.1.1. At the same time, via DHCP, the router from the modem receives an address in a completely different subnet (internal Yota subnet), that is, the modem's web interface is unavailable from the local network behind the router. However, iptables can solve this problem.
  3. And to top it off for my convenience, I have issued a command in the form of a script for saving file system changes to the internal flash-memory.

So, I got 3 "combat" script and one service.

For more flexibility and ability to further modify the set of scripts to run, I implemented a system like usual startup scripts in Linux: put all the scripts to run after loading into one folder "/ usr / local / sbin", called them with the prefixes "SXX" and more in one script I run them in ascending order of the index in the prefix.

In short, now the configuration of the router is as follows:
  1. Login to the router via telnet and go to the folder "/ usr / local / sbin"
  2. Put in the folder "/ usr / local / sbin /" "combat scripts": S10setmtu , S20alwayson and S30yotadmin
  3. There we put 2 service scripts: post-boot , which runs the “combat scripts”; and flash.sh , with which we save the file system changes to the flash memory of the router.
  4. Run flash.sh: ./flash.sh
  5. Reboot the router: either with the reboot command in the terminal, or distort the power.


Voila, the Internet works and pleases users!

Source: https://habr.com/ru/post/126312/


All Articles