Flash gone wrong on EdgerouterX

I was trying to flash OpenWRT using the instructions from this post.

I flashed openwrt-ramips-mt7621-ubnt-erx-initramfs-factory.tar and made sure I was on latest EDGEMAX firmware, flash was done using the EdgeMAX gui, disconnected everything and went ethernet to ETH1 port then direct to my PC. I assigned myself an ip address on the local computer that is connected direct to router of 192.168.1.10/255.255.255.0/192.168.1.1 and I can't enter 192.168.1.1 via web browser with error refused to connect.

I can ping 192.168.1.1 and get a reply in command prompt. I tried logging into the router using putty using 192.168.1.1, but the username and password keep rejecting. I tried my old username and password before flash, tried ubnt/ubnt, admin/admin, but keep getting access denied.

Please help.

The default login for OpenWRT is "root" with no password.

1 Like

Thank you, that got me in, but webgui still not accessible for some reason.

I'm stuck on this step trying to do it manually in putty:

If so connect your PC to eth1 on EdgeRouter give an static IP to your PC (like you did above already). Push the file (what you have downloaded before)
http://downloads.openwrt.org/releases/19.07.4/targets/ramips/mt7621/openwrt-19.07.4-ramips-mt7621-ubnt-erx-squashfs-sysupgrade.bin to your device with the command:*

scp /path/to/your/downloaded/file/openwrt-19.07.4-ramips-mt7621-ubnt-erx-squashfs-sysupgrade.bin root@192.168.1.1:/tmp

What exactly does "with the command: *" mean? Do I have to ftp the file onto the device then run that scp command?

Good question. Without reading the particular source of information in question I can only assume a possible typo.

Give me a few minutes to read the particular source of information in question.

1 Like

Ah. It's not a typo. The * indicates a footnote. Keep reading to find the instruction referenced by the *

3 Likes

I downloaded and copied the file over using scp, and trying to write the firmware (openwrt-22.03.5-ramips-mt7621-ubnt_edgerouter-x-squashfs-sysupgrade.bin) but now getting an error message saying the image isn't supported, but my device is listed under supported devices.

root@OpenWrt:/tmp# sysupgrade -n -v openwrt-22.03.5-ramips-mt7621-ubnt_edgeroute
r-x-squashfs-sysupgrade.bin
Device ubnt-erx not supported by this image
Supported devices: ubnt,edgerouter-x ubnt-erx ubiquiti,edgerouterx - Image version mismatch: image 1.1, device 1.0. Please wipe config during upgrade (force required) or reinstall. Reason: Config cannot be migrated from swconfig to DSA
Image check failed.
root@OpenWrt:/tmp# Please wipe config during upgrade

May I suggest reading the documentation germane to this device, rather than blindly following a random forum post?

https://openwrt.org/toh/ubiquiti/edgerouter_x_er-x_ka

While the SSH/SCP are available in the EdgeOS firmware, you cannot directly flash OpenWrt (initramfs-kernel.bin) image on them because you will receive the following error:

Checking upgrade image...Upgrade image does not support the device. Upgrade failed.

The process of flashing OpenWrt on these routers involves first flashing a minimal/short-receipt aka “factory” tar OpenWrt image and then running sysupgrade to update to the desired (latest stable or snapshot) image of OpenWrt.
1 Like

There are a bunch of guides and I wanted an easier method, as I'm not great with this stuff. Even following the official guide, the first command I'm already hit with an error :rofl:

root@OpenWrt:~# scp C:\Users\ml3\Downloads/openwrt-ramips-mt7621-ubnt-erx-initr amfs-factory.tar ubnt@192.168.1.1:/tmp/

/usr/bin/dbclient: Connection to root@C:22 exited: Connect failed: Error resolving 'C' port '22'. Try again

Try quotation marks. Or try changing to the directory c:\users\ml3\downloads first, before using scp to copy the file without any additional path specified.

Alternately, try running the command from a Windows machine, rather than from an OpenWRT machine.

In Windows cd to the Downloads directory first, so you can specify the file name without a drive letter or directory. The Windows CLI scp is pretty much an exact port of the Linux program OpenSSH, and it doesn't much like Windows style drive letter and backward slash directory designators.

