i am running Openwrt in a x86 PC and i would like to ask how can i reset to factory defaults through the command line, without re-installing, please?
I have lost connectivity due to wrong config, but i got access to it by the console.
With an x86 PC it might be more difficult than usually, as to my knowledge the x86 based firmwares deviate from the normal OpenWrt practice of having a read-only firmware and a read-write overlay with settings, sas they have just a normalwritable fiesystem. So I am not sure if there is a way of resetting it without reinstalling...
you have not shared your current wrong /etc/config/network yet but if you want something very simple just to have access you need the very basics from your existing network file:
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'xxxx' # <- you'll see your ula prefix
option packet_steering '1'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0' # <- depending on your hardware layout you may want to add additional interfaces via extra 'list ports 'ethX' lines
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.1.1' # <- this is the factory default, obviously you can change
option netmask '255.255.255.0'
remove all other lines then enter in cli:
service network restart
You might still run "df -h" on console and see if you have overlay there or not.
If you have, you might be able to reset to defaults as slh said above
("firstboot" would be the command)
I am sorry, to have found a reason, to revive this thread zombie
. The actual „how“ was not answered.
So, an x86 with squash filesystem can be reset - acknowledged.
The exciting (unanswered) question for me is still: what is the official reset method on x86 (64)?
I found by coincidence, that I can attach an USB keyboard and regular monitor to x86 hardware and once OpenWRT is booted, I can press „ENTER“, to open up an interactive console, where I can run
firstboot && reboot now
(Edit: just noticed: besides that console shell, also the official OpenWRT failsafe boot mode is available on x86, when having keyboard and monitor attached: at boot time, a GRUB boot menu waits for a few seconds and shows an extra option for failsafe booting, which has to be selected manually via keyboard.)
Now, is that the offical x86 soft reset method, when using squashFS? Or is there anything else (with even less interaction)?