Community discussions

MikroTik App
 
wifiryan
just joined
Topic Author
Posts: 21
Joined: Sat Sep 17, 2011 7:31 pm

How do I redirect port 80 to another server, LAN side?

Wed Aug 15, 2012 6:18 am

The IP of my Mikrotik router is 192.168.0.1

When someone from inside the LAN browses to 192.168.0.1 I want to redirect them to a http server at 192.168.0.2, but still show 192.168.0.1 as the server IP in the browser.

Essentially it is port redirecting inside the LAN, just like port forwarding through NAT preserves the original WAN ip the request was sent out to. How do I go about this? I can only use IPTABLES to redirect WAN->LAN traffic, but need to redirect LAN->LAN traffic. I found a simple way to do this from a Windows Router/HTTP server to peform this using port redirection, so surely MikroTik can do this somehow?

Thank you
 
User avatar
greencomputing
Frequent Visitor
Frequent Visitor
Posts: 95
Joined: Wed Jun 23, 2010 1:12 pm
Location: Italy

Re: How do I redirect port 80 to another server, LAN side?

Wed Aug 15, 2012 10:20 am

Hi sir

this work as requested .
/ip firewall nat 
add action=dst-nat chain=dstnat disabled=no dst-port=80 protocol=tcp \
    to-addresses= 192.168.0.2

add action=masquerade chain=srcnat disabled=no dst-address=192.168.0.2 \
    dst-port=80 protocol=tcp
let me<know and have a nice day
 
wifiryan
just joined
Topic Author
Posts: 21
Joined: Sat Sep 17, 2011 7:31 pm

Re: How do I redirect port 80 to another server, LAN side?

Tue Aug 21, 2012 6:24 am

Hi sir

this work as requested .
/ip firewall nat 
add action=dst-nat chain=dstnat disabled=no dst-port=80 protocol=tcp \
    to-addresses= 192.168.0.2

add action=masquerade chain=srcnat disabled=no dst-address=192.168.0.2 \
    dst-port=80 protocol=tcp
let me<know and have a nice day

Thank you! In chain=dstnat I had to add dst. address 192.168.0.1 or all HTTP requests on the entire LAN were redirected, but other than that it works great. Thank you so much saved me hours!
 
takararonaldo
just joined
Posts: 1
Joined: Thu Dec 07, 2017 10:40 pm

Re: How do I redirect port 80 to another server, LAN side?

Thu Dec 07, 2017 10:59 pm

Thanks!! This is the solution! Helped me a lot!

Who is online

Users browsing this forum: Bing [Bot], GoogleOther [Bot], nescafe2002, Semrush [Bot] and 97 guests