Archive for the ‘DD-WRT’ Category

Simple Opkg Tutorial

Mittwoch, April 17th, 2013

In order to show you how to use the new advanced opkg software package manager that is included in my builds. I’m going to explain how to setup and use opkg to extend your routers functionality.

Here are the steps in order to prepare your router for opkg:

  1. Prepare a usb drive with at least one ext2/ext3 partition: You can use any Windows partition software or linux live system to do that e.g.  http://gparted.sourceforge.net/
  2. Attach the usb drive to your router and setup Services->USB.  Once the drive shows up under Disk Info, copy and paste the UUID of the partition into the Mount this Partition to /opt text field
  3. Reboot the router
  4. The drive should be mounted to /opt now , you can verify this by looking at the Disk Info output

Lets work with Opkg now:

Login to the router via telnet or ssh:

  1. Retrieve the list of available packages, by executing command opkg update
  2. List available packages opkg list
  3. Search for some extra editor e.g. opkg list | grep editor
  4. Install editor nano opkg install nano
  5. Run nano by executing nano. Oops you will see Error opening terminal: xterm. Well the reason for this is by default no terminfo is set, so lets do that by entering command export TERMINFO=/opt/usr/share/terminfo into you console window. Now start nano again

Opkg of course can do a few more things. Thus just execute opkg without arguments and look at the options in order to list/remove installed packages etc.

At this time you should have a basic understanding of opkg package management. Opkg will store packages config files etc. under /opt. Some packages come along with config files that you need to edit in order to make them work in the way you want them, just search under /opt/etc for these files.

*Note: The default package url that is included in my build points to the openwrt repository. Since these packages have been compiled with the openwrt sdk not all packages will work under dd-wrt. This comes from the fact, that dd-wrt uses a modified ethernet structure header and packages that were not compiled with the dd-wrt sdk cannot query all ethernet infos and will fail to get details about the existing interfaces e.g. ushare is affected by this.

DD-WRT Kong Mod Opensource Enterprise Class Monitoring – Zabbix

Sonntag, Januar 27th, 2013

Build >=20500 includes Zabbix (Enterprise Class Monitoring Client)  which allows you  to monitor your wireless router. You will find a new section in dd-wrts router webinterface where you can activate and configure the zabbix client. In order to monitor your wireless router you need to setup a zabbix server.

The following screen shots display actual data and the template setup for a dd-wrt router with included zabbix client.

data.png

graph.png

template.png

DD-WRT Kong Mod Update

Donnerstag, Mai 10th, 2012

For more information visit: MyOpenRouter

Download

Supported Models: WNR3500L V1 | RT-N16 | WRT610N V1/V2 | E3000 | E3200 | E4200 | F7D4302 | F7D3302

Komg Mod – DLNA Media Server Setup

Donnerstag, August 25th, 2011

I’m going to explain in a few simple steps how to setup a Streaming Media Server using my dd-wrt build with integrated MiniDLNA.

1. Enabling USB Storage Support

usb.png

click to enlarge

There is not much to say here except. In my case I choose /jffs as mountpoint. JFFS is the prefered moint in case you want to make use of the jffs filesystem which is used to prevent excessive wear from flash cells. The mountpoint /opt is used whenever you want to use optware packages. Optware packages include a install script that usually install “optware”packages in the directory /opt, dd-wrt checks the location /opt for apps, scripts etc, that’s how optware basically works.

With the latest builds usb media will also be automatically mounted to the mointpoint /mnt. So if you leave everything empty you should find the contents of your drives partitions under /mnt/disc<x>_part<y> where x is the disc number and y is the partition number. Thus if you have  a single drives with 2 partitions attached. They will be automatically mounted to:

/mnt/disc0_part1

/mnt/disc0_part2

2. Enable DLNA Server

minidlna.png

click to enlarge

No it is time to enable the DLNA Server. Fill in the neccessary information for minidlna by specifying  the Server Identification. This is the string that will later be displayed by your media clients.

Now enter the directories. As noted earlier  I told dd-wrt to moint my partition, that contains the videos, to /jffs. I placed my videos in a directory share/video, since the partition was mounted to /jffs the full path to my videos is /jffs/share/video. If you remove this drive and attach it to windows  you would find the files for example under  D:\share\video. Same applies to pictures etc.

Now you can specify an update intervall. In my case I set it to 240s. So when I copy a new video to the router e.g. via samba share it will take up 240s until this new files is added to minidlnas database, and until the client sees it. Normally you can leave this field empty, since the default value should be fine.

A more important setting is the DB Path . The db path is the place where minidlna stores the index database. The default is to store it in /tmp directory which means it is purely inside the routers ram. Now if you have lots of media files this db can get very big and consume several megabytes, the consequence of that is that you run out of ram on the router and the router will be slowed down. In extreme cases the router will not be able to handle new connections etc. My advice, if you have more then 500 files in those directories store the db somewhere on the external media.

3. Start your client and check it is working. E.g. Windows 7 Media Player

FAQ:

1) How do I know minidlna is running?

Check “Status->Sysinfo” under Services you will find the status of minidlna

2) How long does it take to index the directories

This depends on the amount of files. A rough guess 1min for 500 files.

3) How can I debug minidlna

Logon to the router e.g ssh and make sure minidlna is stopped, e.g. killall minidlna. Now start minidlna in debug mode:   /usr/sbin/minidlna -R -d -f /tmp/minidlna.conf

