WRT54G v1.0 bricked

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
phillik
DD-WRT Novice


Joined: 22 Sep 2006
Posts: 18

PostPosted: Tue Feb 06, 2007 5:50    Post subject: WRT54G v1.0 bricked Reply with quote
Well I don't really know how I did it but I bricked my WRT54G v1.0 router. I just did a freash flash of dd-wrt.v23_vpn_generic.bin and was going to try out a vpn setup from the wiki. The flash went well and I was able to go to the admin/command page to imput my rc_startup and rc_firewalll.
rc_startup:
Code:

cd /tmp
openvpn --mktun --dev tap0
brctl addif br0 tap0
ifconfig tap0 0.0.0.0 promisc up

echo "
# Tunnel options
mode server       # Set OpenVPN major mode
proto udp         # Setup the protocol (server)
port 1194         # TCP/UDP port number
dev tap0          # TUN/TAP virtual network device
keepalive 15 60   # Simplify the expression of --ping
daemon            # Become a daemon after all initialization
verb 3            # Set output verbosity to n
comp-lzo          # Use fast LZO compression

# OpenVPN server mode options
client-to-client  # tells OpenVPN to internally route client-to-client traffic
duplicate-cn      # Allow multiple clients with the same common name

# TLS Mode Options
tls-server        # Enable TLS and assume server role during TLS handshake
ca ca.crt         # Certificate authority (CA) file
dh dh1024.pem     # File containing Diffie Hellman parameters
cert server.crt   # Local peer's signed certificate
key server.key    # Local peer's private key
" > openvpn.conf

echo "
-----BEGIN CERTIFICATE-----
---removed---
-----END CERTIFICATE-----
" > ca.crt
echo "
-----BEGIN RSA PRIVATE KEY-----
---removed---
-----END RSA PRIVATE KEY-----
" > server.key
chmod 600 server.key
echo "
-----BEGIN CERTIFICATE-----
---removed---
-----END CERTIFICATE-----
" > server.crt
echo "
-----BEGIN DH PARAMETERS-----
---removed---
-----END DH PARAMETERS-----
" > dh1024.pem

sleep 5
ln -s /usr/sbin/openvpn /tmp/myvpn
/tmp/myvpn --config openvpn.conf


and the rc_firewall:
Code:
/usr/sbin/iptables -I INPUT -p udp --dport 1194 -j ACCEPT


I then put in 'reboot' in the command window and clicked run command. The router shutdown and never came back (waited 5 mins). I then did a power cycle and and the only lights that come up are the power and diag light. Also the LAN lights are off and the pc shows that the connection is disconnected. And of course I have tried holding down the reset switch.

Will the JTAG tool bring it back?


Last edited by phillik on Tue Feb 06, 2007 16:01; edited 1 time in total
Sponsor
Tornado
DD-WRT Developer/Maintainer


Joined: 07 Jun 2006
Posts: 2087
Location: Odessa, Ukraine

PostPosted: Tue Feb 06, 2007 6:28    Post subject: Reply with quote
Jtag should bring it back, but that is for a real brick. DId you try holding the reset for 1 min. ?
_________________
Want JTAG support - Donate a router
or Donate with PayPal !

My preferred parallel jtag adapter:
TIAO Parallel adapter

Tjtag website - http://tjtag.com

Compiling DD-WRT on:
AMD Phenom II X6 1090T @ 3926.667 Mhz

Aptosid X64 - Debian SID X64
Ubuntu 10.10 X64 - Arch X64
phillik
DD-WRT Novice


Joined: 22 Sep 2006
Posts: 18

PostPosted: Tue Feb 06, 2007 6:32    Post subject: Reply with quote
Not for a whole min but I will try now

Thank you for your help.

--update--
Didn't work. I just don't know what caused it to brick by just adding the two scripts.
Eko
DD-WRT Developer/Maintainer


Joined: 07 Jun 2006
Posts: 5772

PostPosted: Tue Feb 06, 2007 7:01    Post subject: Reply with quote
Your rc_startup is way longer then max size for one nvram variable, which is 1024 bytes.
Use jtag to clear nvram.
phillik
DD-WRT Novice


Joined: 22 Sep 2006
Posts: 18

PostPosted: Tue Feb 06, 2007 15:39    Post subject: Reply with quote
Quote:
Your rc_startup is way longer then max size for one nvram variable, which is 1024 bytes.

Thank you Eko for your input.

So as far as the wiki goes the rc_startup script for Server Mode with Certificates is too long for just the wrt54g v1.0 ? http://www.dd-wrt.com/wiki/index.php/OpenVPN

I know this is a dumb question but how do I tell the size of my rc_startup, by the actual file size in notepad++.exe?
cwells
DD-WRT Novice


Joined: 11 Mar 2007
Posts: 2

PostPosted: Sun Mar 11, 2007 20:21    Post subject: I did the same thing Reply with quote
Maybe the wiki should be updated with this information. I hadn't seen it mentioned anywhere and if you follow the openvpn section of the wiki to the letter you are pretty much guaranteed to brick your router. Not nice.
dzjepp
DD-WRT Novice


