Success on installing DD-WRT to WRT32X w/o USB TTL cable

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.)
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
Skoda Zek
DD-WRT User


Joined: 07 Apr 2018
Posts: 66
Location: Calgary, AB Canada

PostPosted: Tue Jun 12, 2018 18:40    Post subject: Reply with quote
ok found place to put the following (Administration/Commands/Firewall Command):

Quote:
echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
iptables -t mangle -F PREROUTING
ip route add default table 200 via $(nvram get wan_gateway)
ip rule add fwmark 1 table 200
ip route flush cache
iptables -t mangle -I PREROUTING -i br0 -s 192.168.0.105 -j MARK --set-mark 1
iptables -t mangle -I PREROUTING -i br0 -s 192.168.0.106 -j MARK --set-mark 1
iptables -t mangle -I PREROUTING -i br0 -s 192.168.0.107 -j MARK --set-mark 1


Unfortunately it did not work as intended. Instead of the 3 devices associated with the 192.168.0.105-107 ips bypassing the VPN, they have lost all connectivity to the WAN. While it seems they have access to LAN, no access to WAN.

I am guessing it is a typo or something in the above code?
Sponsor
true_devil
DD-WRT Novice


Joined: 12 Jun 2018
Posts: 5

PostPosted: Tue Jun 12, 2018 19:17    Post subject: Re: Amazon UK OFFER Reply with quote
[quote="markcorrado1"]
true_devil wrote:
spuriousoffspring wrote:


Right now the WRT32X is just £99 on amazon UK!


Does anyone know if the UK version will work in the US Question


Besides the power aadapter there is no reason it shouldnt.
true_devil
DD-WRT Novice


Joined: 12 Jun 2018
Posts: 5

PostPosted: Tue Jun 12, 2018 19:19    Post subject: Reply with quote
Skoda Zek wrote:
to make it real simple and easy to follow this is EXACTLY what I did, just so you have lowest chances of bricking.

Used PuTTy to SSH to 192.168.1.1

this is exactly the commands I used and in exact order

root@OpenWrt:~# cd
root@OpenWrt:~# fw_printenv silent
silent=1
root@OpenWrt:~# fw_setenv silent
root@OpenWrt:~# fw_printenv silent
## Error: "silent" not defined
root@OpenWrt:~# wget https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2018/06-10-2018-r36104/linksys-wrt32x/FW_WRT32X_1.0.666_DDWRT.img
<Wait for Wget Download to complete 100%>
root@OpenWrt:~# fw_printenv boot_part
boot_part=1
root@OpenWrt:~# fw_setenv boot_part 2
root@OpenWrt:~# sysupgrade -i -n -v FW_WRT32X_1.0.666_DDWRT.img
Keep config files over reflash (y/N): N

A number of verboise terminal output will display such as killall etc, wait for it to say: "sysupgrade successful" and you can flip the power switch on the back of your WRT32x off and back on. (NOTE: I waited several minutes after the sysupgrade successful message came up before I did anything). At first I thought I had bricked it cause it took a long time to boot up and finally assign an ip to my PC. I power cycled the router several times and hit the reset button once before I just decided to let it boot up for several minutes and when I came back I was able to get a dd-wrt gui at 192.168.1.1

NOTE: The Internet LED and the ESATA Led are swapped for some reason. So the Internet LED Will not light up but the ESATA LED will when there is a WAN ip registered.

Hope this helps


Dude thats awesome! Thank you so much for that, really appreciate the step by step.

2 questions:
1 - Do those steps assume I am on openwrt or can I do this being on a brand new stock firmware router?
2 - I need to be connect by the uart to usb cable by opening the router or can I do this through an ethernet cable directly?

Thanks alot!
Skoda Zek
DD-WRT User


Joined: 07 Apr 2018
Posts: 66
Location: Calgary, AB Canada

PostPosted: Tue Jun 12, 2018 20:09    Post subject: Reply with quote
that is right from the stock firmware I did that
and just a wired ethernet connection is all. You don't require the usb/serial cable.
Skoda Zek
DD-WRT User


Joined: 07 Apr 2018
Posts: 66
Location: Calgary, AB Canada

PostPosted: Tue Jun 12, 2018 20:55    Post subject: Reply with quote
Ok to summarize my current status.

