Index


RISC World

Networking

Richard Walker

Networking series Part6 : A low cost router

Richard Walker

This time, we are going to look at setting up a low-cost software router device for sharing one Internet connection between a number of other computers over a network. The theory behind this was discussed in detail in the previous article. Various types of Internet connection can be shared with such a router.

Dial-up options

Broadband options

Note that if you have a device that connects to an ISDN or ADSL socket, and then directly into an Ethernet network, it may include built-in connection sharing features. If not, you can connect it a router, just like anything else.

Also, it may sound crazy to share a plain 56k dial-up modem connection, but it's actually quite practical. Remember that each computer won't necessarily want to use the full 56k bandwidth all of the time. Internet activity is often in bursts � consider that you might wait for a web page to download, but then spend a few minutes reading it.

To visualise the concept of such a router, study figure 1.

Note that in the case presented in figure 1, the Internet connection is provided by a cable modem which connects itself to the router via Ethernet. This could just as easily be USB - indeed, many cable and ADSL modems connect via USB. Getting slightly more complicated, the connection could also be provided by a standard 56k modem, connected via the serial port.

The slightly more tricky bit to visualise is that the router's WAN network interface card and the modem could be provided on one single card, so we would end up with something like figure 2.

Note that the ISDN interface card provides the ISDN-specific hardware (equivalent to the kind of thing a cable or ADSL modem does) and it also appears as a standard network interface card. It's an all-in-one solution.

Logically, the exact same scenario is possible with a standard 56k PSTN modem card: the 'WAN interface' will be either a serial /USB port (for connecting an external modem) or an internal PCI/ISA modem card. Although you may not think of these as 'network cards', for the purposes of routing, they are!

Obviously, PSTN and ISDN dial-up solutions are not always connected (unlike broadband) so the router would have to have some kind of connection control - just like the connect/hangup functionality provided by the ANT Internet Suite or R-Comp's DialUp. Many dial-up routers can be configured to dial on demand ('demand-dial') within certain times of the day (e.g. at evenings) or week, and can automatically disconnect after a period of inactivity (e.g. five minutes).

The router itself

The principal component of the router is an old 486/Pentium PC. Note that it doesn't have to be old, but there is simply no point in using anything modern for the simple task of routing � it's a waste of processor power. It's quite possible to come across a 486 or low-end Pentium (between 60 and 233 MHz) sitting gathering dust in a cupboard in a local school or business, or even in a skip! (Yep - thats where a lot of my stuff came from -ED). It is desirable to stick to systems that have PCI slots rather than the ISA or VLB � they are far easier to configure!

As a bare minimum, you will need a base unit with a working power supply, motherboard, processor and RAM. If you come across a number of similar machines, it might be a good idea to grab the RAM from several, so you can have more in the one machine you take. Other essentials are a floppy drive and keyboard, but you may be able to get these from elsewhere.

Study figures 1 and 2, and decide if you need one or two Ethernet cards - it depends on your equipment. If you need two, it is absolutely fine to install two of the same make and model, or two completely different cards.

The first network card will connect to your local area network (which is probably Ethernet). The second will connect to the hardware that provides your Internet connection. If your PC didn"t come with network cards then you can always purchase one or two � new ones can be had for less than £10 each. Go for NE2000-compatible PCI cards, preferably a model with 10/100baseT and 10base2 (for maximum flexibility). RealTek RTL8029 cards are particularly common, and I have used them many times without a problem.

A note on TCP/IP

It's assumed that your have a local area network already set up (see the advice in previous articles). The router will obviously require it's own IP address and hostname, and must be configured so it fits in with your own addressing scheme. For example, my own network is illustrated in figure 3.

If you forget about the router and the cable modem, there is a fully-functional TCP/IP network there. It it possible for each computer to communicate with another one for the usual network activities (file and printer sharing, playing games, sending messages etc.). The router adds Internet access to the computers already on the network.

PC cleaning and building

It is always a good idea to give the computer a strip-down, thorough clean, and re-build � they are usually full of dust! In addition, you might wish to discard some parts (e.g. such as sound cards), as they are not needed, and it makes sense to have as little as possible fitted. When you switch the machine back on, it's a good idea to load the default BIOS settings (this is equivalent to a DELETE-power-on on a RISC OS machine) and check things like the time are correct.

PC-based routing software

