Editing /etc/config files directly not working - missing a step?

So I have two Identical routers. I scp'd a few files from /etc/config from the working router to the new router (via a PC). I edited /etc/config/network file on the new router to set the new IP address for the LAN. I saved the file and then issued a restart command. Now I cannot access the router. I cannot ping the router. The router is running. Is there some command I need to run after I manually edit any /etc/config files?

There's a higher probability to mess up the settings editing configs manually.
Recommended method to configure OpenWrt is UCI:
https://openwrt.org/docs/guide-user/base-system/uci#command-line_utility

You need to restart/reload corresponding services to apply the changes.

Did you try to renew the DHCP settings on the PC that you are using to access the router?

Yes. I even set the IP on the PC to a several addresses, including the default, to see if I could get back into the router. Still no joy.

Then most likely there was some unrecoverable mistake in the configuration that left the device without network settings.
Either connect via console to fix it, or reset to factory defaults and configure again.

UCI command is cumbersome. It's far faster to edit the config files directly with VI.

Do I have to restart/reload corresponding service to apply changes permanently? Editing, saving, and restarting/rebooting the router is insufficient?

Then most likely there was some unrecoverable mistake in the configuration that left the device without network settings.
Either connect via console to fix it, or reset to factory defaults and configure again.

All I really did was edit /etc/config/network and change the IP address from 10.3.17.1 to 10.3.9.1 (17 -> 9), save the file, and restart/reboot the router. Can't see how that goofs the router unless /etc/config files are not really the permanent config files and there is another command I must run to make the changes permanent.

UCI:

  • Can apply the changes in the runtime.
  • Has rollback.

You have just shot yourself in the foot using it.

You have just shot yourself in the foot using it.

If changing the IP from 10.3.17.1 to 10.3.9.1 in the /etc/config/network using VI (changed the 17 to a 9) is the actual cause then it shows how poorly the openWRT configuration system is implemented.

Blaming someone or something is pointless.
What is important is learning to not repeat your mistakes.

Another possible explanation is malfunction of memory/storage/filesystem.
It could be either temporary, or permanent.

1 Like

This is the procedure and I have used it many times too. However there is always the possibility of some mistake that goes unnoticed and you find yourself locked outside.

3 Likes