Answer the question
In order to leave comments, you need to log in
How to forward a port through a VPN tunnel between two Mikrotik?
There are two Mikrotiks.
Mikrotik 1: Static white WAN IP (1.1.1.1), L2TP/IPSec server, LAN (10.10.10.0/24)
Mikrotik 2: Dynamic gray WAN IP (33.33.33.33), L2TP/IPSec client, LAN (20.20.20.0/ 24)
Web server: IP 20.20.20.100
VPN connection is established, routes to networks are registered, local networks interact with each other.
When creating a rule on Mikrotik 1
add action=netmap chain=dstnat dst-port=80 protocol=tcp in-interface=ppoe-out to-address=20.20.20.100
The port is forwarded only if I add the rule
add action=masquerade chain=srcnat dst-address=20.20.20.100 dst-port=80 protocol=tcp
That is, you can connect to the web server either by clients of one of the local networks, or by an external client disguised as Mikrotik 1.
How to configure without a masquerade, so that an external client connects to the web server directly through the tunnel?
It is advisable not to use Mikrotik 1 as the main gateway, because the speed allocated to it by the provider is 10Mbps, and Mikrotik 2 - 50Mbps.
Answer the question
In order to leave comments, you need to log in
Mikrotik2 does not know that the client's request to the web server came through Mikrotik1, so it sends a response through its default gateway. The solution is to either use a masquerade as you are doing, or tag traffic to Mikrotik2 via mangle and send it back via a separate routing table.
routes to networks are registered, local networks interact with each other
This is the simplest connection, but comments kill. what the hell is a masquerade? just register the routing, you can static, you can speaker. At me in office dynamic as it is a lot of subnets.
The routing table in studio on pieces of iron. And throw out the masquerade. and on computers routes. You can also run
tracert
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question