Is it possible to install a small program on a cheap home router that runs a Linux kernel and run it? I mean can I use a router that runs a Linux OS as a small computer to run arbitrary code on it?

I'm not trying to do any harm, i'm just curious if it can be done.

link|improve this question
5  
Yes. Look at DD-WRT. However, you won't get any normal IO devices (screen or keyboard) – SLaks Nov 1 '11 at 15:36
don't really need that. just the ability to run some scripts or a binary. i guess a binary should be compiled with the routers architecture in mind. i'll check it out. thanks – Vlad Nov 1 '11 at 15:45
feedback

migrated from stackoverflow.com Nov 1 '11 at 18:06

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 4 down vote accepted

Yes, see http://www.dd-wrt.com/site/index

DD-WRT is a Linux based alternative OpenSource firmware suitable for a great variety of WLAN routers and embedded systems. The main emphasis lies on providing the easiest possible handling while at the same time supporting a great number of functionalities within the framework of the respective hardware platform used.

link|improve this answer
thanks. i'll check to see if it's compatible with my router – Vlad Nov 1 '11 at 15:43
@slhck thanks for adding the snip – hafichuk Nov 3 '11 at 4:44
feedback

Yes, but it's not easy. You have to know about device drivers on Linux, and have to get enough knowledge to write kernel (which derivative Linux on a router) code.

Linux systems make changes to their kernel which are modified by producers of machines (doesn't mather whether they are for modems, camera encoders, computers, and so on). Yes it should have Bash, but that's up to you. It's not necessary but it includes everything you want, maybe all you have to do is a task to shutdown or reboot it...

link|improve this answer
not looking into customizing the kernel, if it runs linux then it should have bash. i only need to do some scripting. like powering my main computer through wol – Vlad Nov 1 '11 at 15:42
linux systems changes up to their kernel which is modified by producer of machines(modems,camera encoders,computers etc). Yes it should have bash but up to your necessary its not include everything you want, maybe all have done task as shotdown or reboot etc. – mekici Nov 1 '11 at 15:49
@Vlad - embedded versions of Linux may not have equivalent shells like a desktop. Busybox is typically used to implement the shell and utilities, and since it is highly customizeable, some capabilities may get omitted. – sawdust Nov 1 '11 at 22:31
@Tom cheers for edit :) – mekici Nov 2 '11 at 13:33
feedback

Possible but impractical - those devices have around 32 MB of RAM (sometimes less!), and next to no processing power. It is far easier to get one of those "nettop" cheap&small x86 computers and make it into a wireless router (e.g. using Voyage Linux).

link|improve this answer
i know it's far fetched, but i already have the router and i don't have the money to buy a new pc :) – Vlad Nov 1 '11 at 15:46
and i think the router has a lower power consumption than a pc – Vlad Nov 1 '11 at 15:47
@Vlad: Indeed it has - mostly achieved by being slower. But yes, it is possible - e.g. with DD-WRT, as mentioned by the other answers. – Piskvor Nov 1 '11 at 23:13
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.