<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 12.03.2015 08:24, Tymon wrote:<br>
</div>
<blockquote cite="mid:tencent_3C8B7F2A7FB08F7C55039390@qq.com"
type="cite">
<div>
<p style="margin: 0px; padding: 0.35em 0px; color: rgb(34, 34,
34); font-family: Verdana, Helvetica, Arial, sans-serif;
line-height: 18px; background-color: rgb(250, 250, 250);"><b><font
size="4">Hi all,</font></b></p>
<p style="margin: 0px; padding: 0.35em 0px; color: rgb(34, 34,
34); font-family: Verdana, Helvetica, Arial, sans-serif;
line-height: 18px; background-color: rgb(250, 250, 250);"><b><font
size="4"> As we all known, the default method to
access the router's administration web page(Luci) is to
type "<a moz-do-not-send="true" href="http://192.168.1.1/"
style="color: rgb(153, 0, 153); text-decoration: none;">http://192.168.1.1</a>"
on the browser. I am curious about how can the router
recognize the<span style="color: rgb(255, 0, 0);">"<a
moz-do-not-send="true" href="http://192.168.1.1/"
style="color: rgb(153, 0, 153); text-decoration:
none;">http://192.168.1.1</a>"</span>as its accessible
site ?<br style="display: inline;">
</font></b></p>
</div>
</blockquote>
<font size="4">This is defined in the webserver configuration, like
in /etc/config/uhttpd</font>. By default the server reacts on
every request the it receives, independently what IP the server has
(0.0.0.0).<br>
<blockquote cite="mid:tencent_3C8B7F2A7FB08F7C55039390@qq.com"
type="cite">
<div>
<p style="margin: 0px; padding: 0.35em 0px; color: rgb(34, 34,
34); font-family: Verdana, Helvetica, Arial, sans-serif;
line-height: 18px; background-color: rgb(250, 250, 250);"><b><font
size="4"> More interesting thing is I used to see
someone type<span style="color: rgb(255, 0, 0);">"admin.myrouter"</span> on
browser(just in LAN network, the router did not connect
WAN to the internet), and he successfully accessed the
administration web page(Luci) on his openwrt router. <br
style="display: inline;">
</font></b></p>
</div>
</blockquote>
<font size="4">For this you need 3 things:<br>
a) You need a DNS-Server on which you must configure an manage
your domain (like *.myrouter). To run it on your router would be
probably the easiest way.<br>
b) You need make shure that your clients use your DNS-Server to
resolve domainnames to IP-addresses. Normaly this is done be
running a DHCP-Server on your router and configure it that way, so
that every client that receives an IP from it also receive the IP
of the DNS server to use (which should be the IP address from a) )<br>
c) Your clients must be configured to use DHCP server to get a
network and IP configuration.<br>
<br>
Doing so your computer (client) will get after boot the
network-configuration (IP-address, network-mask, DNS-server
IP-addresses...) from your DHCP Server. When starting your
webbrowser on your computer and typing <a class="moz-txt-link-rfc2396E" href="http://admin.myrouter">"http://admin.myrouter"</a> the
web-browser will query the DNS-server. The DNS-server will respond
with an IP-address (like 192.168.1.1). So that your web-browser
finally knows to which ip-address it will send its HTTP-request.
Your OpenWrt router will receive the request and show you the
login-mask.<br>
</font>
<blockquote cite="mid:tencent_3C8B7F2A7FB08F7C55039390@qq.com"
type="cite">
<div>
<p style="margin: 0px; padding: 0.35em 0px; color: rgb(34, 34,
34); font-family: Verdana, Helvetica, Arial, sans-serif;
line-height: 18px; background-color: rgb(250, 250, 250);"><b><font
size="4"> Thus my question is how can I make the
OpenWrt router like him ? Do I need to modified the code
of cgi ?</font></b></p>
<p style="margin: 0px; padding: 0.35em 0px; color: rgb(34, 34,
34); font-family: Verdana, Helvetica, Arial, sans-serif;
line-height: 18px; background-color: rgb(250, 250, 250);"><b><font
size="4"> Any hint will be appreciated!</font></b><span
id="_editor_bookmark_start_0" style="display: none;
line-height: 0px;"></span></p>
</div>
</blockquote>
No, you will not need to change the code of the cgi.<br>
<br>
Best regards,<br>
Claudio<br>
<br>
-- <br>
Working on OpenWrt CC for <a
href="http://www.xmodus-systems.de/openwrt">Xmodus GSM Router
XM1710E</a><br>
<br>
</body>
</html>