Login page problem
RouterOS Scripting and API

25 posts   •   Page 1 of 1
salytwo
Frequent Visitor
Frequent Visitor
 
Posts: 89
Joined: Mon Apr 18, 2011 8:53 am

Login page problem

by salytwo » Sun Apr 24, 2011 2:58 pm

I setup hotspot successfully but if I entered correct user name and password in login page it going to refreshed in very quick manner it let my browser crazy. I think it is redirected problem because if wrong user info was entered it give you correct feedback.

I deleted and created the hotspot many times but no benefit.

Can you guide me to a solution?
thanks

SurferTim
Forum Guru
Forum Guru
 
Posts: 4637
Joined: Mon Jan 07, 2008 11:31 pm
Location: Miramar Beach, Florida

Re: Login page problem

by SurferTim » Sun Apr 24, 2011 3:05 pm

Hi salytwo. What URL or IP are you trying when you get this response? Try http://www.google.com.

Have you changed the "hotspot/login.html" document in the router?

This should be under General, not Scripting. But since it is Sunday and we are already here...

I presume you figured out the "dns-name" problem.

salytwo
Frequent Visitor
Frequent Visitor
 
Posts: 89
Joined: Mon Apr 18, 2011 8:53 am

Re: Login page problem

by salytwo » Sun Apr 24, 2011 4:15 pm

Hi SurferTim

I used www.almasila2.com then I changed to www.gg.com. All previous URL with 192.168.1.1. after that I removed all URL and leave only IP of hotspot server which is 192.168.1.1 but not benefit.

I reset HTML because I thought it is from my altered login page but still same problem however I alter only the logo and sentences above the text box of username and text of all rights are reserved.

I got This URL:

http://192.168.1.1/login?dst=http%3A%2F ... gle.com%2F

I use CHAP.

I appreciate your co-operation.

thanks

SurferTim
Forum Guru
Forum Guru
 
Posts: 4637
Joined: Mon Jan 07, 2008 11:31 pm
Location: Miramar Beach, Florida

Re: Login page problem

by SurferTim » Sun Apr 24, 2011 4:29 pm

The link in your browser address bar looks correct.

The first URL you tried gives me a "server not found" error. The second one should be ok if your dns is working ok. Try this ip address with your browser to get the login page. This should be the ip for http://www.gg.com. If this works, then look at the settings in "/ip dns"
http://80.93.161.12

ADD: If the dns settings were not correct, you should use the network "repair connection" function in your clients. Otherwise, they will continue to use the old settings until the dhcp lease is renewed (36 hours from issue if the default expiration was not changed) in the client computer.

salytwo
Frequent Visitor
Frequent Visitor
 
Posts: 89
Joined: Mon Apr 18, 2011 8:53 am

Re: Login page problem

by salytwo » Sun Apr 24, 2011 5:21 pm

The URL I gave is not real not existed however Should I give it an existed website?
I think using 192.168.1.1 is enough Am I correct?
when disabling hotspot then use the ip 192.168.1.1 at the browser I get the mikrotik documentation

tnx

SurferTim
Forum Guru
Forum Guru
 
Posts: 4637
Joined: Mon Jan 07, 2008 11:31 pm
Location: Miramar Beach, Florida

Re: Login page problem

by SurferTim » Sun Apr 24, 2011 5:36 pm

salytwo wrote:The URL I gave is not real not existed however Should I give it an existed website?
I think using 192.168.1.1 is enough Am I correct?
when disabling hotspot then use the ip 192.168.1.1 at the browser I get the mikrotik documentation

The URL/IP should exist if you want the login page to work right. I do not recommend using 192.168.1.1 (the hotspot interface ip or url) as a address to get the login page. That could cause a nasty re-entrant situation, like
You: "I want to login"
AP: "You are logged in"
You: "OK, then I want to login"
AP: "You are logged in"
You: "Ok, then I want to login"

Try the ip I gave you above for the gg.com site to get the login page. That is where you should end up after you login.

salytwo
Frequent Visitor
Frequent Visitor
 
Posts: 89
Joined: Mon Apr 18, 2011 8:53 am

Re: Login page problem

by salytwo » Tue Apr 26, 2011 2:06 pm

When I tried ip of google 72.125.130.148, the login page still load for long time with waiting for google.com at the status bar.
The IP above guide you to google page if place it in the address bar.
My DNS setting is correct I mean hear public DNS not local DNS I have no local DNS running in my network, Really I get very tired from this issue.

what you think?

thanks alot

SurferTim
Forum Guru
Forum Guru
 
Posts: 4637
Joined: Mon Jan 07, 2008 11:31 pm
Location: Miramar Beach, Florida

Re: Login page problem

by SurferTim » Tue Apr 26, 2011 2:36 pm

