[OpenWrt-Devel] How to Custom admin page on openwrt ?

Claudio Thomas ct at xmodus-systems.de
Thu Mar 12 04:26:04 EDT 2015


On 12.03.2015 08:24, Tymon wrote:
>
> *Hi all,*
>
> *       As we all known, the default method to access the router's
> administration web page(Luci)  is to type "http://192.168.1.1
> <http://192.168.1.1/>" on the browser. I am curious about how can the
> router recognize the"http://192.168.1.1 <http://192.168.1.1/>"as its
> accessible site ?
> *
>
This is defined in the webserver configuration, like in
/etc/config/uhttpd. By default the server reacts on every request the it
receives, independently what IP the server has (0.0.0.0).
>
> *       More interesting thing is I used to see someone
> type"admin.myrouter" 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.
> *
>
For this you need 3 things:
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.
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) )
c) Your clients must be configured to use DHCP server to get a network
and IP configuration.

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 "http://admin.myrouter" 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.
>
> *       Thus my question is how can I make the OpenWrt router like him
> ? Do I need to modified the code of cgi ?*
>
> *       Any hint will be appreciated!*‍
>
No, you will not need to change the code of the cgi.

Best regards,
Claudio

-- 
Working on OpenWrt CC for Xmodus GSM Router XM1710E
<http://www.xmodus-systems.de/openwrt>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150312/82907d80/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list