A semi-easy firewall

A single-floppy firewall mini-distribution can be a quick and easy way to save yourself some money if you’ve got an old PC in a closet not doing anything, assuming you stumble across a combination of hardware that works right.
If you don’t stumble across a combination of hardware that works together, you can just as easily spend a weekend and accomplish nothing but uttering strings of four-letter words in combinations never before heard by mankind.

In case you came here looking for hardware that works, here are a few hints. A 10-megabit PCI NE2000 clone in combination with virtually any 10/100 PCI card ought to work fabulously. A pair of 10/100 PCI cards based on the RealTek 8139 chipset, which includes the majority of today’s inexpensive cards, probably will not. If you’re buying new stuff and want ease of use, get a 3Com card and a cheapie. If you want cheap and a little inconvenience, get a Netgear FA311 or 312 and a Realtek 8139-based card, such as a D-Link DFE-530+ or a Linksys. You’ll have to hunt down and install the natsemi.o module to get the Netgear working; most other inexpensive cards on the market will work with the rtl8139.o driver.

Freesco doesn’t supply a driver for the Intel EtherExpress Pro series out of the box. If you’ve got an EEpro, you can make it work by downloading the module and copying it to the floppy, but don’t rush out to buy one. And yes, the 3Com and Intel chipsets are high-performance chipsets, especially compared to the 8139, but remember, routers are machines that pull packets out of a 1.5-megabit pipe (if you’re lucky) and shove packets down an even smaller pipe. In this application, a $40 big-brand card doesn’t give you any advantage over a no-name card that costs $6 at Newegg.com

While these firewalls will technically work fine even on a 386sx/16, trying to make them work with ISA cards can be a long, difficult road. Used Pentium-75s are dirt cheap (and Pentium-60s and 66s are even cheaper, when you can find them) and they’re a lot less trouble because PCI cards don’t require you to rejumper them or hunt down a plug-and-play configuration disk to find out its IRQ and address. I’ve had the best luck with Pentiums that used an Intel Triton chipset or newer (the 430FX, HX, VX, or TX). I’ve tried a couple of boards that had a SiS chipset of 1995 vintage or so, and I could get one network card or the other working, but not both. I don’t want to generalize and say that based on two isolated incidents that all Taiwanese chipsets are junk for this application–for all I know, the problem could have been the BIOS on those boards–but I’ve done this on a handful of Triton-series boards and done well on all of them, and on two SiS boards and failed. Your mileage will probably vary.

How much memory do you need? 16 megs is sheer luxury.

Once you put all this together, the question becomes whether you use a floppy distribution or a full-blown distribution. If you want peace and quiet and cheap, the answer is pretty easy–use a floppy and pull out whatever hard drive was in there.

A full-out distribution like Red Hat or Debian will give you more versatility. You can run meaningful Web and FTP servers if you want (and your ISP allows it). You can run a caching nameserver to speed up your Web browsing. If you feel adventurous, you can even install the Squid caching proxy and speed up your browsing even more (but either use a SCSI drive or put in a bunch of extra memory and run Squid’s cache out of a ramdisk–Squid’s performance on IDE is, to put it mildly, terrible).

I’m having a hard time finding the documentation on how to set up a second network interface quickly. I believe it involves the file /etc/interfaces and the files /etc/sysconfig/ifconfig.eth0 and .eth1, but I don’t have a Linux box handy to investigate at the moment.

Anyway, I like Debian for this application (of course) because I can easily fit a minimal Debian on a 100-meg hard drive.

Once you get your network cards all working and talking to each other, you can build your firewall using this online tool. I just copy it, then Telnet into my Linux box using PuTTY, fire up a text editor, and right-click in the window to paste.

If you want versatility and quiet and don’t mind spending some cash, pick up a CompactFlash-to-IDE adapter and a CompactFlash card of suitable size. Don’t create a swapfile on the CF card–you’ll quickly burn it up that way. Your system will recognize it as a small IDE drive, giving you silent and reliable solid-state storage on the cheap.

A home Linux server? $1200?

ExtremeTech has an article about building a home Linux server. They’re recommending high-end P4s for the task. And I say, get real.
If what you want is a simple file/print server, anything that’ll take a 100-megabit NIC and has room for some good-sized hard drives will do great. You want a machine that’s running its PCI bus at 33 MHz, so a Pentium-133 is a better server than a Pentium-120, or, believe it or not, a Pentium-150. If the machine is marginal, get something other than an $8 D-Link 10/100 card or another card with the RealTek 8139 chipset. A pricier 3Com or Intel card will conserve CPU cycles for you.

Remember, too, that Linux doesn’t use the BIOS, so if a machine refuses to recognize that 200-gig hard drive you just bought, set the drive type to “none” in the BIOS and keep another, smaller drive in the system to boot from. Linux will pick up the monster drive and use it.

SCSI is much better for servers than IDE, but when two or three people (or one person) will be using it, the only advantage SCSI really offers is being better-built.

And the video recommendations in the article are absolutely ridiculous. You don’t need a GeForce 4MX 420. Dig around in your parts closet and find that 1-meg PCI video card you bought back in 1995 and haven’t used in five years. We’re talking a system that’s going to be using text mode. Or buy the very cheapest OEM AGP video card you can find to save a PCI slot for something useful–last time I looked, Newegg.com had a cheap AGP card based on an old ATI chipset for 18 bucks.