Sometimes the login page takes a few seconds to load.
Can you login and go to Google using the ip address?
If that is correct, check "/ip dns". Insure the servers are correct and "allow-remote-requests=yes".
If you can't login or get the Google page, then check your log first to see if there is a clue there.

salytwo
Frequent Visitor
Frequent Visitor
 
Posts: 89
Joined: Mon Apr 18, 2011 8:53 am

Re: Login page problem

by salytwo » Tue Apr 26, 2011 3:09 pm

Dear SurferTim

I am using hotspot without webproxy I disabled web proxy and its cache to get L7 rules works. but I faced this problem of login page.

Plz see the attache pic and guide me to correct this trouble if you need more details I will hand it to you

thanks
Attachments
problem.JPG
problem.JPG (83.89 KiB) Viewed 4011 times

SurferTim
Forum Guru
Forum Guru
 
Posts: 4637
Joined: Mon Jan 07, 2008 11:31 pm
Location: Miramar Beach, Florida

Re: Login page problem

by SurferTim » Tue Apr 26, 2011 3:22 pm

Try removing the "dns-name" entry for the hotspot profile. Try it again with that entry blank. That will mess up the dns for http://www.google.com and the hotspot.

ADD: Did you change the ip for the hotspot address? Change that back to the ip assigned to that localnet (192.168.1.1). When I said try http://www.google.com and that ip, I meant in your browser address bar, not these settings.

salytwo
Frequent Visitor
Frequent Visitor
 
Posts: 89
Joined: Mon Apr 18, 2011 8:53 am

Re: Login page problem

by salytwo » Tue Apr 26, 2011 4:48 pm

I tried removing DNS name and set IP of my local interface but no benefit.
I named local interface as LAN and public interface as WAN I thinks naming has no effect.

SurferTim
Forum Guru
Forum Guru
 
Posts: 4637
Joined: Mon Jan 07, 2008 11:31 pm
Location: Miramar Beach, Florida

Re: Login page problem

by SurferTim » Tue Apr 26, 2011 4:59 pm

Can you post "/ip hotspot user" and "/ip hotspot user profile"?
What I am looking for is the profile for the user matches a profile in "/ip hotspot user profile".

If you have not already, you should enable debug logging for the hotspot.
Code: Select all
/system logging
add topics=hotspot,debug action=memory

Then try the login again and then check the log.

salytwo
Frequent Visitor
Frequent Visitor
 
Posts: 89
Joined: Mon Apr 18, 2011 8:53 am

Re: Login page problem

by salytwo » Tue Apr 26, 2011 5:29 pm

here you are


[admin@MikroTik] /ip hotspot user>> print
Flags: X - disabled, D - dynamic
# SERVER NAME ADDRESS PROFILE UPTIME
0 hotspot1 admin default 8m13s
1 hotspot1 salim userprofile 45m12s
2 hotspot1 salim2 userprofile 6h28m11s
3 hotspot1 abdurrahm... userprofile 0s
4 hotspot1 ali.alzub... userprofile 0s
5 hotspot1 hr.contro... userprofile 0s
6 hotspot1 khalid.sa... userprofile 0s
7 hotspot1 mohammed userprofile 1m11s
8 hotspot1 nabeel.bi... userprofile 9s
9 hotspot1 omerabobaker userprofile 0s
10 hotspot1 sabri.karama userprofile 0s
11 hotspot1 saeed.hamran userprofile 0s
12 hotspot1 saleh.krees userprofile 0s
13 hotspot1 yahya.jopan userprofile 3m7s
14 hotspot1 user default 11s


user profile



[admin@MikroTik] /ip hotspot user profile>> print
Flags: * - default
0 * name="default" idle-timeout=none keepalive-timeout=2m
status-autorefresh=1m shared-users=1 transparent-proxy=yes
open-status-page=always advertise=no

1 name="userprofile" address-pool=dhcp_pool1 idle-timeout=none
keepalive-timeout=2m status-autorefresh=1m shared-users=1
transparent-proxy=no

SurferTim
Forum Guru
Forum Guru
 
Posts: 4637
Joined: Mon Jan 07, 2008 11:31 pm
Location: Miramar Beach, Florida

Re: Login page problem

by SurferTim » Tue Apr 26, 2011 5:36 pm

There are a few users that are connecting ok according to the "/ip hotspot user" uptime. Have you enabled the debug logging and tried a login? If you have questions about the log entries, post them here.

salytwo
Frequent Visitor
Frequent Visitor
 
Posts: 89
Joined: Mon Apr 18, 2011 8:53 am

Re: Login page problem

by salytwo » Tue Apr 26, 2011 5:56 pm

I logged this users but now I can not I did not remembered what I did that deny access to login page

I can decide that you do not observe any fault with hotspot so I can move to review any related topic like firewall or nat did you think I am right?

Really I am appreciate your co-operating
thanks bro

