N
N
Nicholas2018-05-14 15:52:27
Computer networks
Nicholas, 2018-05-14 15:52:27

How to configure mikrotik as a relay of requests from internet to internet?

Greetings!
In connection with recent large-scale blocking, there was a desire to make a transparent relay of one game service (eco toy) based on mikrotik.
Now it works for me based on www.komodia.com/komodia-relay
But I would like to throw the server out of the chain and wrap it directly on Mikrotik.
Schematic of how it should work.
Protocol UDP
Port 3000
IP mikrotik 1.1.1.1
Service IP 2.2.2.2
The client sends a request to Mikrotik 1.1.1.1, Mikrotik receives it and sends it to service 2.2.2.2 from its address. The response received from the service is returned to the client from the Mikrotik address.
5af984c298a97707847877.png
I worked a little with Mikrotiks, but I didn’t figure out how to turn it outward.
I found the only similar question on the English mikrotik forum, they suggest using

/ip firewall mangle add action=mark-connection chain=prerouting connection-state=new dst-address=1.1.1.1 dst-port=3000 new-connection-mark=natthis passthrough=yes protocol=udp
/ip firewall nat add action= dst-nat chain=dstnat connection-mark=natthis protocol=udp to-addresses=2.2.2.2 to-ports=3000
/ip firewall nat add action=masquerade chain=srcnat connection-mark=natthis

But in that branch they didn’t get to “work”, I couldn’t figure it out either.
I would love to help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wexter, 2018-05-14
@GDragon


/ip firewall filter add chain=forward dst-address=2.2.2.2 action=accept
/ip firewall nat add chain=srcnat dst-address=2.2.2.2 action=masquerade
/ip firewall nat add chain=dstnat dst-address=1.1. 1.1 protocol=udp dst-port=3000 action=dst-nat to-addresses=2.2.2.2 to-ports=3000

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question