Community discussions

MikroTik App
 
Pepo
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 86
Joined: Thu May 29, 2008 1:34 am

Web Server behind Mikrotik Server

Tue Sep 16, 2008 5:54 pm

Hi all, i'm using mikrotik server to provide internet services to my clients by Hotspot and PPPOE servers that are built-in on my mikrotik server.
But, now i want to add a web server to my network and take some benefits of my mikrotik server to act as a firewall to my new web server.
So i want to add the required rules in my firewall and put the basic configuration to let my web server more secured.
So the graph of my network will be:
internet======>>Mikrotik=======>>Customers on interface local & Web server on other new interface.
You do not have the required permissions to view the files attached to this post.
 
NickOlsen
Member Candidate
Member Candidate
Posts: 131
Joined: Wed Feb 13, 2008 9:30 pm

Re: Web Server behind Mikrotik Server

Tue Sep 16, 2008 10:53 pm

what version of routeros?
 
Pepo
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 86
Joined: Thu May 29, 2008 1:34 am

Re: Web Server behind Mikrotik Server

Wed Sep 17, 2008 3:22 am

ROS is on Ver 2.9.51
8)
 
User avatar
chvdr
Member
Member
Posts: 403
Joined: Thu Sep 22, 2005 8:53 pm

Re: Web Server behind Mikrotik Server

Wed Sep 17, 2008 4:12 am

regarding the picture, i suppose your webserver shuld be "web server" [192.168.1.101] on it, not "server" [192.168.0.17].
if yes, go ahead, use your mt device as a firewall, use documentation as helper. it's easy.
 
Pepo
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 86
Joined: Thu May 29, 2008 1:34 am

Re: Web Server behind Mikrotik Server

Wed Sep 17, 2008 5:16 am

Thanks for all,
but i want to tell you that i'm using one static ip for my mikrotik server and i want to host multiple web site on my web server, so i want also to use natting to redirect requests to the correct website.
i hope that my idea is delivered to you.
:lol:
 
NickOlsen
Member Candidate
Member Candidate
Posts: 131
Joined: Wed Feb 13, 2008 9:30 pm

Re: Web Server behind Mikrotik Server

Wed Sep 17, 2008 8:06 am

You can only forward port 80 to one computer. period
you can setup a host based web server. Such has Apache virtual hosts.
Google it.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26378
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Web Server behind Mikrotik Server

Wed Sep 17, 2008 9:09 am

yes, this is not possible in the router. you need to set up apache "virtual hosts"
 
thomaspc
just joined
Posts: 10
Joined: Fri May 02, 2008 9:47 pm

Re: Web Server behind Mikrotik Server

Wed Sep 17, 2008 11:01 pm

This can be done using a proxy, see the example;
http://wiki.mikrotik.com/wiki/Multiple_Web_Servers
Also if using IIS you can use "host headers" [similar to Apache]
 
Pepo
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 86
Joined: Thu May 29, 2008 1:34 am

Re: Web Server behind Mikrotik Server

Thu Sep 18, 2008 5:44 am

ok, thanks for all,
But i want to ask how can i tell my mikrotik to redirect that port 80 request to that web server ???
:lol:
Also i want to say that i want to access my new web site from the internet, not from my network only, i mean that i want to let you to surf it.
:lol:
 
NickOlsen
Member Candidate
Member Candidate
Posts: 131
Joined: Wed Feb 13, 2008 9:30 pm

Re: Web Server behind Mikrotik Server

Thu Sep 18, 2008 7:40 am

add action=dst-nat chain=dstnat comment="" disabled=no dst-port=80 in-interface=wan0 protocol=tcp \
to-addresses=INTERNAL_IP_HERE to-ports=80
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Web Server behind Mikrotik Server

Thu Sep 18, 2008 2:14 pm

aslo, i would like to note, that dns addresses on dns server will point to your external ip address and customers from your local network would not be able to access webserver using dns name (external ip address) while on local they will able to do that using server internal ip address.
 
digus
just joined
Posts: 23
Joined: Mon Sep 11, 2006 5:47 pm
Contact:

Re: Web Server behind Mikrotik Server

Sat Sep 27, 2008 2:39 am

And what firewall rules are required to get around that local client access to external IP (hosted internally) limitation? I've seen really cheap nat routers that do it automatically (dlink's?), so I know it's possible. I just can't seem to figure it out. Any ideas?

Thanks!
 
NickOlsen
Member Candidate
Member Candidate
Posts: 131
Joined: Wed Feb 13, 2008 9:30 pm

Re: Web Server behind Mikrotik Server

Sat Sep 27, 2008 11:18 am

I found the same problem.
My fix was to have 2 DNS servers.
1 internal were www pointed to the servers internal 172 address.
1 external where www points to my external ip. And only people from the outside see this.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Web Server behind Mikrotik Server

Sat Sep 27, 2008 3:59 pm

I found the same problem.
My fix was to have 2 DNS servers.
1 internal were www pointed to the servers internal 172 address.
1 external where www points to my external ip. And only people from the outside see this.
it is called 'split DNS' and can be configured with 1 dns server =)
 
User avatar
pekr
Member Candidate
Member Candidate
Posts: 169
Joined: Tue Feb 22, 2005 9:05 pm
Location: Czech Republic
Contact:

Re: Web Server behind Mikrotik Server

Sat Sep 27, 2008 6:10 pm

Webserver on internal network problem can be adressed in several ways:

- add static DNS entry for it. But beware, I still claim, that MT DNS is unreliable for that, and hence ...

- you have to source-nat packets which go to your webserver (chain=srcnat dst-address=webserver-ip action=masquarade out-interface=local
 
NickOlsen
Member Candidate
Member Candidate
Posts: 131
Joined: Wed Feb 13, 2008 9:30 pm

Re: Web Server behind Mikrotik Server

Sun Sep 28, 2008 1:13 am

I found the same problem.
My fix was to have 2 DNS servers.
1 internal were www pointed to the servers internal 172 address.
1 external where www points to my external ip. And only people from the outside see this.
it is called 'split DNS' and can be configured with 1 dns server =)
Yeah, I know, i just wanted to give the general idea.

Who is online

Users browsing this forum: mquan1984 and 133 guests