I have my OpenVPN working on : DD-WRT v3.0-r36104 std (06/10/1Cool on my WRT32x running w/ AES-256 CBC / SHA512 / UDP. Unfortunately Policy Based Routing (at least via the DD-WRT Gui) Is broken in this build which means I cannot use it to specify which IPs or IP Ranges to allow for use on VPN. So it is a blanket VPN situation for all 22 DHCP Clients on my router which just wont do at all.

So I have decided to try and use iptables to solve the issue, as I need 3 specific devices to be direct to WAN with no VPN. I have tried 2 seperate iptables settings through the Admin/Commands Firewall commands window in DD-WRT.

Quote:
echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
iptables -t mangle -F PREROUTING
ip route add default table 200 via $(nvram get wan_gateway)
ip rule add fwmark 1 table 200
ip route flush cache
iptables -t mangle -I PREROUTING -i br0 -s 192.168.0.105 -j MARK --set-mark 1
iptables -t mangle -I PREROUTING -i br0 -s 192.168.0.106 -j MARK --set-mark 1
iptables -t mangle -I PREROUTING -i br0 -s 192.168.0.107 -j MARK --set-mark 1


and

Quote:
WAN_GTWY="$(nvram get wan_gateway)"
WAN_IF="$(nvram get wan_iface)"

ip route add default via $WAN_GTWY dev $WAN_IF table 10

ip rule add from 192.168.0.105 table 10
ip rule add from 192.168.0.106 table 10
ip rule add from 192.168.0.107 table 10
#----------------------------------------------------

iptables -I FORWARD -i br0 -o tun0 -j ACCEPT
iptables -I FORWARD -i tun1 -o br0 -j ACCEPT
iptables -I FORWARD -i br0 -o vlan2 -j DROP
iptables -I FORWARD -i br0 -s 192.168.0.105 -o vlan2 -j ACCEPT
iptables -I FORWARD -i br0 -s 192.168.0.106 -o vlan2 -j ACCEPT
iptables -I FORWARD -i br0 -s 192.168.0.107 -o vlan2 -j ACCEPT
iptables -I INPUT -i tun1 -j REJECT
iptables -t nat -A POSTROUTING -o tun1 -j MASQUERADE


Unfortunately in both cases the result was loss of internet access for the 3 static IP's specified (192.168.0.105/106/107).

I am at a loss, I have spent many hours troubleshooting trying to break the trend and I really do need you folks help now.
ghoffman
DD-WRT User


Joined: 03 Jan 2010
Posts: 453

PostPosted: Tue Jun 12, 2018 23:33    Post subject: Reply with quote
i've spent a number of hours over the past two weeks trying to get dd-wrt on and off a wrt32x. to summarize:

stock -> ddwrt works by gui (flashes other partition) AND by mtd write (summarized above; pick your partition)

stock-> openwrt/lede works by ssh and sysupgrade (probably works by gui but i didnt try)

openwrt -> stock works by ssh/mtd write.

ddwrt -> stock: i had to enable ssh, then flash both mtd5 and mtd7 partions with stock flat firmware file, AND erase nvram partition (mtd erase nvram), then power cycle router. i cant completely explain why, but i think the ddwrt nvram values make openwrt or stock firmware hang, and issing the 'reboot' command at the ddwrt command line re-writes nvram. anyway, only by completely getting rid od ddwrt could i get back to stock.

so: from stock, you can get lede on one partition and dd-wrt on the other.
from dd-wrt: you have to get rid of dd-wrt remanants everywhere to get back to stock or lede.

the quick way to get back to a 'clean' setup is from serial, using the 'run update_both_images' uboot command. i think by flashing both mtd5 and mtd7 with stock, and earsing nvram, this accomplishes the same thing, without serial access.

short story - it's currently hard to get from dd-wrt back to stock, but it can be done without serial access.
markcorrado1
DD-WRT Novice


Joined: 15 Mar 2018
Posts: 2

PostPosted: Wed Jun 13, 2018 0:37    Post subject: Re: Amazon UK OFFER Reply with quote
[quote="true_devil"]
markcorrado1 wrote:
true_devil wrote:
spuriousoffspring wrote:


Right now the WRT32X is just £99 on amazon UK!


Does anyone know if the UK version will work in the US Question


Besides the power aadapter there is no reason it shouldnt.


Awesome thanks, ordered one and saved $100 Very Happy
true_devil
DD-WRT Novice


Joined: 12 Jun 2018
Posts: 5

PostPosted: Wed Jun 13, 2018 18:57    Post subject: try this Reply with quote
Skoda Zek wrote:
Ok to summarize my current status.

I have my OpenVPN working on : DD-WRT v3.0-r36104 std (06/10/1Cool on my WRT32x running w/ AES-256 CBC / SHA512 / UDP. Unfortunately Policy Based Routing (at least via the DD-WRT Gui) Is broken in this build which means I cannot use it to specify which IPs or IP Ranges to allow for use on VPN. So it is a blanket VPN situation for all 22 DHCP Clients on my router which just wont do at all.

So I have decided to try and use iptables to solve the issue, as I need 3 specific devices to be direct to WAN with no VPN. I have tried 2 seperate iptables settings through the Admin/Commands Firewall commands window in DD-WRT.

Quote:
echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
iptables -t mangle -F PREROUTING
ip route add default table 200 via $(nvram get wan_gateway)
ip rule add fwmark 1 table 200
ip route flush cache
iptables -t mangle -I PREROUTING -i br0 -s 192.168.0.105 -j MARK --set-mark 1
iptables -t mangle -I PREROUTING -i br0 -s 192.168.0.106 -j MARK --set-mark 1
iptables -t mangle -I PREROUTING -i br0 -s 192.168.0.107 -j MARK --set-mark 1


and

Quote:
WAN_GTWY="$(nvram get wan_gateway)"
WAN_IF="$(nvram get wan_iface)"

ip route add default via $WAN_GTWY dev $WAN_IF table 10

ip rule add from 192.168.0.105 table 10
ip rule add from 192.168.0.106 table 10
ip rule add from 192.168.0.107 table 10
#----------------------------------------------------

iptables -I FORWARD -i br0 -o tun0 -j ACCEPT
iptables -I FORWARD -i tun1 -o br0 -j ACCEPT
iptables -I FORWARD -i br0 -o vlan2 -j DROP
iptables -I FORWARD -i br0 -s 192.168.0.105 -o vlan2 -j ACCEPT
iptables -I FORWARD -i br0 -s 192.168.0.106 -o vlan2 -j ACCEPT
iptables -I FORWARD -i br0 -s 192.168.0.107 -o vlan2 -j ACCEPT
iptables -I INPUT -i tun1 -j REJECT
iptables -t nat -A POSTROUTING -o tun1 -j MASQUERADE


Unfortunately in both cases the result was loss of internet access for the 3 static IP's specified (192.168.0.105/106/107).

I am at a loss, I have spent many hours troubleshooting trying to break the trend and I really do need you folks help now.


On the set up page, disable SFE and then leave everything else as you did. That should fix the problem and policy routing should work. Just did mine now.
Skoda Zek
DD-WRT User


Joined: 07 Apr 2018
Posts: 66
Location: Calgary, AB Canada

PostPosted: Wed Jun 13, 2018 19:00    Post subject: Reply with quote
yep disabling SFE fixed all my PBR issues.

Only thing I need to do now is assign custom primary/secondary DNS Servers to 3 clients on my router (they are not behind the VPN).

These clients are Roku's and thus due to roku software the user is unable to modify the dns servers so I must find a way to do it from within DD-WRT, furthermore these DNS have to be specific to these devices so I cannot assign them as global DNS

Anyone who can help me figure this out? its my final issue =)
isg17
DD-WRT Novice


Joined: 28 Apr 2018
Posts: 12

PostPosted: Thu Jun 14, 2018 3:01    Post subject: Reply with quote
ghoffman wrote:
i've spent a number of hours over the past two weeks trying to get dd-wrt on and off a wrt32x. to summarize:

stock -> ddwrt works by gui (flashes other partition) AND by mtd write (summarized above; pick your partition)

stock-> openwrt/lede works by ssh and sysupgrade (probably works by gui but i didnt try)

openwrt -> stock works by ssh/mtd write.

ddwrt -> stock: i had to enable ssh, then flash both mtd5 and mtd7 partions with stock flat firmware file, AND erase nvram partition (mtd erase nvram), then power cycle router. i cant completely explain why, but i think the ddwrt nvram values make openwrt or stock firmware hang, and issing the 'reboot' command at the ddwrt command line re-writes nvram. anyway, only by completely getting rid od ddwrt could i get back to stock.

so: from stock, you can get lede on one partition and dd-wrt on the other.
from dd-wrt: you have to get rid of dd-wrt remanants everywhere to get back to stock or lede.

the quick way to get back to a 'clean' setup is from serial, using the 'run update_both_images' uboot command. i think by flashing both mtd5 and mtd7 with stock, and earsing nvram, this accomplishes the same thing, without serial access.

short story - it's currently hard to get from dd-wrt back to stock, but it can be done without serial access.


@ghoffman I have some questions regarding the different scenarios.
    stock -> ddwrt - Which DD-WRT image worked via Venom GUI? I was not successful with FW_WRT32X_1.0.666_DDWRT.img however it worked without any issues using SSH/sysupgrade

    stock-> openwrt/lede - I don't remember if I was successful in upgrading from Venom to OpenWRT. I should go back and try and report back.

    ddwrt -> stock - This sounds like some voodoo was involved! Laughing I believe this is something similar to what the sysupgrade shell script is doing, but I haven't investigated in analyzing the script. I did spend some quality time with the mtd utility trying to do something similar as to what attempted. Unfortunately, I was unsuccessful in my testing.
All in all, I'm anxious to get a repeatable and successful process to revert back DD-WRT back to Venom and/or OpenWRT. I just don't have any solution other than opening up the WRT32X unit and using a USB to TTL/serial cable/UART method. Obviously, this method is not intended for anyone other than a hobbyist.
ghoffman
DD-WRT User


Joined: 03 Jan 2010
Posts: 453

PostPosted: Thu Jun 14, 2018 11:00    Post subject: Reply with quote
isg17 wrote:

ddwrt -> stock - This sounds like some voodoo was involved! Laughing I believe this is something similar to what the sysupgrade shell script is doing, but I haven't investigated in analyzing the script. I did spend some quality time with the mtd utility trying to do something similar as to what attempted. Unfortunately, I was unsuccessful in my testing.[/list] All in all, I'm anxious to get a repeatable and successful process to revert back DD-WRT back to Venom and/or OpenWRT. I just don't have any solution other than opening up the WRT32X unit and using a USB to TTL/serial cable/UART method. Obviously, this method is not intended for anyone other than a hobbyist.


what i found was: if dd-wrt is on one partition, it will boot, even if nvram was reset and bootPart set to toher partition. i *think* there is a check on nvram and possible rewriting of it in the early boot process. also i think that the 'reboot' command (maps to busybox) does something to nvram.
of course sysupgrade is not a dd-wrt command. i think this is what flash_both_images does.

note - i did not use a serial cable. the mtd write commands were from the ddwrt shell.

i'll check all this out again when i have time to mess up my network and not incur wrath....
Renji
DD-WRT Novice


Joined: 30 Aug 2018
Posts: 1

PostPosted: Fri Aug 31, 2018 9:58    Post subject: Reply with quote
Hi,

Can you confirm me the process to come back on venom firmware from DDWRT?

1- Enable SSH from DDWRT GUI
2- Use a flat (non-sysuprade) image
You have posted the process, so it is ok
3- Use scp to copy flat image to /tmp/
4- From DDWRT CLI (enable SSH) enter these commands:

- mtd erase nvram
- mtd -e linux -r write /tmp/flatVenomImage.img linux
- mtd -e linux2 -r write /tmp/flatVenomImage.img linux2
- reboot

I don't understand if reboot command will rewrite nvram and so will block/lock next reboot on Venom image?

I will upgrade my WRT32X to DDWRT, but before I would like to know the exact process to come back on Venom image.

Thank you!
spuriousoffspring
DD-WRT Guru


Joined: 05 Apr 2017
Posts: 981
Location: Louisiana, USA

PostPosted: Sat Sep 01, 2018 11:19    Post subject: Reply with quote
Renji wrote:
Hi,

Can you confirm me the process to come back on venom firmware from DDWRT?

1- Enable SSH from DDWRT GUI
2- Use a flat (non-sysuprade) image
You have posted the process, so it is ok
3- Use scp to copy flat image to /tmp/
4- From DDWRT CLI (enable SSH) enter these commands:

- mtd erase nvram
- mtd -e linux -r write /tmp/flatVenomImage.img linux
- mtd -e linux2 -r write /tmp/flatVenomImage.img linux2
- reboot

I don't understand if reboot command will rewrite nvram and so will block/lock next reboot on Venom image?

I will upgrade my WRT32X to DDWRT, but before I would like to know the exact process to come back on Venom image.

Thank you!

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316094

_________________
DD-WRT Installation & Setup TUTORIAL
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=311117

WRT32X DD-WRT Installation Procedure
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=315569

IPVanish OpenVPN Client Setup TUTORIAL
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=308565

FIRMWARE: OpenWrt SNAPSHOT r8217-2cc821e / LuCI Master (git-18.276.41146-280dd33)
MODEM: ARRIS SURFBoard SB8200
ROUTER: Linksys WRT32X
USB NAS: Western Digital BLACK 1 TB Hardrive + Startech USB 3.0 External SATA III Enclosure
rajesh_05_in
DD-WRT Novice


Joined: 24 Sep 2020
Posts: 3

PostPosted: Thu Sep 24, 2020 18:18    Post subject: WRT32x router was on DD-WRT now unable to boot Reply with quote
I have WRT32X from Linksys. I installed the DD-WRT on it. Now I was trying to revert it back to original firmware following the steps mentioned on page 3. Now router does not boot properly. I just see a solid blue light for power and the port light 1, which is connected to router. I also purchased a USB TTL cable and works fine.
When I cycle the power on router it boots and stuck. Below is the snippet after which I do not see anything happening.

U-Boot 2013.01 (May 18 2017 - 16:37:44) Marvell version: 2015_T1.QA.0p16

Boot version : v2.0.9

Board: RD-NAS-88F6820-DDR3
SoC: MV88F6820 Rev A0
running 2 CPUs
CPU: ARM Cortex A9 MPCore (Rev 1) LE
CPU 0
CPU @ 1866 [MHz]
L2 @ 933 [MHz]
TClock @ 200 [MHz]
DDR3 @ 933 [MHz]
DDR3 32 Bit Width,FastPath Memory Access, DLB Enabled, ECC Disabled
DRAM: 512 MiB
NAND: 256 MiB
MMC: mv_sdh: 0


Any help would be appreciated. I am new to this and trying to follow the post but seems I did something wrong.

Here is the sequence I followed from the post.

#cd /tmp
#tar -xf FW_WRT32X_1.0.170828.208.img
#cd sysupgrade-armada-385-linksys-venom

- kernel is 2090870 bytes . acording to new partition layout, kernel has alocated 3mb so we must pad with 0 :

#dd if=/dev/zero of=padk bs=1 count=1054858
#cat padk >> kernel

now we have a 3mb kernel.

- now we must ubinize root file.create a file ubi.cfg with this content :

[rootfs]
mode=ubi
image=root
vol_id=0
vol_type=dynamic
vol_name=rootfs
vol_alignment=1

[rootfs_data]
mode=ubi
vol_id=1
vol_size=1MiB
vol_type=dynamic
vol_name=rootfs_data
vol_flags=autoresize
vol_alignment=1

- run this command :

#ubinize -o ubi_root -p 128KiB -m 2048 -s 2048 -v ubi.cfg

- appent to paded kernel file :

#cat kernel ubi_root > wrt32x.img

thats all. we have a image that can be flashed to new partition layout (new env vars must be set) from u-boot or from dd-wrt/lede using "mtd -f write" command.
#mtd erase mtd5
#mtd -f write wrt32x.img mtd5
#mtd erase mtd7
#mtd -f write wrt32x.img mtd7
#reboot
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5700

PostPosted: Thu Sep 24, 2020 20:05    Post subject: Reply with quote
There is no need to recreate a properly converted flat file when adi-brasov already uploaded the file on page 3 (scroll up).

Silent boot is enabled, so it will not tell you when to interrupt the boot process with any key press to enter u-boot env.
Goto page Previous  1, 2, 3, 4, 5, 6  Next Display posts from previous:    Page 5 of 6
Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.) 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 cannot attach files in this forum
You cannot download files in this forum