How to install OpenWrt on Buffalo WHR-1166D
The Buffalo WHR-1166D is a nice and somewhat rare router. It runs stable, sparks quite well and is very cheap to have. Since the software support has been discontinued some time ago, we equip it with OpenWrt. If you can install the new software directly on other routers, you need a little trick with the buffalo model: first a modified software has to be loaded via TFTP, from which the actual OpenWrt is installed. But this is less complicated than it sounds.
This guide is based on this guide and this forum thread.
Buffalo WHR-1166D flashing with OpenWRT - preparation
In preparation you will need to download this TFTP Server for the Mac, this firmware file (it's called the DHP at the end, that's correct) and the current version of OpenWRT, which you can find here.
Instructions: Equipping WHR-1166D with OpenWRT
1. Connect router, set IP
First you connect your Mac and the router (not the WAN port) with a cable. On your Mac, set the IP 192.168.11.168 in the Network Settings.
2. Start TFTP Server
Opens the downloaded TFTP program. Sets it to offer the downloaded firmware listening to DHP for download. Then switches on the TFTP server. The program does nothing else but offer the set software to devices that ask for it. And this will be our router in a moment.
3. Plug the power cable into the router and press and hold the AOSS key
Now hold down the red AOSS button on the front of the router while connecting the power cable. The router now searches for new software under the IP address that you set on your Mac and the TFTP server offers it. If this is successful, the router should light up like a Christmas tree. The TFTP server may not show anything in the log, so keep an eye on the router.
If the LEDs light up, wait a few minutes. Then try to reach the router at 192.168.11.1. If that doesn't work, that's a good sign.
4. Change IP address on the Mac
This means that the firmware that has just been transferred has already taken over. This allows us to finally flash the router. To do this, change the IP address of your Mac like before, but now to 192.168.1.5. The Buffalo should be reachable under 192.168.1.1. If this works, we will now finally flash OpenWrt,
5. OpenWrt flash
For this purpose go to the graphical user interface at System > Flash Firmware. There you select the latest version of OpenWrt under "Flash new firmware image". The router checks this and asks again.
6. Done!
After a few minutes (go have a coffee) the router should have restarted and should welcome you with the new OpenWrt graphic. Done!
Here's a hint, if you want to use the router as an access point (taken from the OpenWrt forum linked above).