Can't change lan IP

I was setting up new router, doing DDNS, wireguard, WiFi setting and what’s not and I got to the point where I needed to change lan IP from 192.168.1.1 to 10.0.0.1.

I tried to change it in Luci - after the change there was no DHCP and the router was not available on both old and new IPs. First it reverted back to old IP cause it couldn’t reconnect, but then I did Apply Anyway or something and I was stuck.

Powering off and on didn’t help. Failsafe boot seemed to work but kind of worked as factory reset.

I tried to change it again without all the other changes I did - same result.

I tried to change it in SSH with these commands, as it comes up in Bing results:

uci set network.lan.ipaddr='10.0.0.1'
uci commit network
/etc/init.d/network restart

Still nothing.

I did it again with double quotation mark as it is in openwrt instructions - same result. After network restart there is no DHCP and when I set my PC to 10.0.0.2 manually I still can’t connect to the router. It really feels like a bug.

The router is Linksys MX4300

Openwrt 24.10.2

Let’s see your starting config:

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):

Screenshot 2025-10-20 at 8.14.14 PM

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

And did you follow this guide:

Answering the second part of your question - I did Apply Unchecked way in web interface and I tried SSH instructions.

Here are the commands and output. The router is basically in default configuration, I haven’t noticed any privacy concerns:

root@OpenWrt:~# ubus call system board
{
"kernel": "6.12.57",
"hostname": "OpenWrt",
"system": "ARMv8 Processor rev 4",
"model": "Linksys MX4300",
"board_name": "linksys,mx4300",
"rootfs_type": "squashfs",
"release": {
"distribution": "OpenWrt",
"version": "SNAPSHOT",
"firmware_url": "https://downloads.openwrt.org/",
"revision": "r31857-501f4edb04",
"target": "qualcommax/ipq807x",
"description": "OpenWrt SNAPSHOT r31857-501f4edb04",
"builddate": "1763248256"
}
}
root@OpenWrt:~# cat /etc/config/network

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

config globals 'globals'
option dhcp_default_duid '0004cbba6986d74d496ba3fb15dd74ed1c69'
option ula_prefix 'fd50:3147:3db0::/48'

config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'

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

config interface 'wan'
option device 'wan'
option proto 'dhcp'

config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'

root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
option type 'mac80211'
option path 'platform/soc@0/c000000.wifi'
option band '5g'
option channel '36'
option htmode 'HE80'
option disabled '1'

config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'

config wifi-device 'radio1'
option type 'mac80211'
option path 'platform/soc@0/c000000.wifi+1'
option band '2g'
option channel '1'
option htmode 'HE20'
option disabled '1'

config wifi-iface 'default_radio1'
option device 'radio1'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'

config wifi-device 'radio2'
option type 'mac80211'
option path 'platform/soc@0/c000000.wifi+2'
option band '5g'
option channel '100'
option htmode 'HE80'
option disabled '1'

config wifi-iface 'default_radio2'
option device 'radio2'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'

root@OpenWrt:~# cat /etc/config/dhcp

config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option cachesize '1000'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option nonwildcard '1'
option localservice '1'
option ednspacket_max '1232'
option filter_aaaa '0'
option filter_a '0'

config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option dhcpv6 'server'
option ra 'server'
option ra_slaac '1'
list ra_flags 'managed-config'
list ra_flags 'other-config'

config dhcp 'wan'
option interface 'wan'
option ignore '1'

config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'
option piofolder '/tmp/odhcpd-piofolder'

root@OpenWrt:~# cat /etc/config/firewall
config defaults
option syn_flood1
option inputREJECT
option outputACCEPT
option forwardREJECT

Uncomment this line to disable ipv6 rules

#option disable_ipv61

config zone
option namelan
list   network'lan'
option inputACCEPT
option outputACCEPT
option forwardACCEPT

config zone
option namewan
list   network'wan'
list   network'wan6'
option inputREJECT
option outputACCEPT
option forwardDROP
option masq1
option mtu_fix1

config forwarding
option srclan
option destwan

We need to accept udp packets on port 68,

see https://dev.openwrt.org/ticket/4108

config rule
option nameAllow-DHCP-Renew
option srcwan
option protoudp
option dest_port68
option targetACCEPT
option familyipv4

Allow IPv4 ping

config rule
option nameAllow-Ping
option srcwan
option protoicmp
option icmp_typeecho-request
option familyipv4
option targetACCEPT

config rule
option nameAllow-IGMP
option srcwan
option protoigmp
option familyipv4
option targetACCEPT

Allow DHCPv6 replies

see https://github.com/openwrt/openwrt/issues/5066