So don’t listen to those guys. If you want to build a Linux server and all you’ve got to work with is a Pentium-100, go for it. It won’t perform like their aging 1.13 GHz P3 (the slower machine in their benchmarks) but for a home network, it’s plenty. Keep in mind this Website is running off a P2-450. I’ve watched it under heavy traffic. There are two bottlenecks when it’s serving files to someone on broadband: My DSL connection, and the Web browser on the other side. The only time I’ve ever seen CPU usage on this box top 50% for more than a few seconds is when someone loads that giant GPS thread (the post with more than 200 comments).

Just be aware that some Linux distros aren’t too wild about older BIOSes. I’ve got a P133 that won’t boot the Mandrake 7.2 CD (yeah, it’s old–that’s how long it’s been since I used Mandrake) or the Debian 3.0 CD, but Debian 2.2 works fine. So be aware that you might have to experiment a little.

A useful Debian tool

apt-sources downloads a current list of Debian mirrors and benchmarks them, then writes an /etc/apt/apt-sources file for you, thus giving you an up-to-date and fastest-possible source of downloads.
It takes a while to run but if you do a lot of apt-getting, it’s likely to be worthwhile.

Patch your Linux distros

There’s a nasty vulnerability in recent SSL libraries that an Apache-based worm is currently exploiting. The patch is obviously the most critical on machines that are running secure Apache sites. But if you don’t like vulnerabilities, and you shouldn’t, go get your distribution’s latest updates.
This is why I like Debian; a simple apt-get update && apt-get upgrade brings me right up to speed.

CERT pointed out that Apache installations that contain the ServerTokens ProductOnly directive in their httpd.conf file aren’t affected. (I added it under the ServerName directive in my file–it’s not present at all in Debian by default.) This will hurt Linux’s standings in Netcraft, but are you more interested in security or advocacy? Increasingly, I’m more interested in security. No point in bragging that you’re more secure than Windows. Someone might make you prove it. I’d rather let someone else prove it.

While you’re making Apache volunteer as little information as possible, you might as well make the rest of your OS as quiet as possible too. You can find some information on that in an earlier post here.

Replacing my IDE CD-ROM with a SCSI CD-ROM

I pulled the IDE CD-ROM drive out of my main Linux box today and replaced it with a SCSI model, mostly because I like to keep a spare IDE CD-ROM drive loose and I had a couple of Toshiba 4X CD-ROM drives in my closet. I don’t use the CD-ROM drive in my Linux box very much, so a 4X is fine. Plus, making my Linux box into an all-SCSI system means I can compile out all the IDE support in my kernel if I ever feel ambitious.
I can never remember how to tell Linux I’ve swapped drives though. I’ve had to do this a number of times because not all my SCSI cards support bootable CDs, but all of my systems can boot off an IDE CD-ROM drive, so all too often I do my Linux install with an IDE drive.

The trick is to remember that SCSI CD-ROM devices are named srx, where x is a number. So when I installed a single SCSI CD-ROM, it became sr0.

So I went into /etc/fstab and found a line that looked like this:

/dev/cdrom /cdrom iso9660 defaults,ro,user,noauto 0 0

As far as I can tell, /dev/cdrom is a special device Debian creates during installation. I changed it to this:

/dev/sr0 /cdrom iso9660 defaults,ro,user,noauto 0 0

Now I can mount a cdrom from a command line with this command:

mount /cdrom

The unauthorized biography of rms

I’ve been reading an unauthorized biography of rms. Interesting. The guy’s so idealistic he still really, really annoys me, but he’s a typical, old-fashioned activist. Blaming an activist for being idealistic and unrealistic (and unreasonable) is like blaming a dog for barking. Yeah, it’s annoying, but it’s what dogs and activists do.
I’ve read the first two chapters earlier this week, but so far it seems to be pretty well done. I’ll be back later to read more, definitely.

An interesting type of cluster computing

Now here’s something that seems interesting and useful. The two times I want to cluster are when I’m rendering video (ick) or compiling something massive like KDE or Mozilla (quadruple ick).
Enter distcc, which lets you spread your C/C++ compiling out over a network.

The most obvious use for this would be source-based Linux distros like Gentoo, since those compiles take forever and most people who are interested in compiling Gentoo already have an army of existing Linux boxes.

If they succeed in getting distcc and Gentoo working together, I’ll give Gentoo a serious look. None of my machines are quick enough to build everything I’d want in a reasonable length of time, especially considering GCC 3.1’s slower speed. And what’s the point of using Gentoo if you’re not the first on the block with the compiler that generates the fastest code? But if I can distribute the load across my Duron-700, my dual Celeron-500, and whatever else I can scrounge up (which ranges from my work-owned P3-700 laptop down to a 66 MHz 486–I’ll probably keep the 486 on the bench), I’m willing to look at it.

The best Linux distro meets the best file system

So what’s so special about this server? It’s running Debian 3.0 on XFS, which is SGI’s industrial-strength journaling file system. It’s faster than ext3, more feature-complete than ReiserFS, and it’s been reliably shuffling bits as part of SGI’s IRIX operating system for the better part of a decade. You know you want it.
Read more

So you think Linux is unproven?

I’ve had arguments at work with one of the managers as to whether Linux is up to the task of running an enterprise-class Web server. When I mention my record with Linux running this site, the manager dismisses it, never mind that this site gets more traffic than a lot of the sites we run at work. So I went looking this afternoon for some sites that run on Linux, Apache, and PHP, like this one does.
I found a bunch of small-timers. Read more

Update your BIND servers

A buffer overflow vulnerability exists in a large number of versions of BIND. CERT released an advisory over the weekend. I haven’t seen this on most news sites yet. Read more