D
D
Dmitry Alexandrov2020-02-05 00:10:59
linux
Dmitry Alexandrov, 2020-02-05 00:10:59

How to connect remotely to a proxy on Rasberry pi?

5e39d420e13a2665650252.jpeg
Connection diagram.

The task is to remotely connect to a proxy for sorting out with Internet access via a USB modem (megaphone).

On sort out there is a proxy server with Internet access via a USB modem (megaphone)

Through a laptop connected to home wifi with a proxy registered in the browser - everything works, I'm surfing the Internet through a megaphone. In parallel with these, the Akado home Internet also works. Everything inside the network works as it should. The problem is that when I try to connect remotely, it doesn't work.

Since there is no static IP on Akado, I use DDNS (noip), I checked it works. The router has port forwarding.
Through trial and error, I came to the conclusion that I can get to the proxy remotely, but the return answer is lost in the analysis and most likely goes the wrong way. If you turn off the USB modem, then it turns out to enter SSH remotely. As soon as I insert the USB modem - sort it out automatically connects the Internet to the megaphone and access to SSH is interrupted. I can't figure out what's stopping me. Tell me please.

3proxy configuration file parse
5e39d9a9d1a62775625087.png

the route command output parse
5e39d9f6da1f0133758903.png

the router settings
5e39dee4aa9d1768516941.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2020-02-05
@Sanasol

For about 3 days the last one was busy with almost the same task, everything also reached the raspberry and nothing came out back.
I solved everything by creating new interfaces and forwarding traffic through them. (At first, everything (didn't) work through cgroups)
Somehow I configured + cleared all iptables rules on raspberries.

auto eth0
iface eth0 inet static
    address 192.168.1.100 # локальный IP малины на домашнем роутере
    netmask 255.255.255.0
    gateway 192.168.1.1 # IP домашнего роутера
    dns-nameservers 1.1.1.1
    dns-nameservers 8.8.8.8
    dns-nameservers 8.8.4.4
    up ip route add table tableName default via 192.168.1.101 # IP usb модема через который надо выпускать трафик
    up ip rule add from 192.168.1.201 table tableName # второй локальный IP малины
    up ip route add default via 192.168.1.1 # IP домашнего роутера, весь трафик с малины пускает через домашнюю сеть, кроме трафика с 192.168.1.201 он пойдет через модем.
    up ip route add 192.168.1.0/24 dev eth0 table tableName # не уверен что это нужно, но пусть будет xD

auto eth1:1
iface eth1:1 inet static
    address 192.168.1.201 # второй локальный IP малины
    netmask 255.255.255.0
    dns-nameservers 1.1.1.1
    dns-nameservers 8.8.8.8
    dns-nameservers 8.8.4.4

Then we start the proxy server from the second local IP (192.168.1.201). Those. external in the proxy config.
Judging by the screenshots, something like this is what you have, but maybe something is missing from what was indicated above.
During the experiments, I also installed openvpn, connected it to the server in the DC and tried to work through it, the effect was the same. the network and the hodgepodge of iptables + cgroups worked like hell. But then openvpn already interfered with the normal operation of the above option, until it completely demolished it from raspberries.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question