What's new

Can login with IP but not hostname

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

First Last

Occasional Visitor
I just installed Merlin and everything is up and running and configured. One problem is I can't login using the hostname but I can using the IP. I get the sign in page and when I put in the credentials it just resets the page; no errors. I can ping the host name and it responds with the correct ip. I don't have https set up for login however, if I turn it on, I can log in with https://<router_host_name>. I can't with just http://<router_host_name> but http://<router_ip> works.

LATEST THOUGHTS: I think this has something to do with lock out, authorization of some sore when hostname=router and port=80. Having a look through the source web.c do_login_cgi() seems to indicate this, although that is only a quick glance.

UPDATE: It's also seems to just be port 80. If I change the port to 8080, I can log in to http://<router_host_name>

UPDATE2: Port 81 works as well.

UPDATE3: Seem that using the hostname "router" plays into it. I can use http://asus_router and this works.

UPDATE4: So using the option to redirect to router.asus.com also works with port 80 and the host name router.

UPDATE5: Ok a little more info.

If I wget using http://router and do another wget using http://router. (a dot at the end) I get the following in Main_Login.asp returned:

var header_info = [{ "host": "router\r", "current_page": "Main_Login.asp", "protocol": "http", "port": 80 }][0];
var header_info = [{ "host": "router.", "current_page": "Main_Login.asp", "protocol": "http", "port":

Notice that "router" returns "router\r" as it's hostname but "router." returns "router.". I'm not sure why it does this but this is what I've found so far.
 
Last edited:
I’ve had this for years, even after a full factory reset it still does it. What’s odd is it used to work a long time ago, no idea what happened to stop it.


Sent from my iPhone using Tapatalk
 
Public hostname can only work if you open your router's webui to the WAN, which is a bad idea.
 
Public hostname can only work if you open your router's webui to the WAN, which is a bad idea.

I (and I’m fairly sure the OP) am talking about the internal hostname that resolves to the LAN IP of the router.

What’s odd is it allows you to see the login page but logging in essentially just refreshes the login page.


Sent from my iPhone using Tapatalk
 
You are talking about router.asus.com and have it enabled here, right?
 

Attachments

  • resolvename.jpg
    resolvename.jpg
    20.1 KB · Views: 185
You are talking about router.asus.com and have it enabled here, right?

That’s not ‘enabling access via a hostname’ that’s redirecting any requests to that specific “special” hostname.
You should be able to login regardless of the hostname used to resolve the local LAN IP of the router (and on some of my Asus routers that works and 1 it doesn’t, but used to).


Sent from my iPhone using Tapatalk
 
I’ve had this for years, even after a full factory reset it still does it. What’s odd is it used to work a long time ago, no idea what happened to stop it.

I'm curious, are you using the name "router" for the hostname?
 
So, keep an eye on my OP as I troubleshoot more. The details are there.

That might get confusing, and I am perhaps speaking out of turn, but I think most people would prefer a more linear chronology...
 
I'm curious, are you using the name router for the hostname?

No, jdbrouter
Interestingly, what does work is a real FQDN that I’ve added to /etc/hosts pointing to its LAN IP. In the public world the same FQDN points to my WAN IP, but if I’m at home it resolves to the routers LAN IP.

I originally wondered if it was related to the HTTPS cert and the domain names that are in that. But I’ve tried renewing that with many variations to no avail.
Once I found the FQDN hack I gave up trying to make the real local domain hostname work.


Sent from my iPhone using Tapatalk
 
That might get confusing, and I am perhaps speaking out of turn, but I think most people would prefer a more linear chronology...

I understand and am happy to comply but personally, the last thing I want to do is scroll through 300 pages of posts to find the answer buried on page 175 ;) I will do both. I'm going to be busy for the next week but I plan on digging through the code and finding the source of the problem (I'm OCD about things like this) when I get time. I want my router to be called "router" and I want to have it on port 80. LOL
 
Then assign router to a DNS entry that is in chain of your DNS. It will resolve the way you want.
 
If I wget with basic authentication using http://router and do another wget using http://router. (a dot at the end) I get the following in Main_Login.asp returned:

var header_info = [{ "host": "router\r", "current_page": "Main_Login.asp", "protocol": "http", "port": 80 }][0];
var header_info = [{ "host": "router.", "current_page": "Main_Login.asp", "protocol": "http", "port":

Notice that "router" returns "router\r" as it's hostname but "router." returns "router.". I'm not sure why it does this but this is what I've found so far.
 
Yes, that's because there is no domain name. If I set the domain name to router, I still have the same problem. I'm convinced it's a bug because:

If I wget using http://router and do another wget using http://router. (a dot at the end) I get the following in Main_Login.asp returned:

var header_info = [{ "host": "router\r", "current_page": "Main_Login.asp", "protocol": "http", "port": 80 }][0];
var header_info = [{ "host": "router.", "current_page": "Main_Login.asp", "protocol": "http", "port":

Notice that "router" returns "router\r" as it's hostname but "router." returns "router."

It seems that the buffer routine that reads the hostname is one character too long as \r is probably coming from the carriage return line feed from reading the header.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top