Skip to content Skip to sidebar Skip to footer

Port Forwarding Multiple Webserver Different Domains Mikrotik

Article

Port Forwarding Multiple Webserver Different Domains


In the previous article we tried to port forwarding so that the web server on the local network can be accessed using the IP Public installed in the router. For more information can be found at the following link here.

But what if we want to access more than one webserver on a LAN network using a domain name from the internet. And each of those domain names we resolve to one Public IP installed in the router.

This can be done using MikroTik router which is with NAT configuration and combined with other features namely Web Proxy and Dns Static.

Example of a case



Port Forwarding Multiple Webserver Different Domains Mikrotik


With the topology as above, when there is a user who will access from the internet using a domain name will be resolved to ip public installed in the router. So that the request traffic from the internet can be redirected to each webserver on the LAN network according to the domain name, then we will use webproxy. The configuration on the web proxy is as follows:


  • Enable webproxy service on router

Port Forwarding Multiple Webserver Different Domains Mikrotik


  • For security we will configure on 'webproxy access' by only allowing request traffic from the domain names of both the webserver and the other traffic to be blocked.

Port Forwarding Multiple Webserver Different Domains Mikrotik port forward server


After the webproxy configuration as above we will then set NAT in the firewall menu. For NAT later we will redirect any traffic with the purpose of port 80 that enters the router from the internet network to the webproxy. The configuration of NAT is as follows:


  • Winbox - on the Menu ''IP--> Firewall --> NAT''

Port Forwarding Multiple Webserver Different Domains Mikrotik fitur nat NAT


  • CLI Terminal

Port Forwarding Multiple Webserver Different Domains Mikrotik CLI Terminal Terminal


And our last step is also to configure the Static DNS in the router to map/resolve the domain name to each webserver IP address on the LAN network. Examples of configurations are like the following:


  • We enter on the IP --> DNS menu, and click on the command button 'Static'. We fill in the list for the domain name as well as the IP Address of the webserver.

Port Forwarding Multiple Webserver Different Domains Mikrotik IP DNS


Until this step the configuration is complete. For testing we try to access our wenbserver domain name from the internet network.


*) Note:

  • We must first purchase the domain name on the domain service provider & hosting and fill in the A record with the Public IP of our router.
  • To be more stable IP Public from our router using IP Public Static.

Dani31
Dani31 2012 pertamakali Melakukan Blongging dani31 great web for support dani31 About Me About Me dani31