S
S
schnaps19812019-11-21 07:11:45
proxy
schnaps1981, 2019-11-21 07:11:45

How to properly map ports?

To begin with, I will write the topology.
There is a Mikrotik root router. static for the local network ip: 192.168.1.1, has Internet access via wire
There is a workstation on it 3proxy is installed. dynamic ip from mikrotik 192.168.1.171
There is another TP-LINK router on OpenWRT with a 4G modem. static ip: 192.168.1.250. has access to the Internet via a modem.
It is required to configure Sox in 3proxy on the workstation so that requests to this Sox are redirected to TP-LINK, and requests NOT to Sox go to Mikrotik and then to its wired Internet.
For this, the 3proxy config was written.

3proxy config

internal 192.168.1.171
external 192.168.1.171
nserver 8.8.8.8
nserver 8.8.4.4
nscache 65536
log
logformat "L%C - %U [%d/%o/%Y:%H:%M:%S %z] ""%T"" Error = %E %I %O %N/%R:%r"
rotate 30
auth none
allow *
tcppm -i192.168.1.171 1080 192.168.1.36 1080
socks -p1080

As a result, I got:
1. when starting the proxy, the log is issued
spoiler

192.168.1.171 - - [21/Nov/2019:10:54:05 +0700] "Accepting connections [6880/5308]" Error = 00000 0 0 TCPPM/0.0.0.0:0
192.168.1.171 - - [21/Nov/2019:10:54:05 +0700] "Accepting connections [6880/7700]" Error = 00000 0 0 SOCKS/0.0.0.0:0

when trying to connect to a proxy
spoiler

192.168.1.171 - - [21/Nov/2019:11:00:48 +0700] "192.168.1.250" Error = 00013 0 0 TCPPM/192.168.1.250:1080
192.168.1.171 - - [21/Nov/2019:11:02:50 +0700] "192.168.1.250" Error = 00013 0 0 TCPPM/192.168.1.250:1080
192.168.1.171 - - [21/Nov/2019:11:02:52 +0700] "192.168.1.250" Error = 00013 0 0 TCPPM/192.168.1.250:1080

As I understand it, the proxy cannot connect to the router on OpenWRT
2. If you throw out the root router from the chain, then the mapping works fine, that is, the proxy regularly receives traffic, sends it to the router, and then it goes to the Internet via a modem.
What am I doing wrong, and how to do it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Dubrovin, 2019-11-21
@z3apa3a

You have a routing task, it is not solved at the application layer where the proxy works. Make 2 IP addresses on the host with 3proxy and configure source routing so that traffic from one IP address is routed through one router, and from another IP address through another router, only then by choosing an external address it will be possible to select a route.
In the case of a Windows workstation, routing is problematic to manage, but it is possible to configure a separate interface with a separate address and gateway to the same network.
PS where does port mapping come in and how tcppm should (by design) work in the described scheme remains unclear.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question