If you change the address in this field (lan_ip_address="192.168.1.1"), the router will no longer be accessible via http://openwrt.lan/, but only via its IP address. Is there a working solution?
Can you be specific about what you are changing? (provide a code example).
Changing the lan IP should not affect the ability to reach openwrt.lan.
t shouldn't, but it does. That's the question. I change the lan_ip_address="192.168.1.1" field in (uci-defaults) as I wrote, for example, lan_ip_address="192.168.10.1" and access will only be through 192.168.10.1 and never through http://openwrt.lan/.
Are you adding the full CIDR? 192.168.1.1/24?
This is in the template for the uci-default script.
What version of OpenWrt are you using when you make the change? As @dave14305 points out, you need to use CIDR notation if you're using 25.12, but 24.10 and earlier can be straight IP (as the subnet mask is defined separately).
This is for version 25.X; it's not required for versions earlier. Version 25.X currently doesn't build due to bugs in the packages I'm using, and it also doesn't work with letters, only numbers.
Make sure your browser isn’t using any encrypted DNS to bypass the router’s dnsmasq, as only dnsmasq will know how to resolve OpenWrt.lan. Also, confirm that the client is getting the router IP as DNS server.
this work for you? Surely the browser can't just open 192.168.1.1 and not open any other address because of encryption?
If it matters I use dnsmasq-full.
The question was about your browser/host possibly using another DNS server. That is to say that if the system (especially the browser) uses a public (and possibly encrypted, but that's only tangentially relevant) DNS server, it wouldn't look to the OpenWrt router to resolve the request. This would then cause a DNS resolution failure like you're experiencing.
That said... Can you test and/or confirm that the following scenarios work:
- A true default/standard installation of OpenWrt (with only the most minimal changes required to get your device online).
- The above + changing the lan IP address of the OpenWrt router manually (not part of the firstboot scripts)
- A customized build of OpenWrt (i.e. adding whatever packages you need) but without modifying the firstboot script.
- The above + changing the lan IP address of the OpenWrt router manually
If all of that works, but the following does not:
- standard/default image with no added pacakges and only the OpenWrt lan IP changed in the firstboot script
we should look at the configs that result from the non-working situation and #2.
Browsers don't use anything like that. I also installed an HTTPS DNS Proxy with forced assignment of the router's DNS to everything connected to the router. I tried various options, including changing the script provided by the website (uci-defaults) and creating my own UCI list. Any change to the IP address results in the inability to access the router via http://openwrt.lan/.
If you change the IP, you can access the router via http://openwrt.lan/?
I can, in 24.10.x, 25.12.x and master/snapshot.
However if you specify a hostname in the system config, this will override the default "openwrt".
For example, on my test router, I have:
root@meshnode-8ecb:/tmp# uci show system
system.@system[0]=system
system.@system[0].hostname='meshnode-8ecb'
system.@system[0].timezone='GMT0'
system.@system[0].zonename='UTC'
system.@system[0].ttylogin='0'
system.@system[0].log_size='128'
system.@system[0].urandom_seed='0'
system.ntp=timeserver
system.ntp.enabled='1'
system.ntp.enable_server='0'
system.ntp.server='0.openwrt.pool.ntp.org' '1.openwrt.pool.ntp.org' '2.openwrt.pool.ntp.org' '3.openwrt.pool.ntp.org'
root@meshnode-8ecb:/tmp#
And if I ping the hostname with .lan at the end:
root@meshnode-8ecb:/tmp# ping -c 4 meshnode-8ecb.lan
PING meshnode-8ecb.lan (192.168.111.1): 56 data bytes
64 bytes from 192.168.111.1: seq=0 ttl=64 time=0.077 ms
64 bytes from 192.168.111.1: seq=1 ttl=64 time=0.134 ms
64 bytes from 192.168.111.1: seq=2 ttl=64 time=0.118 ms
64 bytes from 192.168.111.1: seq=3 ttl=64 time=0.147 ms
--- meshnode-8ecb.lan ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.077/0.119/0.147 ms
root@meshnode-8ecb:/tmp#
But if I ping openwrt.lan:
root@meshnode-8ecb:/tmp#
root@meshnode-8ecb:/tmp# ping -c 4 openwrt.lan
ping: bad address 'openwrt.lan'
root@meshnode-8ecb:/tmp#
Is this what is happening to you?
Show us the output of uci show system and lets see...
It can also be overridden in the network config, but lets see the system config first.
How do you do?
root@CCMC-RAX3000M:~# uci show system
system.@system[0]=system
system.@system[0].hostname='CCMC-RAX3000M'
system.@system[0].timezone='EET-2EEST,M3.5.0/3,M10.5.0/4'
system.@system[0].ttylogin='0'
system.@system[0].log_size='128'
system.@system[0].urandom_seed='0'
system.@system[0].zonename='UTC'
system.ntp=timeserver
system.ntp.enabled='1'
system.ntp.enable_server='0'
system.ntp.server='0.openwrt.pool.ntp.org' '1.openwrt.pool.ntp.org' '2.openwrt.pool.ntp.org' '3.openwrt.pool.ntp.org'
root@CCMC-RAX3000M:~#
Are you telling me that the parameter
system.@system[0].hostname='CCMC-RAX3000M'
overrides the router's domain name and therefore doesn't work?
Very well thanks. And you?
Oh! you mean how to override hostname in network config! ![]()
You can set a different hostname for each network zone. eg:
uci set network.lan.hostname='myrouter-lan'
or
uci set.network.wan.hostname='mmyrouter-wan'
Yes.
try pinging it. ie:
ping -c 4 CCMC-RAX3000M.lan
The default hostname is openwrt
You are deliberately setting it to CCMC-RAX3000M.
Try the following:
uci set network.lan.hostname='myrouter'
service network restart
You will loose connection for a few seconds (probably)
Now try pinging myrouter.lan
But then I could access http://ccmc-rax3000m.lan/ or https://ccmc-rax3000m.lan/, but that doesn't work here either. This is what's confusing. I understand that multiple routers on OpenWRT shouldn't work with the same IP and DNS.
PING CCMC-RAX3000M.lan (192.168.10.1): 56 data bytes
64 bytes from 192.168.10.1: seq=0 ttl=64 time=0.156 ms
64 bytes from 192.168.10.1: seq=1 ttl=64 time=0.170 ms
64 bytes from 192.168.10.1: seq=2 ttl=64 time=0.166 ms
64 bytes from 192.168.10.1: seq=3 ttl=64 time=0.168 ms
This is if you're pinging from the router. If you're pinging from a computer, the response comes via IPv6, but browser access doesn't work.
It is all working as designed. The hostname you set is being resolved.
I don't understand what you mean by this. Perhaps you can try to explain what you are trying to do?
let's take a look at your complete config so that we can understand the whole context:
Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button (red circle; this works best in the 'Markdown' composer view in the blue oval):
![]()
Remember to redact passwords, VPN keys, MAC addresses and any public IP addresses you may have:
ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall
cat /etc/config/uhttpd
cat /etc/config/system
I want to access the Luci interface using an internet browser, but not via an IP address.