K
K
Khaybulla Musaev2016-06-29 01:03:23
linux
Khaybulla Musaev, 2016-06-29 01:03:23

How to create an additional Internet channel in linux?

Hello.
Task
I want to transfer a number of my scripts to a home raspberry pi 2, which will have to act as a web server. Nothing critical, just simple and interchangeable things. Access from the outside via DDNS, only I need, because requests from other people to my scripts are not expected.
However, I would like this web server to be available, if 100% of the time, then at least a decent amount of it. Of course, one home Internet channel is not enough, because if the connection is broken and, possibly, the subsequent reboot of the router or some other manipulations, access to the raspberry from the outside will be closed.
As a backup channel, I consider 4g / 3g in two sections - either a router with access via wi-fi, or a modem with access via usb (there is an additional usb splitter with separate power supply).
Questions.
1. How would you organize switching between connections if the main channel is unavailable? ..
I assume the following:
a) The first option - when the connection is not broken, but the pages do not open - check the connection to the Internet after a certain period of time. But after what interval?.. And are there any already existing tools for this?.. Hosting providers are clearly using something solid.
b) Option two - if the connection to the home Internet (the main channel) is still broken, then how to configure the network manager's parameters so that it automatically switches to an alternative connection? ..
2. In the event of a disconnection (main or alternative), I should still receive SMS that the home network is unavailable. How to implement this on a 4g / 3g modem, I already read and roughly understand. But is this possible on a 4g / 3g router? ..

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Azazel PW, 2016-06-29
@azazelpw

The problem of accessibility by the number of channels will not be solved.
For a web service, you need a normal front balancer.
At first, everything rests on the A DNS record, but we go by the domain name.
1 decision. DynDNS will change the entry depending on the working channel.
2 decision. Your own DNS server, which will balance records through Round Robin.
But there is still no escape from the user's DNS cache, an active user will stumble upon an error accessing the site.
Next, the request goes to the web server, which means that the rules and routing must be configured to send packets to the channel from which they came, it is decided by traffic marking. Thus, 2 or more channels can work simultaneously.

D
Dmitry Alexandrov, 2016-06-29
@jamakasi666 Curator of the Linux tag

I ran into similar problems, fought with wrt for a long time, then conjured with my own crutches. Ultimately, he spat and bought a Mikrotik router. Killed a lot of rabbits at once. Firstly, inside Mikrotik routers, you can raise virtual machines with wrt firmware, secondly, the router works just like clockwork, thirdly, it is powered by poe from the router 2 ip phones and wifi in another room. The router itself was put on a UPS and now there are no problems with accessibility at all, everything is in its own vlans, the speed does not drop even with a bunch of torrents, everything is easily configured and in general there was the first experience of communicating with Mikrotik equipment and to say that I am satisfied is to say nothing , although he also worked with ciscos and a bunch of different cheap switches / switches and routers.
In general, read on this topic, I am very sure that RouterOS or Mikrotik routers / routers are most suitable for accessibility tasks.

L
littleguga, 2016-06-29
@littleguga

1. Shouldn't the system itself pick up?
As an option - write a script that will switch to another one in case of a grid fall.
2. Look at this:
https://habrahabr.ru/post/133085/
https://xakep.ru/2015/04/07/195-sms/
или
как только поднялся интернет с модема - через сервис по типу smsaero.ru/sms.ru, ведь интернет то уже будет
Особо других вариантов не вижу.

K
kirdik, 2017-08-16
@kirdik

Написать bash скрипт, который пингует адрес в интернете в случае если ответ отрицательный прописывать новый маршрут route -G b далее по тексту. Скрипт сажается на cron и работает раз в минуту.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question