OpenWRT 24.10: changing default IP from cmd line

Hello:

In an attempt to put a RPi 3B+ to use, I downloaded and set up OpenWRT (24.10.0, r28427-6df0e3d02a).

I did this by dd'ing the image to a 32Gb micro sdcard, no browser involved.

It boots properly and but there is the problem of the OpenWRT default IP (192.168.1.1) which conflicts with my FO router IP which is also 192.168.1.1.

I could edit the setting in rootfs/etc/* (?) but I don't know which ones to change.

Please advise.

Best,

JHM

For me it is in /etc/config/network under config interface 'lan', change:

	option ipaddr '192.168.6.1'

Do not forget to reboot your router and your PC (to get the new IP address)

2 Likes

Hello:

Edited because not enough coffee. 8^°

So ...
This is the /rootfs/etc/config/network file:

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        list ipaddr '127.0.0.1/8'

config globals 'globals'
        option ula_prefix 'fd0b:e675:1de2::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        list ipaddr '192.168.1.1/24'
        option ip6assign '60'

Bear in mind that the Rpi will not be used as a router but in the same way I now use a WD MBL, so it could (?) well be 192.168.1.x.

I will reserve the IP address in the FO router just like I do with the rest of the stuff I plug into a desktop switch.

But I see no option ipaddr '192.168.6.1' that I can change.
Only list ipaddr '192.168.1.1/24'

Thanks for your input.

Best,

JHM

?

In official OpenWrt the network config is located at:

/etc/config/network

?

The poster suggeted you change the default to 192.168.6.1.

So the OpenWrt won't be performing router functionality?

1 Like

Hello:

Fixed it ... 8^)

Followed up on what egc posted and replaced the whole config interface 'lan' section with this:

config interface 'lan'
        option device   'eth0'
        option proto    'static'
        option ipaddr   '192.168.1.15'
        option netmask  '255.255.255.0'
        option ip6assign '60'

No.
Like I mentioned previously, just like my WD MBL.
Works great (save for the low throughput with dropbear) and as the RPi is roughly as underpowered, I thought I'd give OpenWRT a try.

Just in case anyone else comes across a similar issue, this page is very useful:

Once again, thanks to the OpenWRT devs for all the work.

Best,

JHM

@pclinuxer I would have thought you would also need a gateway address on the lan interface ? My config as follows, where my main router is 192.168.5.1

config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.5.5'
option netmask '255.255.255.0'
option ip6assign '60'
option gateway '192.168.5.1'
list dns '192.168.5.1'

also you need to check that the dhcp server is disabled on the lan interface

in /etc/config/dhcp you need the option ignore '1'

config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option ignore '1'

2 Likes

Hello:

Yes.
That would be the Pi-hole+unbound that I run from a VM in my box.
ie: 192.168.1.11

Here is the whole shebang:

root@OpenWrt:~# cat /etc/config/network
 
config interface 'loopback'
 	option device 'lo'
 	option proto 'static'
 	list ipaddr '127.0.0.1/8'
 	option netmask '255.0.0.0'
 
config globals 'globals'
 	option ula_prefix 'fd0b:e675:1de2::/48'
 
config device
 	option name 'br-lan'
 	option type 'bridge'
 	list ports 'eth0'
 	option ipv6 '0'
 
config interface 'lan'
        option proto    'static'  
        option ipaddr   '192.168.1.15'
        option netmask '255.255.255.0'
    	option device   'eth0'
        option gateway '192.168.1.1' 
        list dns '192.168.1.11'
        option delegate '0'
root@OpenWrt:~#

Now, while netdiscover -i eth0 gets me this ...

Currently scanning: 192.168.14.0/16   |   Screen View: Unique Hosts                                                                                  
4 Captured ARP Req/Rep packets, from 4 hosts.   Total size: 240                                                                                      

   IP            At MAC Address     Count     Len  MAC Vendor / Hostname      
--- snip ---
192.168.1.15    b8:27:eb:53:5f:c6      1      60  Raspberry Pi Foundation

... and consequently I can SSH as root ...

$ ssh root@192.168.1.15
--- snip ---
BusyBox v1.37.0 (2025-06-20 20:54:32 UTC) built-in shell (ash)
--- snip ---
 OpenWrt SNAPSHOT, r30135-bbd95c0523
 OpenWrt recently switched to the "apk" package manager!
--- snip ---
root@OpenWrt:~#

... and also ping most anywhere ...

root@OpenWrt:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=117 time=3.232 ms
--- snip ---
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 2.509/2.757/3.232 ms
root@OpenWrt:~#
root@OpenWrt:~# ping www.openwrt.org
PING www.openwrt.org (64.226.122.113): 56 data bytes
64 bytes from 64.226.122.113: seq=0 ttl=48 time=222.584 ms
--- snip ---
--- www.openwrt.org ping statistics ---
6 packets transmitted, 6 packets received, 0% packet loss
round-trip min/avg/max = 222.307/222.464/222.584 ms
root@OpenWrt:~#
root@OpenWrt:~# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=1.280 ms
--- snip ---
--- 192.168.1.1 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.656/0.798/1.280 ms
root@OpenWrt:~# 

... I cannot access the OpenWRT interface with my browser.
ie: via https://192.168.1.15/cgi-bin/luci/

I get an Unable to connect - An error occurred during a connection to 192.168.1.15 notice.

Not only that, there seems to be a problem with how apk is configured:

root@OpenWrt:~# apk search
WARNING: opening from cache https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2710/packages/packages.adb: No such file or directory
WARNING: opening from cache https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/base/packages.adb: No such file or directory
WARNING: opening from cache https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2710/kmods/6.12.33-1-0583bbcb0b02c6e87642118bff0a8b11/packages.adb: No such file or directory
WARNING: opening from cache https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/luci/packages.adb: No such file or directory
WARNING: opening from cache https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/packages/packages.adb: No such file or directory
WARNING: opening from cache https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/routing/packages.adb: No such file or directory
WARNING: opening from cache https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/telephony/packages.adb: No such file or directory
WARNING: opening from cache https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/video/packages.adb: No such file or directory
root@OpenWrt:~#

But, interestingly enough, I can use wget to fetch a file:

root@OpenWrt:~# wget https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2710/packages/packages.adb
Downloading 'https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2710/packages/packages.adb'
Connecting to 151.101.218.132:443
Writing to 'packages.adb'
packages.adb         100% |*******************************| 13296   0:00:00 ETA
Download completed (13296 bytes)
root@OpenWrt:~#

I am at a complete loss here.

Any idea as to what is going on?

TIA.

Best,

JHM

Check the /etc/config/uhttpd file. ISTR that changing the lan IP manually doesnt change the IP that luci is listening on. Might be simplest to set it to

    list listen_http '0.0.0.0:80'
    list listen_http '[::]:80'
    list listen_https '0.0.0.0:443'
    list listen_https '[::]:443'

I'm afraid I've no idea what's wrong with apk though...

Hello:

Hmm ...
No such animal here:

root@OpenWrt:~# ls /etc/config
dhcp      dropbear  firewall  network   network~  system    wireless
root@OpenWrt:~#

I don't think LuCI/the webserver is installed by default.

root@OpenWrt:~# apk info | grep -i luci
WARNING: opening from cache https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2710/packages/packages.adb: No such file or directory
WARNING: opening from cache https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/base/packages.adb: No such file or directory
WARNING: opening from cache https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2710/kmods/6.12.33-1-0583bbcb0b02c6e87642118bff0a8b11/packages.adb: No such file or directory
WARNING: opening from cache https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/luci/packages.adb: No such file or directory
WARNING: opening from cache https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/packages/packages.adb: No such file or directory
WARNING: opening from cache https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/routing/packages.adb: No such file or directory
WARNING: opening from cache https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/telephony/packages.adb: No such file or directory
WARNING: opening from cache https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/video/packages.adb: No such file or directory
root@OpenWrt:~#

Thanks for your input.

Best,

JHM

Did you update the apk cache before trying to search, fetch, etc? If not then apk update should help.

Hello:

[quote="spence, post:10, topic:234882"]
... update the apk cache ...
/quote]
Ahhh .... 8^°
That was it.
I was certain that I had done it but ...
I evidently did not do it after fixing connectivity issues.
Net result? Success!

Thank you very much for your input.
Much obliged.

Best,

JHM

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.