Linksys WRT54G2 v1.0

Links of Interest

 * Datasheet.pdf
 * Quick Install.pdf
 * User Guide.pdf
 * Listed on the WRT54G series page on Wikipedia
 * On the DD-WRT wiki
 * On the DD-WRT forums
 * On the DD-WRT forum
 * Teardown on iFixit

Flashing DD-WRT
These are instructions for the WRT54G2 V.1 ONLY
 * Linksys WRT54G2 v1.0


 * 1) Download ftp://dd-wrt.com/others/eko/WRT54G2V1%20Flashing/VxWorksKiller-G2V1-new.bin
 * 2) Download ftp://dd-wrt.com/others/eko/WRT54G2V1%20Flashing/dd-wrt.v24-10709_NEWD_micro.bin
 * 3) Download ftp://dd-wrt.com/others/eko/WRT54G2V1%20Flashing/tftp.exe
 * 4) Reset the router to defaults on the Linksys Admin page, and let it reboot or manually reboot it after its finished. Read the peacock announcement http://www.dd-wrt.com/phpBB2/viewtopic.php?t=51486 and take special note of number 11, (how to tftp).
 * 5) Set your computer to a static IP address of 192.168.1.8 and 255.255.255.0 for a mask and plug ethernet cable into LAN port of the G2v1 unit.
 * 6) Log in admin page (username is blank, password = admin) and navigate to firmware upgrade page. Browse to the VxWorksKiller-G2V1-new.bin file, press Upgrade and wait 120 seconds for it to reboot on its own, if it does not, then powercycle the router manually. Wait another 12 0seconds and reboot it again. Router should now be listening for tftp transfer of dd-wrt firmware.
 * 7) Tftp the DD-WRT firmware to the router, use "dd-wrt.v24-10709_NEWD_micro.bin" that you downloaded in step 2; after sucessful tftp, wait 3 min for the router to finish writing new nvram deafults, etc... It should reboot on its own at least two times, so give it 3 min and then go to http://192.168.1.1 (If it not reboot on its own, wait another 1 min, and then power cycle it)
 * 8) When if finishes booting up...do a hard reset on the unit...let it boot again, and configure.
 * 9) Upgrade the NEWD_Micro.bin build 12548 after you have dd-wrt running, following the steps in note 1 of the peacock announcement
 * 10) Don't forget to set your computer back to automatically obtaining DHCP and DNS.
 * 11) Check for recommended builds here.

Reverting to OEM Firmware from DD-WRT
Warning - There is only one way to revert at this time. Through JTAG and it has a generic mac address that can be fixed with mac clone.

OK...anyone willing to try it with JTAG...here is a "generic" original Linksys wholeflash for the WRT54G2V1.
 * It has an embedded MAC address of 00:21:29:00:00:01
 * This MUST be loaded back to the unit with JTAG...no exceptions.

This is an altered/edited wholeflash.bin file from my virgin unit...before dd-wrt was loaded.
 * [EDIT] - reported to be working.
 * redhawk


 * generic-WHOLEFLASH.BIN - This is vworks, not linux
 * ridley Reverting WRT54G2 to vxworks WITHOUT JTAG

JTAG Pinouts
 nTRST  1o o2	GND TDI  3o o4	GND TDO  5o o6	GND TMS  7o o8	GND TCK  9o o10	GND nSRST 11o o12  N/C Using Universal JTAG Adapter  white   1o o2	 black red   3o o4	 GND blue   5o o6	 GND green   7o o8	 GND yelow   9o o10  GND orange 11o o12  N/C
 * /noreset switch required

DD-WRT JTAG Recovery

 * 1) Backup CFE x2 (Compare the files, they must match exactly or there is something wrong with your JTAG setup)
 * 2) Erase Wholeflash x2
 * 3) Flash CFE
 * 4) Unplug Power
 * 5) Unplug JTAG Cable

