Community discussions

MikroTik App
 
al1
just joined
Topic Author
Posts: 7
Joined: Thu Jan 17, 2008 4:16 pm

acces internal webserver over public ip from internal lan

Thu Jan 17, 2008 9:46 pm

Hi all,

i use a RB150 Router with adsl. A webserver is running in the internal lan. Over a nat-dst rule the port tcp 80 is mapped to the internal ip, access over the pulbic interface is well. But if i would access the webserver with the public ip from the internal lan, the connection ends always on the mikrotik (webbox). I won´t add a static entry with the internal ip from the webserver in the dns-server on mikrotik.

;;; webserver tcp
chain=dstnat action=dst-nat to-addresses=xx.xx.xx.xx to-ports=80
in-interface=adsl dst-port=80 protocol=tcp

Thanks for help.
Regards al1
 
antoninn
newbie
Posts: 30
Joined: Wed Nov 14, 2007 12:59 pm

Re: acces internal webserver over public ip from internal lan

Thu Jan 17, 2008 10:07 pm

What is the reason why do you not want to add static DNS entry?
 
al1
just joined
Topic Author
Posts: 7
Joined: Thu Jan 17, 2008 4:16 pm

Re: acces internal webserver over public ip from internal lan

Thu Jan 17, 2008 10:09 pm

another linux server in the internal lan is used for local zones and as forwarder.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7198
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: acces internal webserver over public ip from internal lan

Fri Jan 18, 2008 12:27 pm

You have in-interface=adsl in your rule, it means that connections will be dstnatted only if they are comming from public interface.

Something like this should work:
chain=dstnat action=dst-nat to-addresses=xx.xx.xx.xx to-ports=80
src-address=<your_public_IP> dst-port=80 protocol=tcp
 
al1
just joined
Topic Author
Posts: 7
Joined: Thu Jan 17, 2008 4:16 pm

Re: acces internal webserver over public ip from internal lan

Fri Jan 18, 2008 2:17 pm

thanks. i know. the problem, public interface does not have a static ip.
 
itsh.net
Member Candidate
Member Candidate
Posts: 115
Joined: Mon Jan 23, 2006 12:00 pm
Location: Germany
Contact:

Re: acces internal webserver over public ip from internal lan

Fri Jan 18, 2008 2:38 pm

i use netmap to forwarded my mail/web-server

chain=dstnat action=netmap to-addresses=<lan_Webserver_IP> to-ports=80
dst-port=80 protocol=tcp
 
al1
just joined
Topic Author
Posts: 7
Joined: Thu Jan 17, 2008 4:16 pm

Re: acces internal webserver over public ip from internal lan

Sun Jan 20, 2008 1:09 pm

this maps the port direct. But if i use this rule or with nat and do not specifiy an interface all outgoing connectios over port 80 (all web traffic from all clients) ends at the mikrotik admin site.
 
User avatar
chimaster
Member Candidate
Member Candidate
Posts: 133
Joined: Tue Feb 07, 2006 8:54 am
Location: Queenstown
Contact:

Re: acces internal webserver over public ip from internal lan

Mon May 19, 2008 1:12 am

I have a similar but different problem.

I have four interfaces on my firewall, the address range 192.168.2.0/24 is my DMZ with 8 servers in it. If I come in from any of the other 3 interfaces I can get to my webservers via the nat.

http://www.example.com will resolve EXT IP. --> Internal IP 192.168.2.2 --> Get my site.

I have a couple of mail servers in the same DMZ, one is a virtual host with 70 websites. So I really want to avoid adding a static entry on each server to resolve to a server in the same subnet. All my servers use the firewall (mikrotik) interface as their DNS and I've setup DNS STATIC entrys on my firewall to route to appropriate servers.

However, I'm unable to get them to resolve to the internal IP. Even the Mikrotik is resolving to the "Real" external DNS address. I've flushed the cache and am not sure where to go from here.

Any pointers appreciated. Sorry if I've hijacked your thread, but I felt this was very much on the same topic. :-)