Scott Hanselman

Linksys Firmware DD-WRT BitTorrent optimizations

February 14, '06 Comments [0] Posted in Musings
Sponsored By

Dd-wrt-puttyAfter updating my Linksys Router to DD-WRT I turned on syslogd, the router's equivalent of a Windows Event Log. You turn on the syslogd service within the Web Management interface, then point it to the IP address of machine running a Syslog listener. For my main Windows machine I use Kiwi Syslog Daemon.

I noticed a lot of connections being dropped and a lot of complaints of bad ICMP (ping) packets. I also noticed that my aggregate BitTorrent throughput had dropped considerably. Seems that the default 512 connections that the firmware is configured with wasn't going to work out.

After poking around about a dozen sites and forums I added these settings to my rc_startup (the router's "autoexec.bat"). These settings are an aggregate of three different site's suggestions and have worked fine for me. Your mileage may vary.

Use PuTTY to SSH into your router. Log in as 'root' with your router's admin password. At this point you can screw up your router, so be warned. These routers have NVRAM (nonvolatile RAM) so we'll write to that an "rc_startup." You can also have an rc_shutdown if you like.

To check the value of your rc_startup do this:

nvram get rc_startup

If you don't have one, you can add startup script like this. These values ignore some irritating warnings, lower the TCP timeouts to values that are more reasonable if you seed torrents and raises the connections to the max 4096.

nvram set rc_startup="
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
echo '600 1800 120 60 120 120 10 60 30 120' > /proc/sys/net/ipv4/ip_conntrack_tcp_timeouts
echo 4096 > /proc/sys/net/ipv4/ip_conntrack_max
"

nvram commit

reboot

These values have worked nicely for me the last few days. There's more details on startup scripts at the WRT Wiki. If you've got good values that have worked for you, add them in the comments of this post.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.