codeblog code is freedom — patching my itch

4/30/2006

slow debian mirror avoidance

Filed under: Networking — kees @ 8:02 pm

ftp.us.debian.org has 4 mirror servers in their DNS round-robin. One of them (216.37.55.114) is very slow (25Kb/s) for me. The others are blazing fast, especially 204.152.191.7 (800Kb/s). I’ve gotten sick of having to hit Ctrl-C to abort an apt-get, and then restart it, hoping to get a better server out of the DNS.

Today, I added the following to my machine’s iptables config, so that it will just redirect all attempts from the slow mirror to the fast mirror:

iptables -t nat -A OUTPUT -p tcp -d 216.37.55.114 –destination-port 80 -j DNAT –to-destination 204.152.191.7

If I wanted to do this for my whole network, I’d just slap this rule on my firewall and change “OUTPUT” to “PREROUTING”.

I love iptables.

© 2006, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Creative Commons License

No Comments »

No comments yet.

Leave a Reply

Your email address will not be published. Required fields are marked *

Powered by WordPress