Community discussions

MikroTik App
 
NMCI
just joined
Topic Author
Posts: 12
Joined: Mon Dec 07, 2020 8:38 pm

redirect ip to host

Sat May 15, 2021 12:05 am

hello, greetings to the whole community.

I have a doubt

In my network I have an access point, with ip 10.100.100.2 to access the web interface, it has to be through port 82 (tcp), 10.100.100.2:82 is what I put in any browser and it arrives perfectly
now my question is how to access it through hots instead of ip.

that is, I want to enter example.com in the browser and open the content of the access point 10.100.100.2:82

and in turn it is necessary that if 10.100.100.2 or 10.100.100.2:82 is entered in the browser, it automatically goes to the hots example.com and shows its content.
is it possible to implement this.?

We want to thank everybody beforehand
 
User avatar
Hominidae
Member
Member
Posts: 309
Joined: Thu Oct 19, 2017 12:50 am

Re: redirect ip to host

Sat May 15, 2021 4:23 pm

...the first part is quite easy...the second is not.

1. create a static DNS entry for the IP and give it a name as desired.

2. port mapping will not work, when browser (client PC) and AP are in the same subnet.
For port-mapping you need to create a DST-NAT rule in your firewall, which will never be triggered when client &server are in the same subnet.

Easiest way to achieve a simple access from the browser to web-hosts with non-standard ports, is to create a bookmark.
Then use a bookmark manager, that is able to share bookmarks across browser instances, like Chrome when signed into your google account.
 
NMCI
just joined
Topic Author
Posts: 12
Joined: Mon Dec 07, 2020 8:38 pm

Re: redirect ip to host

Sat May 15, 2021 7:38 pm

...the first part is quite easy...the second is not.

1. create a static DNS entry for the IP and give it a name as desired.

2. port mapping will not work, when browser (client PC) and AP are in the same subnet.
For port-mapping you need to create a DST-NAT rule in your firewall, which will never be triggered when client &server are in the same subnet.

Easiest way to achieve a simple access from the browser to web-hosts with non-standard ports, is to create a bookmark.
Then use a bookmark manager, that is able to share bookmarks across browser instances, like Chrome when signed into your google account.
the access point is on a different subnet.
I have a static DNS to example.com -> 10.100.100.2
Now how would the next step be done?
 
User avatar
Hominidae
Member
Member
Posts: 309
Joined: Thu Oct 19, 2017 12:50 am

Re: redirect ip to host

Sat May 15, 2021 8:24 pm

..as I wrote.
Create a DST-Nat rule in your firewall for 10.100.100.2 (dst-address) and to-address=10.100.100.2, to-port=82.
...that should do the trick
 
NMCI
just joined
Topic Author
Posts: 12
Joined: Mon Dec 07, 2020 8:38 pm

Re: redirect ip to host

Sat May 15, 2021 9:54 pm

..as I wrote.
Create a DST-Nat rule in your firewall for 10.100.100.2 (dst-address) and to-address=10.100.100.2, to-port=82.
...that should do the trick
correct I have this implemented.
add action=dst-nat chain=dstnat dst-port=80 protocol=tcp dst-address=10.100.100.2 to-ports=82

But how would it be for the ip to be redirected to the host?

at this moment if I enter 10.100.100.2 in effect it sees the content without having to write the port
in the same way if I enter the host example.com I see the content without having to use the port

now I only need that when entering the ip in any browser this ip will translate the host
for example if you write the ip http://172.217.3.78/, it will automatically redirect you to www.google.com
That is the same result you are looking for, and thank you very much for the collaboration that you have given me

Who is online

Users browsing this forum: CGGXANNX and 41 guests