TFTP:


 * 1) Set Rig ip static 192.168.1.10
 * 2) Plug network cable from rig to port 1
 * 3) Get TFTP ready, server ip - 192.168.1.1, Password - blank, file - dd-wrt.v24_micro_generic.bin
 * 4) Plug in power
 * 5) As soon as windows says "connected" hit upgrade. May have to use a network hub to make sure windows is always connected.
 * 6) Hard Reset 30\30\30

Serial Pinouts
 VCC 1 o  TX  2 o  RX  3 o N/C  4 o GND  5 o

DD-WRT Serial Recovery
Modified Redhawk0 instructions
 * 1) Connect Serial cable
 * 2) Start one of the programs from above
 * 3) Get TFTP ready with file selected
 * 4) Use dd-wrt.v24_micro_generic.bin
 * 5) Connect power to the router
 * 6) start a rapid fire Cntl-C as you plug the router to power
 * 7) type "nvram erase" w/o quotes, hit enter
 * 8) type "flash -noheader : flash1.trx" w/o quotes, this starts the tftp daemon, hit enter
 * 9) but have tftp.exe ready
 * 10) Click go or start on TFTP
 * 11) give it 5 minutes after it finishes
 * 12) then power cycle....hard reset...then config
 * 13) when it stops spitting out txt in the serial consol....hit the enter key...you should get a login prompt...at that point, power cycle it, Hard reset or 30/30/30...then config
 * 14) you'll see it boot up

DD-WRT vlan Info

 * Project:DD-WRT/VLAN Support

Confirmed the WRT54G2 v1.0 supports port-based vlans via the GUI with build 14929.

Confirmed the WRT54Gs v1.0 supports port-based vlans via nvram with build 14848 micro-plus-ssh

WRT54G2 v1.0's ports are mapped like this:  1 2 3 4 | case labels 3 2 1 0 | nvram port numbers

Defaults
root@DD-WRT:~# nvram show | grep vlan.ports vlan1ports=4 5 vlan0ports=3 2 1 0 5* size: 17376 bytes (15392 left) root@DD-WRT:~# nvram show | grep port.vlans port5vlans=0 1 16 port4vlans=0 port3vlans=0 port2vlans=0 port1vlans=0 port0vlans=1 size: 17376 bytes (15392 left) root@DD-WRT:~# nvram show | grep vlan.hwname vlan1hwname=et0 vlan0hwname=et0 size: 17376 bytes (15392 left) root@DD-WRT:~# lsmod Module                 Size  Used by ip_nat_pptp             2192   0 (unused) ip_conntrack_pptp      2524   1 ip_nat_proto_gre       1552   0 (unused) ip_conntrack_proto_gre   2312   0 [ip_nat_pptp ip_conntrack_pptp] switch-robo            5036   0 (unused) switch-core            5984   0 [switch-robo] root@DD-WRT:~# ls /proc/switch eth0 root@DD-WRT:~# cat /proc/switch/eth0/vlan/0/ports 0      1       2       3       5t* root@DD-WRT:~# cat /proc/switch/eth0/vlan/1/ports 4      5t root@DD-WRT:~# cat /proc/switch/eth0/vlan/2/ports 4 root@DD-WRT:~#

Commands
root@DD-WRT:~# nvram set vlan1ports="3 4 5" root@DD-WRT:~# nvram set vlan0ports="2 1 0 5*" root@DD-WRT:~# nvram commit root@DD-WRT:~# reboot

nvram
root@DD-WRT:~# nvram show | grep vlan.ports vlan1ports=3 4 5 vlan0ports=2 1 0 5* size: 17459 bytes (15309 left) root@DD-WRT:~# nvram show | grep port.vlans port5vlans=0 1 16 port4vlans=0 port3vlans=0 port2vlans=0 port1vlans=0 port0vlans=1 size: 17459 bytes (15309 left) root@DD-WRT:~# nvram show | grep vlan.hwname vlan1hwname=et0 vlan0hwname=et0 size: 17459 bytes (15309 left) root@DD-WRT:~#

Pictures
DarkShadow's Unit