Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save theodric/c8f280ead3b5ae1b4b1d6c4cf2d9420e to your computer and use it in GitHub Desktop.
Save theodric/c8f280ead3b5ae1b4b1d6c4cf2d9420e to your computer and use it in GitHub Desktop.
Zyxel NR7101 setup/hacks/tips and tweaks
0. Don't have a SIM card in when you're updating radio firmware or it will bomb out partway through as it changes from internal IP to IP passthrough
1. Disable external IP passthrough mode: Network Setting -> Broadband -> Cellular APN -> #1 -> Modify icon -> "IP Passthrough" slider to off
2. Use "management" Wi-Fi AP as general Wi-Fi AP (with limitations) -> Network Setting -> Bridge1 -> Modify icon -> Move the Wi-Fi AP interface to the pane on the right alongside LAN1
NOTE: by default, once you do the above, the router will happily pass traffic from devices on the Wi-Fi AP to other devices on the LAN1 subnet, but will block traffic originating from the Wi-Fi AP from exiting to the Internet via the LTE side of the device. You can clumsily hack around this by setting another device, e.g. another Wi-Fi AP or Raspberry Pi or Cray supercomputer, as the default gateway for the LAN1 subnet in your DHCP server config, and pointing *that* device at the Zyxel as *its* default GW. This adds additional hops, but enables general use of the Zyxel's inbuilt Wi-Fi AP.
3. Supervisor password allows Linux shell login & additional functions.
cf. https://openwrt.org/toh/zyxel/nr7101 "Supervisor password"
summary: get this https://get.dyn.mork.no/zyxel_pwgen.tar.gz [mirror: https://github.com/theodric/pastebin/blob/master/zyxel_pwgen.tar.gz] and run it under qemu with the getsupervisor.sh script and the system serial number. Login ssh supervisor@the.router.ip.address; password is the string generated by the tool
3a. The supervisor password is also the root password, and that lets you do pretty much whatever including breaking iptables.
4. As Supervisor (see 3 above) turn off fucking annoying flashing orange Wi-Fi LED that the router turns on whenever the Wi-Fi AP is active: `/sbin/zyledctl WIFI off` <- maybe script this
5. **TBD** How to remove the softblock preventing Wi-Fi AP-sourced traffic from accessing the LTE gateway. iptables is doing this, but I haven't yet tried to undo it.
6. As of 2022-06-07 the latest firmware is not in Zyxel's Download Library, but pinned to a forum post here https://support.zyxel.eu/hc/en-us/articles/360021563900-NR7101-Connectivity-issues-and-firmware-fix-for-unsupported-frequency-bands-5G-NSA-B8-N1-
7. 2023-March-16
@giorgix3 commented on this gist with the following information about retrieving SMS:
"You can actually read SMS by talking to the modem via tty. Login via SSH and then:
cat /dev/ttyUSB2 &
echo "AT+CMGR=1" > /dev/ttyUSB2
by changing the number after CMGR=# you can read other messages in the memory. The detailed documentation of the commands to talk to the modem can be found here https://www.quectel.com/wp-content/uploads/2021/05/Quectel_RG50xQRM5xxQ_Series_AT_Commands_Manual_V1.1.pdf "
8. 2023-March-21
Quectel has a video tutorial on using AT commands to read and send SMS here: https://forums.quectel.com/t/how-to-send-and-receive-sms-messages-on-quectel-module/15555
Of note: echo 'AT+CMGL="all"' > /dev/ttyUSB2 dumps all received SMS to the screen at once
This may be a red herring, but I'll say it here anyway: I was only getting hex gibberish on the screen with the AT+CMGR command above until I had issued `echo "AT+CMGF=1" > /dev/ttyUSB2` to the modem.
9. 2023-08-20
@Manu99it discovered a means to obtain supervisor/root password on the newer (post-2022?) hardware/firmware revisions that use a different password generation algorithm:
https://gist.github.com/theodric/c8f280ead3b5ae1b4b1d6c4cf2d9420e?permalink_comment_id=4666079#gistcomment-4666079
"Reading https://th0mas.nl/2020/03/26/getting-root-on-a-zyxel-vmg8825-t50-router/#fnref:1 I understood that all password, even for root and supervisor users are contained into the zcfg_config.json file. Actually in my router accessing this file is much simple: just set up FTP by webgui, access FTP as admin user (I used MiXplorer on Android for example) and zcfg_config.json is just here. The absurd thing: it has rw permission even with admin user! So just open it and copy the encrypted password under the root user (not the default password as per the guide linked, that's the same that you can calculate with the emulator). Now we can decrypt this encrypted password just by using the DynamicDNS as oracle explained in the guide: set a fake DDNS in webgui. Download the backup file. Open the backup file and replace the encrypted password under DynamicDNS with our encrypted password of root user copied before. Now save and restore the file from webgui. Go to ddns settings and just read the password: it's clear. As just as that!"
@bered321
Copy link

The second question pertains to fixing all incoming and outgoing packets from the router at a TTL value of 64. For example, when we connect via Wi-Fi using a phone, the standard TTL of the phone is 64, whereas for a Windows computer, it's 128, and so on. In older versions of Zyxel, this could be fixed with a CLI command, such as "ip adjust-ttl recv/send." For instance, when using the "ping" command, we see TTL: 100 bytes from 192.168.1.33: icmp_req=1, ttl=128, time=2.35 ms. What I need is to set this TTL value to 64 for all incoming and outgoing traffic on the router. This would enable me to use data plans intended for phones.

I see. Maybe with sysctl net.ipv4.ip_default_ttl=64 and for ipv6 sysctl net.ipv6.conf.all.hop_limit=64 as you would do it in standard openwrt. But keep in mind that any changes done, even with root access, won't survive a reboot

On older devices, these changes were retained even after a reboot. When Zyxel and Keenetic separated, it's now available in the new firmware directly through the web interface. If possible, try issuing the commands via Telnet/SSH, such as "interface UsbLte0 ip adjust-ttl send 64," and then attempt to, for example, ping google.com.

@ant-thomas
Copy link

I don't have physical access to my NR7101 as it was installed by my ISP and I don't have the admin password or serial number.

Is it possible to find a way to login without this information?

@theodric
Copy link
Author

theodric commented Feb 1, 2024

I recommend calling your ISP and asking them for the credentials for the device. Given that you have indicated that it is your property, they should be happy to comply with your request.

Just in case you're a Fed, I want to make it explicit that we don't condone any violations of the Computer Fraud and Abuse Act of 1986, thank you

@ispiropoulos
Copy link

Has anyone figured out a way to get the supervisor password on the newer devices with "S22*" serial?

@slippern1
Copy link

Here is an method to flash any nr7101, https://forum.openwrt.org/t/method-to-flash-any-nr7101/168033

@ispiropoulos
Copy link

Has anyone figured out how to use dual APN on one SIM card?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment