There’s a lot to think about when setting up an Internet
gateway for a small LAN. One thing that you definitely don’t want it to do is
hold the line open indefinitely if you forget that you’re connected – and maybe
run up a big bill with your ISP (Internet Service Provider) in the process!
Fig.14: the "modemtool" utility is used to create the link between your modem and the file /dev/modem by selecting the relevant serial port.
Similarly, you don’t want it repeatedly dialling out,
connecting and disconnecting, if there is something wrong at your ISP’s end.
This could be a real problem if you run a program that automatically triggers
dial-outs according to a preset schedule – eg, an email server that regularly
connects to send and retrieve email.
A 20-cent local call mightn’t sound like much but several
thousand calls made at 1-minute intervals over a long-weekend will give you a
real pain in the wallet. Do the sums – ouch!
This Linux gateway overcomes the above problems by
automatically disconnecting after a preset "idle" time (ie, when there has been
no Internet traffic) and by limiting the number of unsuccessful connection
attempts. You can adjust both the idle time and the number of connection
attempts to your liking.
Another important thing to be considered is security. There are
plenty of bad guys out there on the Internet, just waiting to hack their way in
and wreak all kinds of havoc. We’ll tackle that problem as well.
Actually, we’re going to cover a fair bit of ground this month
to get the gateway working. First, we’re going to set up the modem, then we’re
going to get pppd (the point-to-point protocol dialler) working. After that,
we’re going to cover demand dialling, IP masquerading, IP forwarding and
firewalling.