1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Can't login when device has hostname six or fewer characters long

Discussion in 'Asuswrt-Merlin' started by tdev, Jul 7, 2018.

  1. tdev

    tdev New Around Here

    Joined:
    Jul 7, 2018
    Messages:
    5
    I have two Asus RT-N66Us both with 380.70. They get their IPs via DHCP. On the DHCP server, which is also the DNS server for the local network, I gave them their IP addresses and the hostnames wap1 and wap2. I then went to:

    http://wap1/

    ...and attempt to login. After submitting user and pass (whether right or wrong), I was redirected right back to the login page.

    This didn't happen when you access them via IP address, i.e. http://192.168.x.y/. So after some experimenting I figured out that this would happen whenever the devices' hostnames were six characters or less. Trying to login to http://abcdef/ didn't work and just redirected back to the login page, but http://abcdefg/ worked fine.

    Is there a reason for this, is it a bug that's gone unnoticed, or have I done something wrong I haven't figured out yet?
     
  2. Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!
  3. tdev

    tdev New Around Here

    Joined:
    Jul 7, 2018
    Messages:
    5
    I discovered that logging in when the device has a hostname 6 characters or less works if you follow the hostname with the local domain, e.g.:

    http://wap1.mydomain.com/

    Whereas, as stated before, you can't login here:

    http://wap1/

    And trying to get around it by logging in at the first address and then going here:

    http://wap1/index.asp

    ...redirects you to the login page.

    Anyone?
     
    Last edited: Jul 9, 2018
  4. kfp

    kfp Very Senior Member

    Joined:
    Jun 26, 2014
    Messages:
    707
    Purely speculation, but I think it’s because the HTTP header ‘Referer’ is too short.
    When you navigate to http://abcde, httpd would redirect you to the login page with ‘Referer: abcde’, and there’s probably a check for it and only accepts domains longer than 5 chars, as to why, I don’t know.

    Edit: you can test this by navigating to http://wpa1/index.asp but with a browser extension to overwrite the ‘Referer’ header with 12345 and 123456
     
    Last edited: Jul 9, 2018
  5. tdev

    tdev New Around Here

    Joined:
    Jul 7, 2018
    Messages:
    5
    Turns out this isn't a problem in the LTS fork, so I'm all set.
     
Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!