Hi Pavlosd,
Do you have a dual RE on this router? If so, it's trivial 🙂
Prior to the failure, make sure that configurations on both routing engines are synchronised using the "commit sync" command on the master RE. Then, when a failure occurs on the master RE, I would expect the backup RE to take over and become master. You can then replace the backup (failed) RE and just make sure that the JUNOS version is the same on both REs. Finally, do a commit sync on the new master and you have synchronised REs.
If you don't have dual REs, then you're left with pretty much the approach you took. Alternatively, if you have an out of band network, then try this.
set system root-authentication plain-text
<type the temp root password in twice>
set interface fxp0 unit 0 family inet address <valid-address>/<prefix>
set routing-options static route 0.0.0.0/0 next-hop <valid-next-hop-on-out-of-band-network>
set system services ssh
set system login user temp group superuser authentication plain-text
<type the password in twice>
commit and-quit
Then from the remote site copy the config onto the box using the temp account.
scp <your-saved-copy-of-the-config> temp@<valid-address>:juniper.conf
<enter your temp user password>
login to the box again and do the following.
configure
load override juniper.conf
commit and-quit
This may kick you off because the root password will go back to your old value and your temp account will be deleted.
Rgds,
Guy
Message Edited by GuyDavies on 06-12-2008 08:36 PM