Issue: Can't change LAN IP in LuCI. After applying the changes, it fails and comes up with some dialogue box.
Root cause: This happens if the new IP is on a different subnet. It'is known and in fact deliberately designed to prevent the user from accidentally locking themselves out.
Solution: If you are confident that the new IP is correct, you have a few options:
Choose
Apply Unchecked in the dialogue box*/. This will apply the settings without checking if you can access the new
IP or not, so double check the
IP.
If you prefer to not to bypass the check then you can do one of the following immediately (within 30 seconds) after changing the
IP and applying the settings:
Make your PC get a new
IP (for example by disconnecting and reconnecting the cable or the WiFi, or via the terminal), then quickly edit the router
IP in the browser Window to the new
IP.
Have prepared two static IPs for your PC
LAN interface (one on the old
IP range and the other in the new
IP range), then after applying the settings in LuCI you quickly edit the router
IP in the browser Window to the new
IP.
For OpenWrt 24.10 and earlier, connect with
SSH and issue the commands:
uci set network.lan.ipaddr="192.168.2.1"
uci commit network
/etc/init.d/network restart
OpenWrt 25.12 and later uses CIDR notation. Connect with
SSH and issue the commands:
uci set network.lan.ipaddr="192.168.2.1/24"
uci commit network
/etc/init.d/network restart