DD-WRT with integrated Tracker and Adblocking using Privoxy

Freitag, April 8th, 2011

I have just integrated another feature. Here comes a proxy server with default rules for adblocking and tracking mechanisms like Google Analytics, Facebook Ilike Button…

This does not mean you cannot use Facebook or Google anymore, this just blocks tracking through 3rd party sites.

NOTE: You may have seen scripts that download host lists onto your router in order to redirect hostnames from well known adblocking servers to your routers ip . While this is an effective method to avoid certain ads it is the biggest security hole for your router. You have no control over the external host list, in case it was manipulated you are going to be redirected like a fool, to prepared servers that are just waiting to load you with malware etc.

Thus if you have never heard of privoxy you should start your browser and direct it to http://www.privoxy.org/.

proxy.png

Click to enlarge

The image shows the configuration page which allows to enable privoxy. In standard mode it will just act as a normal proxy that filters ads and other annoying content. In this mode you have to setup each clients browser to use the proxy: <routersip>:<port> e.g. 192.168.1.1 : 8118

In transparent mode all http traffic will be intercepted by the proxy, and every client will connect through the proxy, this is useful if you want to enforce the rules you defined. Lets say for example you want to filter out adult content and don’t want your kids to bypass your filter. The Custom Configuration is needed if you want to place your filter rules on a removable writeable media so you can create your own set of rules. To do this you would just use the standard config located under /tmp/privoxy.conf copy and paste the content and replace the paths to the actionfiles.

Note: In transparent mode the access to the dd-wrt page goes through the proxy, if the proxy dies for whatever reason you cannot reach the routers webif. In this case you can logon to through a shell and disable transparent mode with the command:

nvram set privoxy_transp_enable=0

nvram commit

Then restart the router. This will stop the firewall rule that enforces transparent mode.

Download Broadcom Build (8MB Units 47xx: Netgear WNR3500L, Asus RT-N16, Linksys WRT610N V1/V2):

Kong-Mod-USB-FTP-SAMBA3-OPENVPN

Kong mod update build 15758

Dienstag, November 2nd, 2010

See myopenrouter announcement for a new set of my dd-wrt mods:

Myopenrouter

Kond Mod Status Update

Sonntag, Oktober 3rd, 2010

I’m currently testing a new feature: filtering ads directly on the router

The next release will have privoxy onboard + default rules that block most ads before they reach your client computers.

This usually increases surfing speed and enhances security since ad servers are often used to send malware to browsers.

With custom rules one will be able to filter adult, gaming … sites. A transparent mode can be activated, which makes sure clients cannot bypass the filter.

 

DD-WRT Samba Custom Configuration – Kong Mod

Donnerstag, September 9th, 2010

Here is a little tutorial on how to create a custom configuration for samba. I assume you already have my dd-wrt mod installed. Once you enable Samba under Services->NAS you will see this Form:

smbcustom.png

Click to enlarge

Now to create a custom configuration you can just use the smb.conf which is created once you setup samba with public share. This file is located under /tmp/smb.conf. In the following example I added two users with special shares and changed the location of the public share. In addition to that it is neccessary to create the appropriate directorys on your usb drive ( in this example /jffs/boss, /jffs/cat, /jffs/public) :

 

[global]
server string = Kong
workgroup = Secure
interfaces = br*
bind interfaces only = Yes
map to guest = Bad User
smb passwd file = /var/samba/smbpasswd
private dir = /var/samba
passdb backend = smbpasswd
log file = /var/smbd.log
max log size = 1000
printing = none
load printers = No
usershare allow guests = Yes
socket options = TCP_NODELAY IPTOS_LOWDELAY

[Boss]
comment = Boss share
path = /jffs/boss
read only = No
guest ok = No
valid users = Boss
force user = root

[Cat]
comment = Cat share
path = /jffs/cat
read only = No
guest ok = No
valid users = Cat
force user = root

[Public]
comment = Public Share
path = /jffs/public
read only = No
guest ok = Yes
force user = root

Unless you know what you are doing you should keep the default options in global section, but you probably want to change some values like your server string and workgroup . Once you copied your config into the Custom Configuration textbox press Apply Settings. After that you can access your new shares.

Update 5th May 11: Latest builds require the option force user = root since they don’t mount partitions using option user

Update 3rd June 11: Kong builds >= 17140 have a new samba gui, there you can create multiple shares + users without the need of a custom config.

USB drive not recognized – WNR3500L

Montag, August 30th, 2010

If you have trouble getting your usb drive to work with the wnr3500l you may want to test these steps:

  • usb port is deactivated – activate it by pressing poweroff button, wait 10s, poweron again by pressing the powerbutton
  • if you use a usb hub, make sure it has it’s own power source
  • if nothing helps, do a 30/30/30 reset

Update: DD-WRT Kong Mod build 15000

Montag, August 30th, 2010

Here comes another release of my dd-wrt mod, now based on dd-wrt build 15000.

New:

-attempt to cleanly umount usb devices on reboot

Fixed:

-correctly create second samba user when using custom configuration

-fix black on black bug in nas section under safari/konqueror(using webkit)

Downloads:

Kong-Mod-USB-FTP-SAMBA3-DLNA

Kong-Mod-USB-FTP-SAMBA3-OPENVPN