There are two kinds of software that you can install to actually perform the routing on this computer: single-floppy or hard disk based. The latter will be have extended functionality, such as extra logging and optional services (e.g. a caching proxy server or web server). If you want such extra functionality, then the computer will obviously need a hard disk - otherwise, you can run the computer without one. The advantages of not using a hard disk include: less moving parts and no worries about unexpected power losses.

Freesco is a popular single-floppy disk system. See www.freesco.org. SmoothWall GPL is a popular hard disk system. See www.smoothwall.org.

Both Freesco and SmoothWall are actually based on Linux. They use a cut-down kernel and the bare minimum of required tools to get a system up and running, all of which is surprisingly compact (around the size of a floppy disk in the case of Freesco). SmoothWall has a number of extras such as a caching proxy server, dynamic DNS clients, and support for more exotic routing and logging.

The router software is freely available, and to get it onto your router computer, you need to download a 'disk image' (from the Internet) which is then written to a real floppy disk. You can do this with another computer running just about any operating system (even RISC OS!).

Freesco actually works from this floppy disk. The router PC will boot from it, and use it for everything. SmoothWall uses two floppies, but they are only used to for the basic installation (a CD ROM or network connection is required for the remainder), and the PC will boot from and use the hard disk in general.

So, with the right PC hardware all connected up, you can insert a Freesco floppy disk. The PC should boot from there and take you to a configuration walk-through system. I will cover this in more detail next time.

Simpler router software?

If all this sounds too technical, there are router programs available for Windows, if you would rather install that on your router PC (this does raise the minimum hardware specification, though!). Windows 98SE, Me, 2000 and XP include 'Internet Connection Sharing'. This just requires a few clicks in Control Panel to setup, and if you are unsure, Windows Help will guide you through it. ICS works in exactly the same way as Freesco and SmoothWall (NAT) but it does seem wasteful to have a whole Windows licence and installation just for routing!

You could, of course, use one of your general-purpose Windows PCs (if you have one!) as a router in addition to it's current tasks. ICS runs in the background, and doesn't use much in the way of system resources. Therefore, when the Windows PC is switched on, the RISC OS machine will be able to use the Internet connection. If you tend to have your Windows machine switched on for most of the time that the RISC OS machine is switched on, then maybe you could get away with this kind of arrangement.

Client-side configuration

Once the router is correctly configured, the other computers on the network need to be made aware of it. Thankfully, this is simple. We simply need to tell them that non-local computers (i.e. the Internet!) are reachable via our router, and ensure that domain name lookups work.

On a RISC OS 3.7 or 4.0 computer, the procedure with Boot/Configure is:

Double-click Boot to start Configure
Click Network
Click Internet
Click Routing

Set the gateway to the IP address of your router Click Set then Click Hostnames. Set the primary name server to the IP address of your router Select 'Use name servers also' Click Set Click Close and re-boot as suggested Run Browse (or whatever) and check that you can reach a machine on the Internet (e.g. go to http://news.bbc.co.uk).

You can also connect to the computer running Freesco or SmoothWall with a terminal program (such as Nettle) and/or a web browser (such as Fresco). This will show you the system status, and allow you to make configuration changes and perform tasks such as re-booting or shutting down. Therefore, you can run the router without it's own keyboard and monitor most of the time. OK, so it's not quite as elegant as a dedicated hardware router, but it's much cheaper!

Why not use old Acorns?

You may be wondering why an old PC was used for this task, rather than an old Acorn machine (e.g. an Archimedes 310). The reasons for this are simple: hardware cost/availability and software suitability. On the hardware front, an Ethernet, USB or high-speed serial card for an A310 is very expensive. Also, RISC OS doesn't have the required TCP/IP routing software � this was only provided by FreeNet 2.0 (a freeware alternative to Acorn"s TCP/IP modules, back in the days when Acorn"s cost £199) which was never released beyond alpha/beta status (Acorn decided to freely release their modules!).

In theory, you could install Linux on an old Archimedes, and so long as appropriate drivers existed for your network interfaces, it would work. This would require a pretty massive effort, as the standard editions of Freesco and SmoothWall would not support such a configuration. Only a true Acorn die-hard would consider it! Actually, I'd be interested to hear from anyone with such a setup!

Signing off

Next time, we will look at the configuration side of Freesco or SmoothWall in more detail, and explain a little more about what they can do. In the mean time, their web sites are an excellent source of information. As usual, please get in touch with The Editor or myself if you want to make suggestions or raise queries regarding this series.

Richard Walker

 Index