SurferTim
Forum Guru
Forum Guru
 
Posts: 4637
Joined: Mon Jan 07, 2008 11:31 pm
Location: Miramar Beach, Florida

Re: Login page problem

by SurferTim » Tue Apr 26, 2011 6:03 pm

If I was certain your hotspot setup was good, that would be the next step. But I am not sure it is. My recommendation would be to remove the current hotspot and start a new install.
Code: Select all
/ip hotspot
remove 0
setup

You should be able to use the default ip/dhcp server/dns settings or something is not right.

salytwo
Frequent Visitor
Frequent Visitor
 
Posts: 89
Joined: Mon Apr 18, 2011 8:53 am

Re: Login page problem

by salytwo » Wed Apr 27, 2011 3:55 pm

I deleted all hotspot entries and start from scratch but same thing after entering login the page still refreshed in quick manner it make the browser like crazy.
I think a L7 rules has an effect.

this hotspot make my eyes surrounded by black ring

tnx

SurferTim
Forum Guru
Forum Guru
 
Posts: 4637
Joined: Mon Jan 07, 2008 11:31 pm
Location: Miramar Beach, Florida

Re: Login page problem

by SurferTim » Wed Apr 27, 2011 4:10 pm

My hotspots put money in my bank account.

Where are you trying to go with your browser to get the login page? I hope you are going to answer that you are using http://www.google.com.

Did you enable the debug logging for the hotspot? Did you check the log after the login attempt? Does the log show that you are logged in ok?

Check the network assignments in your client computer. Does it show the correct ip/subnet/gateway/dns servers? The dns servers should not have the ip of the router (192.168.1.1). They should be full dns servers. I use the dns servers my ISP issued me.

ADD: If you would post the source for the login.html page, that may help. When you get the login page, use the browser "View Source" feature, copy and post it here.

salytwo
Frequent Visitor
Frequent Visitor
 
Posts: 89
Joined: Mon Apr 18, 2011 8:53 am

Re: Login page problem

by salytwo » Wed Apr 27, 2011 5:55 pm

My hotspot make me active but I can not go any where with my browser because its rapidly unstable it like some key in the keyboard still pressed.
I enabled what you told me but I had power switched off in my city so all debugging info erased. and now I can not try hotspot because I need internet running for all users tomorrow I will do.

regard DNS I use DNS of my ISP just like you.

