Community discussions

MikroTik App
 
AlexS19
just joined
Topic Author
Posts: 1
Joined: Fri Apr 12, 2019 5:17 am

Automatic change of IP and port of peer

Fri Apr 12, 2019 5:45 am

Hi friends,

Behind my MT hap ac I have a device which services peers connecting from specific IP _and_ port only.

Naturally, I want to access it from anywhere.

Say:
1. Device is at InIP and listens to port InPort.
2. Expected peer IP is CIP and port is CPort
3. Real peer IP is X and port Y (both unpredictable)

My idea was to make src-nat like if dst-port=InPort the change to-addresses=CIP, to-ports=CPort.

Problem is that I need to add corresponding dst-nat from device InIP to actual X and Y each time peer connects.

I feel this can be achieved via script that monitors connections to InPort and automatically adds/refreshes NAT rules.

Please advise. Maybe I missed better approach.

Thank you very much in advance.

Who is online

Users browsing this forum: No registered users and 8 guests