Overview
It took me a while to figure out how to setup 802.11n in OpenWrt on Asus RT-N16 so I figured I'd share the process, hopefully to save somebody's time.
Background
I've used dd-wrt for a long time (on 4 wireless routers over the years). However, my network setup is getting more and more complex. While dd-wrt allows some customization, the inconsistency between GUI and the command-line configuration made it very hard for me to maintain. For example, editing the DHCP static address table from the GUI is a tedious process because it doesn't sort so it's very hard to detect duplication. I could edit the configuration file directly but the GUI does not reflect my changes correctly. Saving from the GUI can easily overwrite my manually edited config files.Choosing Alternatives
Therefore, I started to look for an alternative. Besides dd-wrt, Tomato and it's family, and OpenWrt are the other two high-profile router firmware development efforts. And both lineages provide very customizable environment.However, there are two things I'm looking for.
1. I am looking for a project that's still actively maintained, especially after Heart Bleed, Shell Shock, and Poodle. (Note that these vulnerabilities don't necessarily compromise home routers, but in my environment, I'd rather not take the chance.) While a repository system allows individual package upgrade, I want the base developers to still be around.
2. I'm looking for a project that's owned by a team rather than individuals. In the WRT history, there have been many brilliant individuals that made crucial advances for everyone. However, it has happened a few times when these individuals moved on, their projects died, too.
Therefore, I ended up choosing OpenWrt.
Installation
It was quite straightforward to switch to OpenWrt from dd-wrt, as instructed in the official guide.Securing the admin access was obvious. However, it took me a while to realize that I also needed to reboot my Cable Modem for it to reset its DHCP. If you are also doing this, I suggest you open all installation guides in the browser first before you flash your new firmware. I had to use my phone to check the guides before my internet was up.
802.11n
This took me a while because the guide is not very obvious. Anyway, after some trials and errors, broadcom-wl was the only one that worked for me (thanks to Stratos about the dependency nas. I already had that so I didn't realize that dependency).- # opkg update
- # opkg install kmod-brcm-wl wl wlc
- # rm /etc/config/wireless
- # opkg install nas
- # reboot
Then login to shell again to edit /etc/config/wireless . This is mine.
config wifi-device wl0
option type broadcom
option channel 1
option txantenna 3
option rxantenna 3
option txpower '20'
option plcphdr 'auto'
option frameburst 1
option disabled 0
config wifi-iface
option device wl0
option network lan
option mode ap
option ssid YOUR_SSID
option key YOUR_KEY
option wmm 1
option encryption 'psk2'
option disabled '0'
Another strange thing to work around is that after reboot, while a client can connect to the router with 802.11n, the DHCP failed to issue IPs. I had to turn the wifi off and on for it to work properly.
I did not spend time debugging. Instead, as a temporary workaround, I added that to /etc/rc.local, which now looks like this:
# wifi down
# wifi up
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
# workaround for Broadcom proprietary driver problem
/sbin/wifi down
/bin/sleep 1
/sbin/wifi up
exit 0
Thank you! Your workaround for the Broadcom proprietary driver helped me finish my configuration.
ReplyDeleteI'm glad that this guide helped you. Thank you for letting me know.
ReplyDeleteYou have to install utility called nas to get wifi authentication working:
ReplyDeleteopkg update
opkg install nas
Thanks a lot, StratoS. I've updated the post to include your info. I already had that installed so I didn't realize its dependency.
ReplyDeleteThank you for the info! I was not able to get a stable connection using the kmod-brcmsmac driver but 'kmod-brcm-wl' driver is rock solid!
ReplyDeleteThank you! I also had to switch the operating frequency in the wifi settings
ReplyDeletehttps://i.imgur.com/IIqwRfI.png
Thanks for letting me know, my anonymous friend.
ReplyDeletebadineu, I added a note at the end of the post to mention that. Thank you for adding that info.
Directions worked perfectly on the latest release, Chaos Calmer 15.05. Thanks for the info!
ReplyDeleteWonderful. Glad it helped.
DeleteThank u, it is working great!!
ReplyDeleteYou are welcome! Glad I could help.
DeleteI use N16 both as Client and Master.With what you gave
ReplyDelete/sbin/wifi down
/bin/sleep 1
/sbin/wifi up
Client mode works perfectly after reboot but Master mode does not.As you said,while a client can connect to the router with 802.11n, the DHCP failed to issue IPs.
Hero, my setting works for me on the Master (AP) mode, which is probably what most people use here, so I assume it works for most people on the Master mode. I'm therefore a bit surprised that you client mode works but master doesn't. I wish I could be of more help.
Deletehttp://screenshot.net/y2jolsp.jpg
ReplyDeleteBe careful using kmod-brcmsmac with the RT-N16. It uses 100% of the CPU at under 20mbits. The kmod-b43 works perfectly at 5% at about 20mbits, but unfortunately it doesn't support N. For me the Broadcom-wl proprietary driver isn't a solution because it doesn't support 802.1X authentication.
ReplyDeleteThanks for the information. My router CPU level is very low though. I wonder what made the difference on your side.
DeleteThanks. You saved my day. Unable to get 11n has been a huge trouble since i flashed my RT-N16 to OpenWrt
ReplyDeleteYou are welcome. I'm glad it was helpful for you.
Deleteworks with current release of 15.05.1. Thank you!
ReplyDeleteNote: the 2nd line of your instructions is missing 'install' after opkg...
opkg install kmod-brcm-wl wl wlc
Thank you! Updated.
DeleteThis comment has been removed by a blog administrator.
ReplyDeleteplcphdr makes absolutely no sense as it's absent from broadcom.sh script, that is mapping uci config to wlc command.
ReplyDelete