This is my login page source


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>AL-Masila Est. Internet Service > login</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="-1" />
<style type="text/css">
body {color: #737373; font-size: 10px; font-family: verdana;}

textarea,input,select {
background-color: #FDFBFB;
border: 1px solid #BBBBBB;
padding: 2px;
margin: 1px;
font-size: 14px;
color: #808080;
}

a, a:link, a:visited, a:active { color: #AAAAAA; text-decoration: none; font-size: 10px; }
a:hover { border-bottom: 1px dotted #c1c1c1; color: #AAAAAA; }
img {border: none;}
td { font-size: 14px; color: #7A7A7A; }
</style>

</head>

<body>
$(if chap-id)
<form name="sendin" action="$(link-login-only)" method="post">
<input type="hidden" name="username" />
<input type="hidden" name="password" />
<input type="hidden" name="dst" value="$(link-orig)" />
<input type="hidden" name="popup" value="true" />
</form>

<script type="text/javascript" src="/md5.js"></script>
<script type="text/javascript">
<!--
function doLogin() {
document.sendin.username.value = document.login.username.value;
document.sendin.password.value = hexMD5('$(chap-id)' + document.login.password.value + '$(chap-challenge)');
document.sendin.submit();
return false;
}
//-->
</script>
$(endif)

<div align="center">
<a href="$(link-login-only)?target=lv&amp;dst=$(link-orig-esc)">Latviski</a>
</div>

<table width="100%" style="margin-top: 10%;">
<tr>
<td align="center" valign="middle">
<div class="notice" style="color: #c1c1c1; font-size: 9px">Please log on to use AL-Masila Est. Internet service<br />$(if trial == 'yes')Free trial available, <a style="color: #FF8080"href="$(link-login-only)?dst=$(link-orig-esc)&amp;username=T-$(mac-esc)">click here</a>.$(endif)</div><br />
<table width="240" height="240" style="border: 1px solid #cccccc; padding: 0px;" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="bottom" height="175" colspan="2">
<form name="login" action="$(link-login-only)" method="post"
$(if chap-id) onSubmit="return doLogin()" $(endif)>
<input type="hidden" name="dst" value="$(link-orig)" />
<input type="hidden" name="popup" value="true" />

<table width="100" style="background-color: #ffffff">
<tr><td align="right">login</td>
<td><input style="width: 80px" name="username" type="text" value="$(username)"/></td>
</tr>
<tr><td align="right">password</td>
<td><input style="width: 80px" name="password" type="password"/></td>
</tr>
<tr><td>&nbsp;</td>
<td><input type="submit" value="OK" /></td>
</tr>
</table>
</form>
</td>
</tr>
<tr><td align="center"><a href="http://www.almasila.com" target="_blank" style="border: none;"><img src="/img/almasilalogo.jpg" alt="AL-Masila Est." /></a></td></tr>
</table>

<br /><div style="color: #c1c1c1; font-size: 9px">Powered by AL-Masila Est. IT Email:salim.alaidaroos@almasila.com Mob:733041857 Ext:106 &copy; 2011</div>
$(if error)<br /><div style="color: #FF8080; font-size: 9px">$(error)</div>$(endif)
</td>
</tr>
</table>

<script type="text/javascript">
<!--
document.login.username.focus();
//-->
</script>
</body>
</html>

SurferTim
Forum Guru
Forum Guru
 
Posts: 4637
Joined: Mon Jan 07, 2008 11:31 pm
Location: Miramar Beach, Florida

Re: Login page problem

by SurferTim » Wed Apr 27, 2011 6:09 pm

That is the code for the login.html page. I really need to see the login.html "View Source" output from your web browser. It will have all the variables filled in. There will be no $(link-login-only) and other $() variables. Those will be replaced with the correct values. That is what I want to see. I am trying to figure out what you are submitting to the login routine.

Get the login page by using http://www.google.com in your browser address bar , then select "View Source" and copy it. Post that here.

ADD: I found the Mikrortik dhcp-server does add the localnet gateway ip (192.168.1.1) to the client dns server list. I was incorrect about that.

salytwo
Frequent Visitor
Frequent Visitor
 
Posts: 89
Joined: Mon Apr 18, 2011 8:53 am

Re: Login page problem

by salytwo » Mon May 02, 2011 10:38 am

Hello Bro,

I reset my system now I can login without problem but when add layer 7 and mangle to limit download the counter of PCQ in Queue tree not count any thing I think this because of hotspot is enabled.

Am I right?

thanks bro

SurferTim
Forum Guru
Forum Guru
 
Posts: 4637
Joined: Mon Jan 07, 2008 11:31 pm
Location: Miramar Beach, Florida

Re: Login page problem

by SurferTim » Mon May 02, 2011 11:49 am

If you are trying to limit the bandwidth for the hotspot clients, you can use the simple queue in the hotspot service.
Code: Select all
/ip hotspot user profile
set 0 rate-limit="256k/1M"

This sets the bandwidth limits for each logged in client (assigned that user profile) to 256k upload and 1M download.

ADD: I forgot to mention this. If no user profile is assigned to the user, the "default" profile is used. If you attempt to assign a user profile (Group in User Manager, Mikrotik-Group in FreeRADIUS) that doesn't exist, you will get a configuration error message on the login page.
Last edited by SurferTim on Mon May 02, 2011 1:10 pm, edited 1 time in total.

salytwo
Frequent Visitor
Frequent Visitor
 
Posts: 89
Joined: Mon Apr 18, 2011 8:53 am

Re: Login page problem

by salytwo » Mon May 02, 2011 1:10 pm

I need to block some extesions like avi and ohter it possible to use queue tree or only possible for simple tree?

SurferTim
Forum Guru
Forum Guru
 
Posts: 4637
Joined: Mon Jan 07, 2008 11:31 pm
Location: Miramar Beach, Florida

Re: Login page problem

by SurferTim » Mon May 02, 2011 1:14 pm

I would recommend starting a new subject for that question. The users that might know the answer to that question might not read this thread. I limit bandwidth regardless of the upload or download content, so I'm not up to date on that.

salytwo
Frequent Visitor
Frequent Visitor
 
Posts: 89
Joined: Mon Apr 18, 2011 8:53 am

Re: Login page problem

by salytwo » Mon May 02, 2011 1:56 pm

I will.
regard login page:
This is the source code of the page you request from me that is because the problem is took the way to me back:

<html>
<!--
<?xml version="1.0" encoding="UTF-8"?>
<WISPAccessGatewayParam
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://192.168.1.1/xml/WISPAccessGatewayParam.xsd">
<Redirect>
<AccessProcedure>1.0</AccessProcedure>
<AccessLocation></AccessLocation>
<LocationName></LocationName>
<LoginURL>http://192.168.1.1/login?target=xml</LoginURL>
<MessageType>100</MessageType>
<ResponseCode>0</ResponseCode>
</Redirect>
</WISPAccessGatewayParam>
-->
<head>
<title>...</title>
<meta http-equiv="refresh" content="0; url=http://192.168.1.1/login?dst=http%3A%2F%2Fwww.google.com%2F">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>

25 posts   •   Page 1 of 1

Who is online

Users browsing this forum: vstman and 14 guests

It is currently Thu Dec 18, 2014 6:23 pm