Python scripts on DD-WRT embedded router
Question: 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.


Answer: 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](http://www.dd-
wrt.com/wiki/index.php/Optware,_the_Right_Way). 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.

