Thank you
@Special and the other contributors for your instructions!
I have retired my RT-56U from router duty, and replaced it with a RT-AX58U. Instead of living in a drawer, the RT-56U will become a mesh node to extend the wifi coverage at my in-laws.
So, here are the steps I did, for future reference (followed the guide in
https://www.snbforums.com/threads/aimesh-on-rt-ac56u.55732/post-663816)
1. Reset to factory defaults from the web UI. I am running RMerlin 384.5
2. Set an admin password, enable SSH, Format JFFS on next boot + reboot
3. ssh into the router and save the original cfe:
Code:
PC$ ssh [email protected]
[email protected]'s password:
ASUSWRT-Merlin RT-AC56U 384.5-0 Sun May 13 01:52:57 UTC 2018
admin@RT-AC56U-6CB0:/tmp/home/root# cat /dev/mtd0 > original_cfe.bin
admin@RT-AC56U-6CB0:/tmp/home/root# ls -l original_cfe.bin
-rw-rw-rw- 1 admin root 524288 Feb 14 02:06 original_cfe.bin
admin@RT-AC56U-6CB0:/tmp/home/root# exit
Connection to 192.168.1.1 closed.
4. Transfer the saved CFE locally with scp:
5. Make a copy and edit it from RT-AC56U to RT-AC68U:
Code:
PC$ cp original_cfe.bin new_cfe.bin
PC$ dhex new_cfe.bin
Here are the instances where I made changes:
Check that they were saved:
Code:
PC$ strings new_cfe.bin | grep RT-AC
model=RT-AC68U
odmpid=RT-AC68U
6. Get the necessary tools to flash the new AC68U image:
* you can see what the original CFE version is with this command:
Code:
PC$ strings original_cfe.bin | grep bl_version
bl_version=1.0.2.3
* download the latest firmware for RT-AC68U from Asus:
https://www.asus.com/supportonly/rt-ac68u/helpdesk_bios/
I used the current latest version - 3.0.0.4.386_51733
Code:
PC$ cd Downloads/
PC$ unzip FW_RT_AC68U_300438651733.zip
Archive: FW_RT_AC68U_300438651733.zip
inflating: RT-AC68U_3.0.0.4_386_51733-g8eebcd2.trx
In order to get mtd-write (not sure why I can't use dd, but didn't want to risk it), I found mtd-write v2 at this link (
https://mega.nz/#!R4AWkJSQ!pGw1Vl0j6qS9kYhbOtpvsgbKf-VIRfWRw61HhmIqRDM) - use at your own risk. Unrar it:
Code:
PC$ unrar x mtd-write-arm_v2.rar
UNRAR 7.00 freeware Copyright (c) 1993-2024 Alexander Roshal
Extracting from mtd-write-arm_v2.rar
Extracting mtd-write OK
All OK
PC$ ls -l mtd-write
-rw-rw-r-- 1 user user 733422 Jan 1 2011 mtd-write
7. transfer modified CFE + mtd-write v2 + new firmware over to the router.
Note that newer firmwares might not fit into the ramdrive anymore. I tried 386_51733, and it failed to copy at 98%:
Code:
PC$ scp -O ~/Downloads/RT-AC68U_3.0.0.4_386_51733-g8eebcd2.trx [email protected]:.
[email protected]'s password:
RT-AC68U_3.0.0.4_386_51733-g8eebcd2.trx 98% 100MB 2.9MB/s 00:00 ETA
scp: RT-AC68U_3.0.0.4_386_51733-g8eebcd2.trx: No space left on device
RT-AC68U_3.0.0.4_386_51733-g8eebcd2.trx 100% 102MB 2.9MB/s 00:35
admin@RT-AC56U-6CB0:/tmp/home/root# rm -f /tmp/RT-AC68U_3.0.0.4_386_51733-g8eebcd2.trx
-sh: can't fork
admin@RT-AC56U-6CB0:/tmp/home/root# ls -l /tmp/RT-AC68U_3.0.0.4_386_51733-g8eebcd2.trx
-sh: can't fork
Should this happen to you, reboot the router, attach a known good USB stick (formatted as ext3), and transfer the files to the USB stick instead:
I didn't need to transfer mtd-write2, because it was already included in my older RMerlin firmware:
Code:
admin@RT-AC56U-6CB0:/tmp/home/root# ls -l /sbin/mtd-write2
lrwxrwxrwx 1 admin root 2 May 13 2018 /sbin/mtd-write2 -> rc
admin@RT-AC56U-6CB0:/tmp/home/root# mtd-write2
usage: mtd-write2 [path] [device]
8. The moment of truth - flash cfe and firmware from ssh:
Code:
PC$ ssh [email protected]
[email protected]'s password:
ASUSWRT-Merlin RT-AC56U 384.5-0 Sun May 13 01:52:57 UTC 2018
admin@RT-AC56U-6CB0:/tmp/home/root# cd /tmp/mnt/sda1/
admin@RT-AC56U-6CB0:/tmp/mnt/sda1# chmod a+x mtd-write
admin@RT-AC56U-6CB0:/tmp/mnt/sda1# ls -l mtd-write RT-AC68U_3.0.0.4_386_51733-g8eebcd2.trx
new_cfe.bin
-rw-rw-r-- 1 admin root 106975252 Feb 14 02:04 RT-AC68U_3.0.0.4_386_51733-g8eebcd2.trx
-rwxrwxr-x 1 admin root 733422 Feb 14 02:33 mtd-write
-rw-rw-r-- 1 admin root 524288 Feb 14 02:04 new_cfe.bin
admin@RT-AC56U-6CB0:/tmp/mnt/sda1# ./mtd-write new_cfe.bin boot
Usage: ./mtd-write -i file -d part
admin@RT-AC56U-6CB0:/tmp/mnt/sda1# ./mtd-write -i new_cfe.bin -d boot
admin@RT-AC56U-6CB0:/tmp/mnt/sda1# mtd-write2 RT-AC68U_3.0.0.4_386_51733-g8eebcd2.trx linux
linux: CRC OK
9. Power off, wait 10s, power on router. Make sure you are connecting via cable, to port LAN2 (LAN1 is WAN). Wait a bit (a few minutes) and try to ssh into it:
Code:
PC$ ssh [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:ff2UidlZQr9PtCdBzE0uSbUMgK3oPSSRDSxLfuAqjdY.
Please contact your system administrator.
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/user/.ssh/known_hosts:216
remove with:
ssh-keygen -f '/home/user/.ssh/known_hosts' -R '192.168.1.1'
Host key for 192.168.1.1 has changed and you have requested strict checking.
Host key verification failed.
It's normal to get a ssh host key error. Clear the old key:
Code:
PC$ ssh-keygen -f '/home/user/.ssh/known_hosts' -R '192.168.1.1'
# Host 192.168.1.1 found: line 216
/home/user/.ssh/known_hosts updated.
Original contents retained as /home/user/.ssh/known_hosts.old
Try to connect again:
Code:
PC$ ssh [email protected]
The authenticity of host '192.168.1.1 (192.168.1.1)' can't be established.
ED25519 key fingerprint is SHA256:5Q2Q/4C5HxSwLfxuGWDqlbOX4wgmknNbSJZKEmVQyys.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.1.1' (ED25519) to the list of known hosts.
[email protected]'s password:
admin@RT-AC68U-6CB0:/tmp/home/root#
admin@RT-AC68U-6CB0:/tmp/home/root# mtd-erase2 nvram
admin@RT-AC68U-6CB0:/tmp/home/root#
admin@RT-AC68U-6CB0:/tmp/home/root# reboot
admin@RT-AC68U-6CB0:/tmp/home/root#
Wait 5 more minutes, and see if you can login in the web gui.
For some reason, even deleting the nvram, my system still had the old admin password. So I went into the web interface, and did a reset to factory default, with "Initialize all the settings, and clear all the data log for AiProtection, Traffic Analyzer, and Web History." set.
Now, the router looks good to be used as an AI Mesh node. Will test this later on.
Thanks again for the instructions!