Since the edgerouter is running an intramfs now (Is it?), the next step is to transfer and flash a sysupgrade. This flash will need to be forced due to the swconfig - DSA issue. Wiping the configuration is not an issue since initramfs doesn't save configuration in the first place.

  • If the Edgerouter is still on stock firmware you should start over with the latest (presently 23.05) versions of OpenWrt initramfs and sysupgrade. Don't use those old instructions telling you to download version 19.
2 Likes
  • You run the scp command on the machine with the file
  • If the machine is Windows, you'll need a program like winscp
  • Once the file is copied to the /tmp folder of the OpenWrt, you can run the sysupgrade command on the OpenWrt device
1 Like

Latest versions of Windows 10 and 11 now include native SSH and SCP commands. It's almost as if Microsoft has joined the 20th century... :wink:

3 Likes

It's asking for a password now, leaving it blank and hitting enter returns:

ubnt@192.168.1.1's password:
Permission denied, please try again.

Tried my old pw for the edgemax, same error. pw ubnt same error

Default Ubiquiti password for the user "ubnt" is "ubnt".

1 Like

Yeah, I tried ubnt as pw, access denied msg...I don't understand how i can login with putty as root no pw, but in powrshell it says ubnt and asks for pw... this is a nightmare to setup

Good luck with Powershell. I only use it when I have to, and only when I have someone else's crib notes I can follow. I don't know if Powershell is to blame here, or if something else has gone wrong.

The good news is, it's not bricked. You're getting a comprehensible response from it.

2 Likes

I switched to cmd with admin priv

Following the guide, I got the following command to go through by changing ubnt to.root:

From

scp /path/to/openwrt-ramips-mt7621-ubnt-erx-initramfs-factory.tar ubnt@192.168.1.1:/tmp/

To

scp /path/to/openwrt-ramips-mt7621-ubnt-erx-initramfs-factory.tar root@192.168.1.1:/tmp/

It writes the file successfully, next I SSH in using:
ssh root@192.168.1.1

I get in, but this command
ubnt@ubnt:/$ add system image /tmp/openwrt-ramips-mt7621-ubnt-erx-initramfs-factory.tar

I tried replacing ubnt@ubuntu with root@root and it errors with
-ash: root@root:/$ not found

I also tried setting a pw and doing root@pw didn't work

Any ideas? I can't get ubnt to work, it just keeps prompting me for a pw and I've tried the default, doesn't work.

Edit: I think it's bricked, it won't ping 192.168.1.1 when connected to eth0 at all. Only ping response from ETH1-4

Don't do that, run ssh and scp in a regular Command Prompt. Admin privilege is not required to originate a connection to outside the PC. I wouldn't think that Powershell would matter but there's no need for it.

It sounds like it is running OpenWrt now. When you log in you should see OpenWrt in big letters, not something about Ubiquiti. The OpenWrt command to flash an upgrade is sysupgrade, not add system image.

That is exactly what OpenWrt would do. Port 0 is for the WAN connection and ports 1-4 are the LAN. You need to move the cable leading to your PC from eth0 to eth1 at that point during the installation process.

1 Like

At this point this is just comical to me. I think this config if far gone from recovery. I think switching from one guide to another messed something up. Now I get this whenever I try to SSH into ubnt or root:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 RSA key sent by the remote host is
SHA256:KgYcYMb9J99M3DfcD+XQ2M5KVQHj/SugTFeUsIimud8.
Please contact your system administrator.
Add correct host key in C:\\Users\\3dfx/.ssh/known_hosts to get rid of this message.
Offending RSA key in C:\\Users\\3dfx/.ssh/known_hosts:1
Host key for 192.168.1.1 has changed and you have requested strict checking.
Host key verification failed.
lost connection

So now I cannot login to anything without this RSA key, which I did not write down and TFTP recovery mode doesn't seem to be working for me doing the pinhole reset.

that error is normal when the same-ip is used from another ssh-server instance. you'll have to delete the remembered host from~/.ssh/known_hosts -- or use "ssh-keygen -R 192.168.1.1"

2 Likes