Community discussions

MikroTik App
 
rob1998
just joined
Topic Author
Posts: 8
Joined: Sat Apr 18, 2020 4:23 am

port forwading

Fri May 08, 2020 4:02 am

Hi, guys
I am trying to content MikroTik router to a Web server which is installed on Windows using XAMPP. I tried port forwarding but i still can't access my webserver.
IP address of the bridge interface is 192.168.10.1
IP address of the Windows is 192.168.10.8
IP address of the XAMPP web server is 127.0.0.1
This is the port forwarding rule I have configured :
General-------------------------------------------
Chanin: dstnat
protocol: tcp
dst port: 80
in. interface: bridge-hotspot
------------------------------------------------------------------
Action
Action: dst-nat
to addresses: 192.168.10.8
to ports: 80
-------------------------------------------------------------------
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19109
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: port forwading

Fri May 08, 2020 4:33 am

Hi Rob, one cannot tell much from a few snippets of the config.
Please
/export hide-sensitive file=anynameyouwish
(and just hide any ISP IP or gateway information).

I am sure with a full look at your config will have you up and running soonest!
 
rob1998
just joined
Topic Author
Posts: 8
Joined: Sat Apr 18, 2020 4:23 am

Re: port forwading

Fri May 08, 2020 4:45 am

hi anav thanks for the relpy
I have attached the confile
You do not have the required permissions to view the files attached to this post.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19109
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: port forwading

Fri May 08, 2020 6:41 pm

Hi Rob,
Just to be clear this unit is marketed as an access point but you are using it as a router and access point?

If so, what happed to all the default firewall rules or were there any to begin with?
I would not connect this unit to the internet until you have a more secure configuration.
 
rob1998
just joined
Topic Author
Posts: 8
Joined: Sat Apr 18, 2020 4:23 am

Re: port forwading

Fri May 08, 2020 10:53 pm

Hi anav
I'm not connecting this to internet. I am just trying to send my hotspot users to a local web server 127.0.0.1 so the user can access my web page.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19109
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: port forwading

Sat May 09, 2020 12:49 am

Can you include a network diagrams so its less confusing what is going on.
 
rob1998
just joined
Topic Author
Posts: 8
Joined: Sat Apr 18, 2020 4:23 am

Re: port forwading

Sat May 09, 2020 6:32 am

Image
network.PNG
You do not have the required permissions to view the files attached to this post.
 
User avatar
jvanhambelgium
Forum Veteran
Forum Veteran
Posts: 985
Joined: Thu Jul 14, 2016 9:29 pm
Location: Belgium

Re: port forwading

Sat May 09, 2020 9:15 am

Stupid question, you are sure your Xammp services are not bound to 127.0.0.1 (=localhost) only on the PC ?
That might explain a lot. You are running this on Windows OS I read ? Are you sure no host-side firewall is active ?
On that local machine, when opening a webbrowser to test it, do you issue something like http(s)://192.168.10.8 and this works ?

And can you set the "logging" flag on your NAT-rules so at least you can see in the Mikrotik logs something?
 
rob1998
just joined
Topic Author
Posts: 8
Joined: Sat Apr 18, 2020 4:23 am

Re: port forwading

Sat May 09, 2020 9:20 am

(http(s)://192.168.10.8 ) When I enter this on local machine web-browser it doesn't work but if I enter this (http://192.168.10.8) it works.
 
User avatar
jvanhambelgium
Forum Veteran
Forum Veteran
Posts: 985
Joined: Thu Jul 14, 2016 9:29 pm
Location: Belgium

Re: port forwading

Sat May 09, 2020 11:22 am

(http(s)://192.168.10.8 ) When I enter this on local machine web-browser it doesn't work but if I enter this (http://192.168.10.8) it works.
And another very stupid but essential question : your Windows machine does have a default-gateway set back to the AP/router right ?
As you are doing DNAT, the originating source-IP is not translated so your Xammp machine must be able to reply to 192.168.6.x IP's which are outside of its own network.
 
rob1998
just joined
Topic Author
Posts: 8
Joined: Sat Apr 18, 2020 4:23 am

Re: port forwading

Sat May 09, 2020 12:06 pm

I can ping from 192.168.10.8(pc/Xammp) to 192.168.10.1(router) and it works fine.
I can't ping from 192.168.10.8(pc/Xammp) to 192.168.6.1(hotspot)
 
User avatar
jvanhambelgium
Forum Veteran
Forum Veteran
Posts: 985
Joined: Thu Jul 14, 2016 9:29 pm
Location: Belgium

Re: port forwading

Sat May 09, 2020 2:51 pm

I can ping from 192.168.10.8(pc/Xammp) to 192.168.10.1(router) and it works fine.
I can't ping from 192.168.10.8(pc/Xammp) to 192.168.6.1(hotspot)
I can ping from 192.168.10.8(pc/Xammp) to 192.168.10.1(router) and it works fine.
>> You don't need any routes/gateway for that. Its considered "Direct Connected"

I can't ping from 192.168.10.8(pc/Xammp) to 192.168.6.1(hotspot)
>>Unless this is because of some filtering (I don't use Mikrotik products for Wireless) that does not seem good.
>>Can you ping from the Xammp server the actual Wireless client connected to the hotspot ? Again, perhaps there is some filtering by default, don't know the product...
>>I've seen some DHCP config so normally your wireless clients get an IP out of the 192.168.6.x range and have their gateway set to 192.168.6.1
 
2frogs
Forum Veteran
Forum Veteran
Posts: 713
Joined: Fri Dec 03, 2010 1:38 am

Re: port forwading

Sat May 09, 2020 7:15 pm

For the Hotspot to work correctly, it requires internet access so that any html queries can be redirected to the Hotspot login.html landing page. Instead of trying to redirect with firewall, it would be easier to edit the login.html to:
<head>
  <meta http-equiv="refresh" content="5; URL=https://192.168.10.8/" />
</head>
<body>
  <p>If you are not redirected in five seconds, <a href="192.168.10.8/">click here</a>.</p>
</body>
And this will redirect users to your Xammap Server. Before changing the html file, I would first test to see if you are getting the default page when connecting to the Hotspot first!
 
rob1998
just joined
Topic Author
Posts: 8
Joined: Sat Apr 18, 2020 4:23 am

Re: port forwading

Sun May 10, 2020 10:50 am

For the Hotspot to work correctly, it requires internet access so that any html queries can be redirected to the Hotspot login.html landing page. Instead of trying to redirect with firewall, it would be easier to edit the login.html to:
<head>
  <meta http-equiv="refresh" content="5; URL=https://192.168.10.8/" />
</head>
<body>
  <p>If you are not redirected in five seconds, <a href="192.168.10.8/">click here</a>.</p> I
</body>
And this will redirect users to your Xammap Server. Before changing the html file, I would first test to see if you are getting the default page when connecting to the Hotspot first!
I tried this. But still, it doesn't work when the user connects to the hotspot(192.168.6.0). They get login page but after 5 seconds it refresh and the URL changes to 192.168.10.8 on the page it says "This site can't be reached"

Who is online

Users browsing this forum: No registered users and 9 guests