I've neveru used the GUI backup tool so I don't know. But I assume it's just backing up the config file. Which is completely useless. The Telenor firmware always boots from factory default.
You'll need to do what @anon89577378 suggests: Read and save each /dev/mtdX device, and then copy it out to a safe storage outside the router. There is no USB port so network the only option. I suggest using scp from a connected PC.
Temporarily storing the copies in /tmp is fine since this is a ramdisk. Note that you might need to do one-by-one partition and delete the /tmp copies after transferring to avoid running out of space (i.e. ram). It might also help compressing the images before transfer, using something like
to get the full list of partitions and the size of each. Observe that mtd0 ("ALL") is special, covering all the flash including all the other partitions. It's still useful to have a copy of it as there are some holes with content, as I've documented.
Did a backup of all the partitions, including "ALL". What is the difference between mtd0 and mtd0ro?
Flashed ZyXEL's latest FW. This went fine and the device seemed mostly to revert to stock settings. There are a couple of things hanging around, even after I perform a reset to defaults on the zyxel FW:
The Telenor certificate is still in the device store and selected under TR-069. If I delete it, it comes back if I do another reset to defaults.
APN 1 (which is the default) is set to IP Passthrough. This seems like a strange default for a device that is supposed to be a router. I think this too is somehow left over from the ISP FW.
I get no Internet for any clients connected to the Wifi of the router, but clients connected to the ethernet port do. Can't really find anything that can account for that. Anyone know if this is by design, or how this can be fixed?
I have been using @bmork's tool to get the supervisor password, but I also wanted to find the password for the admin user, and I found a trick to do that:
Download the /data/zcfg_config.json and find the encrypted string of the default password for the admin user. It starts with encrypted and includes what looks like base64 (but is not). If you then enter this encrypted string into the Dynamic DNS password of the Web GUI, the FW will decrypt it to the cleartext value. This is not my discovery. All credit goes to Thomas Rinsma (https://th0mas.nl/2020/03/26/getting-root-on-a-zyxel-vmg8825-t50-router/). This apparently works for all encrypted stings.
Thanks, I have done that. But in /dev there are both mtd0 and mtd0ro eg. All the mtd partitions exist in pairs. I was wondering what was the difference between them.
root@NR7101:~# ls -laX /dev/mtd*
crw-r--r-- 1 root root 90, 0 Jan 1 1970 /dev/mtd0
crw-r--r-- 1 root root 90, 1 Jan 1 1970 /dev/mtd0ro
crw-r--r-- 1 root root 90, 2 Jan 1 1970 /dev/mtd1
crw-r--r-- 1 root root 90, 3 Jan 1 1970 /dev/mtd1ro
crw-r--r-- 1 root root 90, 4 Jan 1 1970 /dev/mtd2
crw-r--r-- 1 root root 90, 5 Jan 1 1970 /dev/mtd2ro
crw-r--r-- 1 root root 90, 6 Jan 1 1970 /dev/mtd3
crw-r--r-- 1 root root 90, 7 Jan 1 1970 /dev/mtd3ro
crw-r--r-- 1 root root 90, 8 Jan 1 1970 /dev/mtd4
crw-r--r-- 1 root root 90, 9 Jan 1 1970 /dev/mtd4ro
crw-r--r-- 1 root root 90, 10 Jan 1 1970 /dev/mtd5
crw-r--r-- 1 root root 90, 11 Jan 1 1970 /dev/mtd5ro
crw-r--r-- 1 root root 90, 12 Jan 1 1970 /dev/mtd6
crw-r--r-- 1 root root 90, 13 Jan 1 1970 /dev/mtd6ro
crw-r--r-- 1 root root 90, 14 Jan 1 1970 /dev/mtd7
crw-r--r-- 1 root root 90, 15 Jan 1 1970 /dev/mtd7ro
crw-r--r-- 1 root root 90, 16 Jan 1 1970 /dev/mtd8
crw-r--r-- 1 root root 90, 17 Jan 1 1970 /dev/mtd8ro
crw-r--r-- 1 root root 90, 18 Jan 1 1970 /dev/mtd9
crw-r--r-- 1 root root 90, 19 Jan 1 1970 /dev/mtd9ro
brw-r--r-- 1 root root 31, 0 Jan 1 1970 /dev/mtdblock0
brw-r--r-- 1 root root 31, 1 Jan 1 1970 /dev/mtdblock1
brw-r--r-- 1 root root 31, 2 Jan 1 1970 /dev/mtdblock2
brw-r--r-- 1 root root 31, 3 Jan 1 1970 /dev/mtdblock3
brw-r--r-- 1 root root 31, 4 Jan 1 1970 /dev/mtdblock4
brw-r--r-- 1 root root 31, 5 Jan 1 1970 /dev/mtdblock5
brw-r--r-- 1 root root 31, 6 Jan 1 1970 /dev/mtdblock6
brw-r--r-- 1 root root 31, 7 Jan 1 1970 /dev/mtdblock7
brw-r--r-- 1 root root 31, 8 Jan 1 1970 /dev/mtdblock8
brw-r--r-- 1 root root 31, 9 Jan 1 1970 /dev/mtdblock9
So for every mtdn there is a mtdnro and mtdblockn-1. These might all be different names for the same thing, but I noticed that @bmork used the mtd0ro in his example on how to back up all the partitions, but neither you nor him used that when backing up individual partitions.
mtdro are read-only devices mapping to the same partitions as their mtd counterparts. Extra safe-guard against accidents.
The unique device certificate and private key is stored in the "Factory" partition. If you delete this certificate then you'll have to restore it from backup if you ever want to make the device work with Telenor again. And if you mess up this partition then you'll probably have a brick. I don't see any reason to risk that. Is there any harm in having the certificate available?
Yes, the wifi is not meant for normal use. I wouldn't bother with it. Use a second indoor router for wifi.
I agree; it does no harm. I am more concerned if there are things left in iptables etc. that might either compromise the device or allow it to be managed or accessed remotely. If you know of anything in particular to check, please let me know.
I did set the DebugFlag to 0x1 as you suggested, and this seems to persist across boots with the stock V4 firmware. Can you explain what the CheckBypass flag does?
I have verified connectivity with one of my data SIMs so the time is fast approaching to install this device in its intended location. I am also considering painting it to match the building it will be mounted on.
Thanks for all your help so far. I will keep you updated on progress
The persistent state surviving firmware upgrades is the bootloader variables stored in "Config", the factory programmed device specific settings in"Factory" and whatever is stored in "data". The last one is the only place where OS config stuff could be saved. But I don't think there is anything there since Telenor always boots it from factory default.
Yes, and then there is all the stuff stored on the modem module. But except for some APNs etc, I don't think you'll find anything operator specific there.
A warning about the DebugFlag trick if you keep running the ZyXEL firmware: This is abusing a pretty obvious bug in the ZyXEL init scripts. They could fix that with any new release, disabling your access to the bootloader.
I believe CheckBypass tells the bootloader to skip image validation. Optimizing boot by only validating the firmware images when they've been updated. Note that the ZyXEL firmware never writes anything to the "Kernel" or "Kernel2" partitions, except for firmware upgrades-
Sorry to get inside this thread all of a sudden. im gonna use a ROOter version of openwrt, and im trying to understand how to use openwrt in a safe way.
I have a Normal Zyxel NR7101 no brand, so whit normal stock firmware. Actually i have
100ABUV5C0 firmware version. Upgraded module whit RG502QEAAAR01A04-R11A03.
A friend did a try whit RG502QEAAAR11A03-A06 module firmware, but was having problems.
Can i know best way to set it up to openwrt, either by ssh or gui, and how i can actually go back to stock firmware in a safe way?
Also the only module firmware i can use is those given by zyxel, or i could use those provided by Quectel?
Clearing CheckBypass ensures that the bootloader validates the image. Caveat: If something is wrong, then it will copy the image in Kernel2 into Kernel and retry. This could revert to a very old OEM image, or whatever you have in Kernel2.
You can also use this for a simplfied revert to OEM if you believe you have a good OEM image in Kernel2. Then you could clear CheckBypass and erase Kernel, letting the bootloader clean up on next boot
I see that you got it (sort of) working. Just for completeness: This part is exactly like making any other QMI device working. I have no better intstructions than the generic 3G/LTE instructions in the Wiki.
This can mostbly be considered informational debug, despite the scaring stack trace. The TX queue timeout for usbnet devices is set to 5 seconds by default. Which usually is long enough. You don't want to wait any longer to transmit a packet. But occasional failures to meet that deadline is still expected for any mobile device. This could be casued by some error, like a firmware lockup, but more likely it's just a temporary radio issue.
At least in the original firmware, setting the band to "AUTO" included LTE+5G NSA , thus I got better speed than setting it to LTE only. However, doing this from OpenWrt picocom, my speed stays LTE-ish.
Also tried:
AT+QNWPREFCFG= "mode_pref",LTE:NR5G
AT+QNWPREFCFG="policy_band"
AT+QNWPREFCFG="rat_acq_order",NR5G:LTE
AT+QNWPREFCFG="nr5g_disable_mode",1
OK
AT+CFUN=0
OK
AT+QMBNCFG="AutoSel",0
OK
AT+QMBNCFG="Deactivate"
ERROR
AT+QMBNCFG="Deactivate"
ERROR
AT+QMBNCFG="select","ROW_Generic_3GPP_PTCRB_GCF"
OK
AT+CFUN=1,1
OK
Then, the picocom disconnected, the modem came back after 2 minutes and I suddenly got 200 MBit of 5G-NSA speed :-).
@bmork Thanks for your help, much appreciated. After fiddling with the above mentioned AT+ commands and the manual from Quectel, my 5G-NSA speed is back and everything works fine under OpenWrt. I've got incoming connections on the T-Mobile "internet.t-d1.de" APN and DynDNS running. Very much thank you again!