Zeroconf/Bonjour on the Router

Zeroconf (and its implementation by Apple that is called Bonjour) is a 3-layer protocol that makes IP-based devices let find each other by name easily. Such devices can be computers, routers, printers, scanners, faxes, cameras etc. It is an open protocol and is available in many platforms. On the basic level zeroconf creates a local domain, so devices are discoverable through names like ubuntu.local or canonprinter.local instead of 196.168.what.ever.

It always bugged me that my router did not support such a thing. Being a fundamental part of any network it seemes reasonable to support this feature and it would make the router adnimistration page or terminal easier to access. Unfortunately this does not seem to be a feature that will ever be supported by more mainstream 3rd party/open source router firmwares like DD-WRT or Tomato, while I feared tampering with OpenWrt. While I am confident with the command line, I was not sure I wanted to use such an interface on my router.

Apparently, as of this writing the current OpenWrt firmware includes the Luci web management interface in the default builds. I thought I will have to create my own firmware with the firmware image generator provided by OpenWrt, but I was wrong. I could install OpenWrt with the DD-WRT firmware update page, then configure it over the web quickly.

Later I found that the wireless configuration was broken (at least in branch). The wireless config should have been recreated. To do this, ssh into the router (ssh root@192.168.x.1 with the same password used on the web interface), and run "rm /etc/config/wireless; wifi detect > /etc/config/wireless" to create a clean config.

Then I added installed the mdnsresponder package in minutes even though I had no preexisting experience with OpenWrt, all using the web interface. I was surprised somewhat that such a system works even on my Linksys WRT54GL router with rather limited flash memory (4 Mebibytes to be specific).

So for me to have this working I had to do the following steps:
  1. Install the firmware.
  2. Do the basic configuration like for other routers. After finding out that I had to do it in "Essentials" rather than "Administration", it was even more straightforward than in DD-WRT despite having more experience with the latter.
  3. Next in Administration, go to System/Software to show the installed and available packages
  4. Click "Update Package Lists" now to see what is actually available
  5. Click "Install" in front of the package mdnsresponder. I used the "plain" mdnsresponder, perhaps howl-mdnsresponder or the avahi packages might also work.
  6. After some time the the package should be installed, update the package list again to confirm this.
  7. Once installed, the new service should be listed under Services/Initscripts, and can be enabled, started or stopped here. But before you do that, let's set up the desired name for the router.
  8. In Essential, go to System/General and enter the desired hostname if something else other than openwrt.local is desired. In my case I entered "linksys" which yielded the hostname linksys.local (ie. the ".local" part must not be entered)
  9. After specifying the hostname, go to Services/Initscripts of the Adnimistration area, and start or restart the mdnsresponder service, and make sure that it is enabled.
This is all, now I can access my router web administartion page through the address linksys.local, yeah!

Note: If you are wondering how does Zeroconf/Bonjour/Rendezwous compare with Viiv/DLNA/DHWG/UPnP, see In short: Zeroconf is the useful, open, nice and shiny thing that UPnP should have been in the first place. :)