Setting Up an Internet Connection

Last updated: December 29, 1998
Development stage: Beta

Setting up an Internet connection can get tricky, even frustrating, especially if you're a new Linux user. If your ISP is like most others, it will use Point-to-Point Protocol. I will first describe setting up and using minicom and pppd separately, and then using a chatscript. One can connect to the Internet with either of these methods; if one doesn't work for you, try the other. If both work for you, then you can choose whichever one is the most convenient.

If you want to try to get set up quickly, there's a web-based configuration script that will help you. It uses CGI scripts to create files for you to paste into your configuration files in /etc/ppp/. The URL is http://www.linux.net.nz/pppconfig/.

Lord Pyromage mentioned the pppsetup program, which comes with Slackware. According to him, it makes the PPP setup process much easier. So if you've got Slackware, you might want to give it a try if you don't want to read this page.

If I haven't scared you away by now, read on. Please, please be patient with my writing. I try to explain things so you'll understand, not so you'll get through it quickly. I try, though. :-)

  1. Using Minicom with PPPd
  2. Using a Chatscript
  3. Disconnecting
  4. Modem Trouble
  5. Author's Notes

Using Minicom with PPPd

First you should start out by configuring minicom (a terminal dialup program). At the Linux prompt, as root, type minicom -s.

That will load minicom in setup mode; after this, just set up the configurations: modem initialization strings (if you have a generic modem the initialization string you might want to try using would be AT&D2; consult your modem manual for the fancy options), baud rate, and so on. Make sure all this is done, and then choose 'Save as dfl' (saving it as the default) from the main minicom menu.

If minicom complains about not having /dev/modem, get out of the program and type ln -sf /dev/ttyS1 /dev/modem. If your modem was on COM2 under DOS or Windows, use that. Otherwise if you have COM1, for example, you'd use ttyS0 instead of ttyS1. The number after the letters is one less, since Linux starts at 0 instead of 1.

Stuff to Watch Out For

I would try watching out for what baud rate you use. Don't use too high of a baud rate, or you might be disconnected because of an unstable connection. Also, make sure the baud rate is high enough to use your modem at its highest speed. I put the baud rate up just one setting above my modem's fastest transfer speed. Your initialization string could possibly also have something to do with unstable connections. If you don't know what you're doing (like me), I would suggest that you use a simple initialization string like AT&D2.

DNS and Nameserver Configuration

At the Linux prompt again, type pico /etc/resolv.conf to enter the nameserver addresses.

Insert something similar to the following lines, replacing them to match your own:

search local.net
nameserver 205.136.28.2

A nameserver is a machine that most providers set up to translate the hostnames of Internet hosts into their IP addresses (for example, it would resolve www.local.net to 205.136.38.10). Many ISPs have more than one nameserver, so don't be confused if you receive two (or more) addresses when requesting information about your ISP's nameserver. You might want someone who is already using Linux to do a dnsquery on your ISP's domain. For example, if your ISP is Local Net (mine) and their front page is at http://www.local.net, then have whoever is doing the DNS query type this:

dnsquery local.net

Or:

dnsquery www.local.net

Again, I'm using my own ISP as an example. There will also probably be a secondary nameserver for your ISP, so you can use either one, or even better, both. The nameservers are the last lines in the dnsquery; make sure the person doing the dnsquery knows that. Yours will be different if you don't use Local Net as your provider. I want the IP address of ns2.local.net, not the hostname. ns2.local.net is 205.136.38.2 so I write that down somewhere.

Just add that "nameserver" line in /etc/resolv.conf followed by the IP address of the actual nameserver (205.136.38.2) and complete the rest of the process. You can also call up your ISP through the phone and ask them the IP address of the nameserver, if you don't know anyone who is already on Linux or who can find out. If you already know what your ISP's nameserver is, then you didn't really need to read the previous few paragraphs on the nameserver.

As far as I know, you can use anybody's nameserver as long as you have the IP address (numerical, e.g. 205.226.156.2) for it. That means you can have your /etc/resolv.conf file look exactly like mine and it would still work.

PPP Options

Now you also should edit /etc/ppp/options by typing pico /etc/ppp/options. This is really important in starting point-to-point protocol (PPP). If you don't fill it in you'll have to specify the options every time you type pppd, and that's would be a big hassle. Insert the following lines into the file:

0.0.0.0:
/dev/ttyS1
lock
crtscts
defaultroute
asyncmap 0
mtu 576
mru 576

The only thing you might need to change is the device entry that tells which device to use for PPP. On my computer, with my external modem using COM2, it's /dev/ttyS1. You should know what COM port your modem is using, either from your experience as a DOS/Windows user or as a frequent Linux user (which you're probably not... for now).

Once you find that, you can refer to that device using /dev/modem by making a symbolic link from /dev/ttySX ('X' representing whatever that number is) to /dev/modem. Do this by typing the following:

ln -s /dev/ttyS1 /dev/modem

Replace ttyS1 with whatever the device that you're using is, if necessary. The basic way to remember is that ttyS0 is actually COM1 under DOS, ttyS1 is COM2, ttyS2 is COM3, and so on; the number following "ttyS" is just one number less than the number following "COM" in DOS or Windows.

The 0.0.0.0: should be put in the PPP options file if you have a dynamic IP address (your IP address/hostname is randomly assigned