Community discussions

MikroTik App
 
Tomas09
just joined
Topic Author
Posts: 8
Joined: Mon Dec 05, 2016 5:29 pm

NAT https with aditional port

Thu Feb 18, 2021 2:49 pm

Hello,
I have a problem with config port forwarding this address https://example.com:9152. It is a server that running in LAN using https for connection and 9152 is port that define interface for configuration the application server via borwser.

I create rules in the firewall and in the NAT for 443 to the server but not working, If I check logs there is that I try connect to the ip:443 missing the 9152

Do you have any advice how to config or is it not possible?

Thanks
Tomas
Last edited by Tomas09 on Thu Feb 18, 2021 3:28 pm, edited 1 time in total.
 
erlinden
Long time Member
Long time Member
Posts: 695
Joined: Wed Jun 12, 2013 1:59 pm

Re: NAT https with aditional ports

Thu Feb 18, 2021 3:28 pm

This can be handled by /ip firewall nat:
add action=dst-nat chain=dstnat comment="Port translation (or any other comment)" dst-address-list=[fill in the public IP address] dst-port=443 log=yes protocol=tcp to-addresses=[fill in the private IP address] to-ports 9152
First the problem, then the solution
 
Tomas09
just joined
Topic Author
Posts: 8
Joined: Mon Dec 05, 2016 5:29 pm

Re: NAT https with aditional ports

Thu Feb 18, 2021 3:36 pm

This can be handled by /ip firewall nat:
add action=dst-nat chain=dstnat comment="Port translation (or any other comment)" dst-address-list=[fill in the public IP address] dst-port=443 log=yes protocol=tcp to-addresses=[fill in the private IP address] to-ports 9152
Thank you for reply. But problem is that I need redirect from https://example.com:9152 to https://192.168.0.20:9152. If I do what you supposed I have still same problem, in the log I´ve seen my_public:6355->lan_ip:9152
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 6164
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: NAT https with aditional port

Thu Feb 18, 2021 5:17 pm

Hi Thomas,
Your explanation is confusing.

Lets say you have Server on your lan 192.168.0.20 and the server expects traffic on port 9152

So why the heck are you discussing ports 443 and showing a port on a log for 6335???

Also are you wanting EXTERNAL users only to connect to the server OR also LAN users.
If there are LAN users, then are they accessing the server via the LANIP or by the WANIP (loopback).

I do not understand how a user is going to connect to the server on port 443 and then magically get to port 9152??
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
MTUNA Certified, by the Ascerbic Llama!

Who is online

Users browsing this forum: andkar, Baidu [Spider], eworm, Google [Bot], Ilya, imnotzombie97, skylark and 187 guests