Joined: 18 Dec 2006
Posts: 8

PostPosted: Sun Mar 11, 2007 20:39    Post subject: Reply with quote
Did you try setting a static ip on the server and using tftp to try to recover it?
cwells
DD-WRT Novice


Joined: 11 Mar 2007
Posts: 2

PostPosted: Mon Mar 12, 2007 1:12    Post subject: That won't work Reply with quote
That doesn't work. The router is frozen so hard you can't even get a physical link. I tried anyway (and tried all the other methods finally ending with shorting pins 15 & 16), but nothing worked. I consider the router toast.
jamesavery22
DD-WRT Novice


Joined: 06 Sep 2006
Posts: 19

PostPosted: Thu Jun 28, 2007 22:21    Post subject: Reply with quote
I had the exact same issue. I used jtag to clear the nvram to unbrick it. But a 5K startup script works fine on my v2 as well as a buffalo router. This is just a wrt54g v1.0 issue?
jamesavery22
DD-WRT Novice


Joined: 06 Sep 2006
Posts: 19

PostPosted: Mon Jul 02, 2007 0:52    Post subject: Reply with quote
What part/folders/files of the OS are in nvram? Is there a way to write these scripts to a file thats run by .profile? I guess I need to read up on where the OS resides etc... Any pointers from anyone? please?
jamesavery22
DD-WRT Novice


Joined: 06 Sep 2006
Posts: 19

PostPosted: Fri Jul 13, 2007 18:16    Post subject: Reply with quote
Just in case someone is searching and finds this thread...

I fixed this issue by putting the ca.crt,dh1024.pem, server.crt, server.key, and openvpn.conf inside the bin.
Used the firmware mod kit to unpack the current dd-wrt generic vpn bin
Made a dir /usr/vpn and dumped the above files in it then repackaged the bin

The startup command copied the files from the /usr/vpn folder to the /tmp folder then ran the necessary commands. I tried running from the /usr/vpn folder but I couldn't get it to work. I have nothing else loaded on this so I'm not worried about the wasted space.

Works fine now.
techflat
DD-WRT Novice


Joined: 15 May 2008
Posts: 1

PostPosted: Thu May 15, 2008 1:48    Post subject: Not Undertanding what to do Reply with quote
Hi there Everyone.

I know this is a very old post, but still maybe someone can help me out.

The thing is I am trying (or at least reading about it right now) to set up openVPN on my router (WRT54G V2), I read the wiki page tutorial on how to do this, but theres is a piece of information that gets me worried. If you post a rc_startup script that is too long the router will be bricked.

So, is this true? If so, can I set up openVPN anyway with another way to do it?

From what I understand, you have to create the rc_startup from the web admin, right?

Thanks a lot to the one that responds. Very Happy !
crw
DD-WRT Novice


Joined: 26 May 2008
Posts: 1

PostPosted: Mon May 26, 2008 6:38    Post subject: Reply with quote
Using WRT54G v3, DD-WRT v24:

Creating a custom bin with the files worked well for me. I made sure to 'chmod 600 server.key' before creating the bin package, and did not need to copy the files from /usr/vpn to /tmp to run openvpn.

Thanks for the tip!



jamesavery22 wrote:
Just in case someone is searching and finds this thread...

I fixed this issue by putting the ca.crt,dh1024.pem, server.crt, server.key, and openvpn.conf inside the bin.
Used the firmware mod kit to unpack the current dd-wrt generic vpn bin
Made a dir /usr/vpn and dumped the above files in it then repackaged the bin

The startup command copied the files from the /usr/vpn folder to the /tmp folder then ran the necessary commands. I tried running from the /usr/vpn folder but I couldn't get it to work. I have nothing else loaded on this so I'm not worried about the wasted space.

Works fine now.
darkside40
DD-WRT Novice


Joined: 02 Mar 2007
Posts: 25

PostPosted: Fri Jul 04, 2008 11:21    Post subject: Reply with quote
jamesavery22 wrote:
Just in case someone is searching and finds this thread...

I fixed this issue by putting the ca.crt,dh1024.pem, server.crt, server.key, and openvpn.conf inside the bin.
Used the firmware mod kit to unpack the current dd-wrt generic vpn bin
Made a dir /usr/vpn and dumped the above files in it then repackaged the bin

The startup command copied the files from the /usr/vpn folder to the /tmp folder then ran the necessary commands. I tried running from the /usr/vpn folder but I couldn't get it to work. I have nothing else loaded on this so I'm not worried about the wasted space.

Works fine now.


That is an interesting Method.
So you just rebuild the firmware dumping the certificates and so on into the new bin, that is clear to me.
But what about the rc_startup? Does it has to be modified for your Method.

Would be nice if you could do a simple step-by-step HowTo for that.

This mod would be great because i want to change to the new FW24 what means that i have to flash the Router anyway.
darkside40
DD-WRT Novice


Joined: 02 Mar 2007
Posts: 25

PostPosted: Fri Jul 11, 2008 11:43    Post subject: Reply with quote
No one who could give me a hint?
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum