DIR-615 + openvpn

Post new topic   Reply to topic    DD-WRT Forum Index -> Hardware DIY / Hardware Mods
Author Message
krzee
DD-WRT Novice


Joined: 02 Aug 2011
Posts: 7

PostPosted: Tue Aug 02, 2011 6:50    Post subject: DIR-615 + openvpn Reply with quote
i recently installed http://dd-wrt.com/routerdb/de/download/D-Link/DIR-615/E3/dir615e3-factory-to-ddwrt-firmware.bin/3833 to my DIR-615 e3 router (after hex-editing the string at the end of the bin). I then realized this did not have openvpn on it. Since I do not see a vpn release, I tried to re-roll dd-wrt with openvpn. I read http://dd-wrt.com/wiki/index.php/Development and used extract_firmware.sh to extract the image, then I added openvpn binary/lib/files to the right dirs in roofs/ then I used build_firmware.sh to re-roll a binary. Now this binary will not load from the web interface, even on a virgin router (un-flashed).
I do not care about the openvpn web-gui, as long as I can configure the router to auto-load openvpn on boot, it will not need to be touched again.
Does anyone know how I can get openvpn on to this router?
Sponsor
Sash
DD-WRT Guru


Joined: 20 Sep 2006
Posts: 17619
Location: Hesse/Germany

PostPosted: Mon Aug 15, 2011 13:55    Post subject: Reply with quote
how about downloading a precompiled ovpn binary from a webserver?
_________________
Forum Guidelines...How to get help
&
Forum Rules
&
RTFM/STFW
&
Throw some buzzwords into the WIKI search Exclamation
_________________
I'm NOT rude, just offer pure facts!
_________________
Atheros (TP-Link & Clones, etc ) debrick service in EU
_________________
Guide on HowTo be Safe, Secure and Protect Your Online Anonymity!
krzee
DD-WRT Novice


Joined: 02 Aug 2011
Posts: 7

PostPosted: Wed Aug 17, 2011 20:59    Post subject: Reply with quote
Thank you for the reply.
I did not like the webserver download on boot idea... I feel this is too ugly of a hack, and I don't want to manage webserver failover for just that. Maybe if it was the only option, but I knew it is possible to build my own setup with openvpn and the keys in it.
I ended up figuring it out with the ImageBuilder, whoever built that system is a hero!
in the end all I needed was this:
make image PROFILE=DIR600A1 PACKAGES="openvpn libuci" FILES=files/
but then I needed to change the serial at the end of the file (in hex) since mine is a 615 rev e3 I need to use DIR600A1 but then I run this:
xxd bin/ar71xx/openwrt-ar71xx-dir-600-a1-squashfs-factory.bin | sed -e 's,4150 3931 2d41 5237 3234 302d 5254 2d30,4150 3939 2D41 5237 3234 302D 5254 2D30,' -e 's,3930 3232 332d 3030,3931 3130 352D 3031,'|xxd -r > ~/Desktop/openwrt-custom.bin

I made a nice little script to do everything for me so I can go back to being lazy now =]
phogaman
DD-WRT Novice


Joined: 19 Feb 2012
Posts: 1

PostPosted: Mon Feb 20, 2012 0:15    Post subject: DIR 615 E3 with OpenVPN help Reply with quote
krzee or others, any chance you can share your script or the steps for imagebuilder to use the DIR600A1 bins on the 615 rev E3? Or even the actual firmware you built (sans un/pw)? I generally understand your method, but am in need of the details.

I'm in the same situation with a 615 rev E3, dd-wrt std installed, and needing OpenVPN. I found this post and have built an ubuntu vm, successfully extracted the firmware from the original dir615e3-ddwrt-firmware and have downloaded imagebuilder OpenWrt-ImageBuilder-ar71xx-for-Linux-i686.tar.bz2 from http://backfire.openwrt.org/10.03.1/ar71xx/ as well as openvpn 2.2.2 source. I assumed you used the ar71xx version of imagebuilder from your files and reference to the 600A1.

Now I'm trying to determine the details of adding the openvpn files to the appropriate directories in rootfs/ and then running imagebuilder to re-roll a new firmware with openvpn.

Any advice is most appreciated!
Pho
krzee
DD-WRT Novice


Joined: 02 Aug 2011
Posts: 7

PostPosted: Mon Feb 20, 2012 3:09    Post subject: Reply with quote
sounds right, i downloaded it a long time ago, and yes its the exact same as the 600A1

i pretty much already gave you the relevant commands, here is the part of my script that does the actual building


cd "$bdir" && make image PROFILE=DIR600A1 PACKAGES="openvpn libuci" FILES=files/
xxd "$fw" | sed -e 's,4150 3931 2d41 5237 3234 302d 5254 2d30,4150 3939 2D41 5237 3234 302D 5254 2D30,' -e 's,3930 3232 332d 3030,3931 3130 352D 3031,'|xxd -r > "$fwdir/$cn.bin"
chmod 444 "$fwdir/$cn.bin"
[[ -f "$fwdir/$cn.bin" ]] && echo "$fwdir/$cn.bin successfully made, go flash the router!"
bald_eagle
DD-WRT Novice


