OpenWRT is a fantastic open source distribution for embedded devices, such as the Linksys WRT-54G series of wireless routers. One of its many features is the use of dnsmasq, a combined DNS and DHCP server, useful on small networks that are sitting behind a NAT connection.
The downside of dnsmasq on OpenWRT, however, is that the default configuration uses your ISP's DNS servers, which can be problematic, if your ISP, like many others, is adopting bad habits of redirecting non-existent domains to their servers, or is blacklisting / censoring websites without asking you.
For this, and for so many other reasons, it's a much better idea to run your own local DNS resolver. Unfortunately, dnsmasq isn't cable of doing this, so it's necessary to install a DNS server that can do this on its own. In this article, I describe how to do this.
Fortunately, sch_htb, the Hierarchical Token Bucket is available on OpenWRT, which can do the same thing, but it's a lot more complicated to configure.
The following script will rate limit the single IP address of 192.168.0.67 to 128kbps. All other addresses on the network will remain unlimited. Set the name of the inside interface on your Linux router in DEV, the IP address in IP, the maximum rate on your inside network in MAXRATE and the limit that you want to apply in LIMIT.
Every new release of Ubuntu seems to break something that was working on my systems, and it was no different with the 10.04 release of Ubuntu: my Huawei e169 mobile broadband modem, which can be used in Australia on the Optus, Vodafone and Virgin mobile networks, and in Europe almost everywhere, stopped working.
The device would appear in the filesystem, but no matter what I did, it refused to connect.
It's quite easy to fix this, in fact. Firstly, install the usb-modeswitch package:
sudo apt-get install usb-modeswitch
Then create the file /etc/udev/rules.d/75-e169.rules with the following contents:
Ten years ago, shortly after I started my first job as a network programmer at an Australian university, I received a call from a person working in one faculty who was having some network difficulties. All of their computers were connected together by 50-ohm coaxial cable ethernet, and two of the computers on this network sent a considerable amount of data to each other.
This data, naturally, was echoed along the entire network cable and was the primary cause of delays and packet loss to other users of the network. The caller wanted to know of a way to solve this problem. My manager suggested the use of a bridge; the two noisy computers could be placed behind this device and their traffic to each other would be confined to their segment. This solution was particularly attractive as it would not require any other changes to the network or the network numbering; it could be inserted and would work immediately.
For a number of years now, the Linux kernel has had the ability to turn any host with more than one network interface into a bridge. This article explains how it works.