I
I
Ivan Zhuravlev2019-10-07 20:13:32
PHP
Ivan Zhuravlev, 2019-10-07 20:13:32

How to set up routing on Raspberry Pi?

Good day to all. I really need your help in setting up a network for Raspberry Pi! There is a raspberry, to which a 3G router is connected with an Ethernet cable, which operates inside a closed subnet without Internet access. There are several devices on this subnet for which availability monitoring needs to be done. For these purposes, a python script is launched on the raspberry, which pings all devices on this subnet with a certain frequency and writes a log. The resulting log must be transferred to a remote server (VPS). For these purposes, a USB modem with a regular SIM card with Internet access is connected to the raspberry. The same modem is supposed to be used for remote connection to Raspberry if necessary. The question is: how to set up a network on a raspberry so that the ping requests of the script for monitoring go through one interface (ethernet), and everything else is different (USB modem)? And at the same time, it is still very desirable to make it impossible to get into a closed subnet from an external network (only a script for monitoring network connections should work with it). I roughly understand that routes need to be written using the route utility, but I'm afraid that I have no experience in this matter at all. And I don’t know how to make it so that only a monitoring python script can work with a closed subnet.
Help, good people. Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
zxscv, 2018-07-04
@zxscv

no they don't do that. Do this
$smarty->assign('title', $siteSettings->{'title_'.$lang});
.......
and in the template just {$title}
well, you need to check $lang carefully like in_array($lang,array('ru','en'))

D
Dmitry, 2019-10-07
@IvanGeso

If you have a properly configured ppp connection, in theory, no additional settings are required. The default gateway provided by the modem should take precedence. With a ppp connection established, give the output of the route command - we are interested in the c default lines at the beginning. If the default gateway metric for the eth connection is lower than for the modem connection, then in order not to be smart, you can configure the wired interface manually by specifying only the address and mask - this will work, but only if the devices we want to monitor , are in the same network as the raspberry. If not, then you will have to prescribe routes.
As for

And at the same time, it is still very desirable to make it impossible to get into a closed subnet from an external network (only a script for monitoring network connections should work with it).
you don’t have to worry about it, because. raspberry will not be a gateway for internal network devices, access to them is possible only if hacked from outside the raspberry itself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question