Joined: 17 Apr 2012
Posts: 3

PostPosted: Tue Apr 17, 2012 21:11    Post subject: Reply with quote
krzee, thank you for sharing this approach. I intend to do the same thing.
I have a few questions regarding how you solved the keys settings, if you don't mind answering, please:
1- are your keys inserted in the firmware?
2- did you use the custom files with FILES in the make image command to insert the keys? where exactly are they?
3- did you use some sort of start-up script allowing you to change the keys such that you don't have to use ImageBuilder again just to change the keys?
krzee
DD-WRT Novice


Joined: 02 Aug 2011
Posts: 7

PostPosted: Wed Apr 18, 2012 2:32    Post subject: Reply with quote
bald_eagle wrote:

krzee, thank you for sharing this approach. I intend to do the same thing.
I have a few questions regarding how you solved the keys settings, if you don't mind answering, please:
1- are your keys inserted in the firmware?
2- did you use the custom files with FILES in the make image command to insert the keys? where exactly are they?
3- did you use some sort of start-up script allowing you to change the keys such that you don't have to use ImageBuilder again just to change the keys?


you're welcome Very Happy.
1. yes
2. yes, i made a dir named files/ in the imagebuilder directory, and used FILES=files/ when building. Then I made the directories in files/ that I wanted in the final image, and put the files in there. if you make files/etc/filename then the final image will have /etc/filename. OpenVPN does not care about file location, so long as you configure everything to agree on whatever location you used.
3. no. I make a new image for every client. I configure EVERYTHING (password file, openvpn config, startup scripts, configure wifi, configure network subnet, etc) inside the script... then i just load the image to the router and I am finished.bald_eagle
bald_eagle
DD-WRT Novice


Joined: 17 Apr 2012
Posts: 3

PostPosted: Wed Apr 18, 2012 4:38    Post subject: Reply with quote
Thanks again krzee. Very interesting. I have 3 more questions, please.
1- this firmware version has some sort of GUI that allow the configuration of parts or all of what you configured in the files directories instead?
2- if not then how can the router be configured if the image is built with no files (FILES= )?
3- do you know of any straightforward list to follow and check all that is needed to be configured and the directories that have to be built in the files directory if I have to do it?
krzee
DD-WRT Novice


Joined: 02 Aug 2011
Posts: 7

PostPosted: Wed Apr 18, 2012 14:09    Post subject: Reply with quote
bald_eagle wrote:
Thanks again krzee. Very interesting. I have 3 more questions, please.
1- this firmware version has some sort of GUI that allow the configuration of parts or all of what you configured in the files directories instead?
2- if not then how can the router be configured if the image is built with no files (FILES= )?
3- do you know of any straightforward list to follow and check all that is needed to be configured and the directories that have to be built in the files directory if I have to do it?


1. no, i removed it to make room for openvpn
2. by knowing unix
3. no, this is pretty advanced
bald_eagle
DD-WRT Novice


Joined: 17 Apr 2012
Posts: 3

PostPosted: Thu Apr 19, 2012 8:25    Post subject: Reply with quote
krzee, I downloaded the last OpenWrt-ImageBuilder-ar71xx-for-Linux-i686 available and made an image with PROFILE=DIR600A1 PACKAGES="openvpn libuci" FILES= before I asked you my first questions above. I did not remove nor add nor change anything in the original files. I got 2 bins (factory and sysupgrade) both with 3.7MB. If the generation process was correctly performed (no errors reported)and openvpn was added to the original firmware then there is no need to remove anything from the image and it should fit into the NVRAM.
I asked you about the process and the treatment of keys because I don't have a DIR615 available to test the firmware yet. All my 3 routers are in heavy use in my network right now. I wanted to evaluate better my chances with this approach.
So my choice is between buy a new router that supports a dd-wrt version with openvpn included or to buy an used 615 E3, test the firmware on it and have more than one router with openvpn support if the firmware is OK. If it does not work then I would have to buy a new router with 8MB anyway.
For all the trouble and for the money involved, I will go with replacing one of my current routers by a new one with openvpn support.
I appreciate you answering my questions.
Regards
krzee
DD-WRT Novice


Joined: 02 Aug 2011
Posts: 7

PostPosted: Thu Apr 19, 2012 14:43    Post subject: Reply with quote
your image will not have the web interface in it, you did remove it, you just did not know that you did. you also did not add any files, like a password file... which means that if you flash a router to that firmware, you will have no access to the router.
note, if you are not advanced with unix, this is probably not for you... getting a nicer router would be the best bet for most people.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Hardware DIY / Hardware Mods 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