config rule
option nameAllow-DHCPv6
option srcwan
option protoudp
option dest_port546
option familyipv6
option targetACCEPT

config rule
option nameAllow-MLD
option srcwan
option protoicmp
option src_ipfe80::/10
list icmp_type'130/0'
list icmp_type'131/0'
list icmp_type'132/0'
list icmp_type'143/0'
option familyipv6
option targetACCEPT

Allow essential incoming IPv6 ICMP traffic

config rule
option nameAllow-ICMPv6-Input
option srcwan
option protoicmp
list icmp_typeecho-request
list icmp_typeecho-reply
list icmp_typedestination-unreachable
list icmp_typepacket-too-big
list icmp_typetime-exceeded
list icmp_typebad-header
list icmp_typeunknown-header-type
list icmp_typerouter-solicitation
list icmp_typeneighbour-solicitation
list icmp_typerouter-advertisement
list icmp_typeneighbour-advertisement
option limit1000/sec
option familyipv6
option targetACCEPT

Allow essential forwarded IPv6 ICMP traffic

config rule
option nameAllow-ICMPv6-Forward
option srcwan
option dest*
option protoicmp
list icmp_typeecho-request
list icmp_typeecho-reply
list icmp_typedestination-unreachable
list icmp_typepacket-too-big
list icmp_typetime-exceeded
list icmp_typebad-header
list icmp_typeunknown-header-type
option limit1000/sec
option familyipv6
option targetACCEPT

config rule
option nameAllow-IPSec-ESP
option srcwan
option destlan
option protoesp
option targetACCEPT

config rule
option nameAllow-ISAKMP
option srcwan
option destlan
option dest_port500
option protoudp
option targetACCEPT

EXAMPLE CONFIG SECTIONS

do not allow a specific ip to access wan

#config rule
#option srclan
#option src_ip192.168.45.2
#option destwan
#option prototcp
#option targetREJECT

block a specific mac on wan

#config rule
#option destwan
#option src_mac00:11:22:33:44:66
#option targetREJECT

block incoming ICMP traffic on a zone

#config rule
#option srclan
#option protoICMP
#option targetDROP

port redirect port coming in on wan to lan

#config redirect
#option srcwan
#option src_dport80
#option destlan
#option dest_ip192.168.16.235
#option dest_port80
#option prototcp

port redirect of remapped ssh port (22001) on wan

#config redirect
#option srcwan
#option src_dport22001
#option destlan
#option dest_port22
#option prototcp

FULL CONFIG SECTIONS

#config rule
#option srclan
#option src_ip192.168.45.2
#option src_mac00:11:22:33:44:55
#option src_port80
#option destwan
#option dest_ip194.25.2.129
#option dest_port120
#option prototcp
#option targetREJECT

#config redirect
#option srclan
#option src_ip192.168.45.2
#option src_mac00:11:22:33:44:55
#option src_port1024
#option src_dport80
#option dest_ip194.25.2.129
#option dest_port120
#option prototcp
root@OpenWrt:~# exit

I would recommend upgrading from the snapshot version you are using now to 24.10.4. When you run the update, let the device reset to defaults by unchecking the “keep settings “ box or using the -n argument on the cli.

Then, try again once the upgrade and reset is complete.

1 Like

When I search for my model it says supported version 24.10.2. Is 24.10.4 supported for my router and how do I find it?

Also after the forced change of lan IP address do not forget to reboot your Client to get a new DHCP address

1 Like

DHCP seemed to be not working after the change - I’m on Windows so I did ipconfig /release /renew and got IP in APIPA range. I set my IP as static in the same subnet and couldn’t reach the router.

Thank you, I did the upgrade with -n parameter and changed the IP in SSH. It worked - I’m connected to 10.0.0.1 and DHCP works too.

Do I have to repeat these steps of the original installation:

8. First Check booted partition

fw_printenv -n boot_part

9. Then install Openwrt to the other partition if booted in slot 1:

mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq807x-linksys_mx4300-squashfs-factory.bin alt_kernel

*If in slot 2:

mtd -r -e kernel -n write openwrt-qualcommax-ipq807x-linksys_mx4300-squashfs-factory.bin kernel

Great!

The point of a dual partition device is to always be able to boot something... upgrades are written in a tick-tock fashion such that the last known good firmware/partition can boot if the newly upgraded one fails. As such, generally just leave it alone since that second partition will be used with your next upgrade cycle.

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.
Thanks! :slight_smile:

1 Like

Glad you got things working. In future, when changing ip addresses and you have issues, consider whether you get ipv6 and try connecting to the router on its ULA address. This has saved my bacon several times. In fact, these days I just use ipv6 for everything unless there's no ipv6 support on the device.

2 Likes

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