6

I've written two Python (2.x) scripts to perform the following:

  1. Custom Proxy server (imports optparse, ConfigParser, TLDextract, SocketServer...)
  2. Web admin for proxy (imports flask, ConfigParser, netifaces...)

These are both currently running on a Raspberry pi (Raspian), however I'm seeking some advice on some options on how to get these to run on a DDWRT router (v24).

My thoughts are either:

  1. Install python and required libraries on DDWRT. Whilst I have found some evidence that python can be installed via ipkg (on USB storage) I'm not clear how to get the required imported libraries installed too?

  2. Create a python-independent binary (e.g. PyInstaller) to run on DDWRT. I have hesitations going down this path as I imagine that I'd need to perform the task on a DDWRT running Python (i.e. back to thought 1), and also how it would handle the imported libraries?

  3. Similar to point 1: Compile a custom OpenWRT image which includes all required Python packages. This does seem like a complex piece of work.

Appreciate any advise that you may have.

Lucas Kauffman
  • 6,789
  • 15
  • 60
  • 86
MrDB
  • 659
  • 3
  • 7
  • 15

2 Answers2

2

You will need to use optware to get the packages and install them onto your router. There is a very good tutorial on the DD-WRT website. Through optware you can install the different python packages. Do mind that running flask and a proxyserver on a DDWRT router with a limited amount of memory might not be the best idea.

Lucas Kauffman
  • 6,789
  • 15
  • 60
  • 86
  • Agree on the performance concern, wanna give it a try though. For the python packages I've traditionally installed these via pip, and don't see them nor pip as available packages for DD/OpenWRT - any thoughts how best to get things like ConfigParser installed? – MrDB May 27 '13 at 08:10
  • 1
    You might need to do it manually then. Personally I'd just get the package and use it as a local library within your project rather than installing it. – Lucas Kauffman May 27 '13 at 08:14
  • Entware is now also supported by DD-WRT. It's very easy to install, and pip is available. https://wiki.dd-wrt.com/wiki/index.php/Installing_Entware – Matthew Lundberg Feb 25 '19 at 23:08
0

Entware

https://github.com/Entware/Entware

about 3 steps. Requires an ext2 usb attached with a label of Optware

thistleknot
  • 1,098
  • 16
  • 38