ISP-Connectivity-mini-HOWTO <author>Michael Strates, <tt>mstrates@croftj.net</tt> <date>v2.0.1, 2001-11-28 <abstract> This document describes how to setup PPP, connect up to your ISP, configure mail and news, get a permanent IP (if available), get a domain name, and have a bonda fide system running in a little over thirty minutes. <p> <bf>Archived Document Notice:</bf> This document has been archived by the LDP because it does not apply to modern Linux systems. It is no longer being actively maintained. </p> </abstract> <toc> <p> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <sect> Introduction <p> The main goal of this document obviously is to make the new user friendly with the many terms of connecting your Linux PC up to the Internet, obtaining IP addresses, domain names, and setting things up. This guide is intended for the intermediate user in mind, although intelligent newbies shouldn't have any problems. <p> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <sect1> New versions of this document <p> New versions of this document will be periodically posted to <it>comp.os.linux.answers</it>. They will also be added to the various anonymous FTP sites who archive such information, including: <p> <tt> <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO" name="ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO"> </tt> <p> In addition, you should generally be able to find this document on the Linux Documentation Project page via: <p> <tt> <htmlurl url="http://sunsite.unc.edu/LDP/" name="http://sunsite.unc.edu/LDP/"> </tt> <p> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <sect1> Feedback <p> I certaintly welcome any feedback about this HOWTO, spelling mistakes, how it all worked out, thankyou notes and critisisms. I hope I helped a few people with this HOWTO, and if I did, I'd be really happy to hear from you. <p> <tt> <htmlurl url="mailto:mstrates@croftj.net" name="mstrates@croftj.net"> </tt> <p> <tt> <htmlurl url="http://linloft.home.ml.org/" name="http://linloft.home.ml.org/"> </tt> <p> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <sect1> Standard Disclaimer <p> No liability for the contents of this documents can be accepted. Use the concepts, examples and other content at your own risk. As this is a new edition of this document, there may be errors and inaccuracies, that may of course be damaging to your system. Proceed with caution, and although this is highly unlikely, I don't take any responsibility for that. <p> Naturally, there are probably better and easier ways to do things in this document. There will always be another way in the Linux World. This is the way I've done things, and that's the way I'll be presenting them in this HOWTO. <p> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <sect1> Copyright Information <p> This document is copyrighted (c)1997 Michael Strates and distributed under the terms of the GNU Free Documentation License, which can be obtained from <a href="http://www.fsf.org/licenses/fdl.html">http://www.fsf.org/licenses/fdl.html</a>. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <sect> Connecting to the Outside World <p> In this document, we'll explain how to do this using PPP (Point to Point Protocol), a popular protocol nearly always used over the Internet. It allows your modem to <tt>speak</tt> to the outside world. This is what applications like Trumpet Winsock in Windows 3.x did, and many other programs that you've probably have never seen. <p> In Linux, we use a thing called chat to do the dialing up to the ISP and then use a utility called pppd to 'use' the connection. In a sense, chat is your dialer, and pppd is your protocol. We'll describe how to setup both below. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <sect1> Talking and Communicating with pppd and chat <p> Probably the easiest way to go about things is to make a shell script in root's home directory called <tt>ppp-connect</tt> and involke the script whenever you wish to make your connection. We'll discuss this method. <p> Open up your favourite editor as root on ~/ppp-connect. You'll then have to decide on your parameters. <p> <it>pppd connect 'chat -v "" "your_init_string" "" ATDTisp_number CONNECT "" ogin: your_username word: your_passwd' /dev/tty(0/1/2) speed modem</it> <p> pppd involkes /usr/sbin/pppd on my system, then loads up chat to do the dialing. Chat sends <it>your_init_string</it> to the modem, then dials <it>isp_number</it>. It then waits for CONNECT, then waits for ogin: (l removed as the first character is sometimes lost), sends <it>your_passwd</it>, chat then terminates and hands the show over to pppd. <p> The last of the command specifies your modem port (mine's /dev/ttyS1). In most cases it will be ttyS1 (COM2: in DOS), ttyS0 (COM1: in DOS), or if your using Slackware, cua1 or cua0. The speed is the speed of the modem. I use 115200 for my modem (a 33.6k). If you have got a fairly recent computer (one with a 16550 UART), then I wouldn't go any lower than 57600. Otherwise, for 14.4k 38400. Modem just tells pppd that it's a serial/modem based connection. Remove the -v option if you don't want verbose logging to your logfiles. <p> The scenario below is one of a person who dials up an ISP that automatically starts PPP for them, ie; they don't have a shell that actually starts. This is his command in his ~/ppp-connect: <p> <it>pppd connect 'chat "" "ATZ" "" ATDT555-1800 CONNECT "" ogin: johnny word: blackjak' /dev/ttyS1 115200 modem</it> <p> But for some people, they're ISP starts up a shell and doesn't automatically start PPP this may be a problem. Luckily, chat can deal with that too. You just add another command to your chat script. For example, below this johnny character is using an ISP that just dumps him to a shell, requiring him to type ppp to get a ppp connection. His shell prompt ends with a $. <it>pppd connect 'chat "" "ATZ" "" ATDT555-1800 CONNECT "" ogin: johnny word: blackjak $ ppp' /dev/ttyS1 115200 modem</it> <p> If it's more than one word, ensure you quote it. I hope you can see the drift of this, and are able to create your own script up to suit your connection. Simply modify either the first johnny or the second johnny script to suit your taste, port, server, etc and save the file. <p> Now you've made your file, ensure that only root can execute, read or write to it. This is extreemly important. Also make sure nobody can read your logfiles, if you decide to leave the -v option in, as your password is seen in cleartext in the logs (I don't see much need for -v, if you don't know what I'm talking about, leave -v out). <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <sect1> IP's, Domain Names and Subnets <p> For most people using the options above, a changing IP address won't bother them. These people include basic, easy going users, that just have dialup accounts, and aren't very technically minded. For those people, skim read this section, I'll come to important things you need to do to setup your system properly. Newbies, skip the sections dealing with permanent IP, Domain Names, Subnets, and just read the last bit of this section.<p> Getting a permanent IP address might be free for your ISP, so if in doubt ask them. Personally, I'd pay for a permanent IP address. It lets you send e-mail to and from using a unique IP or domain, etc. If you want to get yourself a permanent IP, write an e-mail to root@yourisp.com, and ask him nicely if he can arrange a permanent IP for you. <p> When you get your permanent IP address, grep through your /etc directory to find where your old IP addresses are. I had to change files in my sendmail directory and /etc/hosts. There are some other key files that you will only discover with grepping. Open up /etc/hosts, and add your new IP address in the standard format. Reboot your computer, and you should be ready to go. <p> You'll now need to change your chat script to reflect your new settings. If you are forced into PPP as soon as you start your connection, you'll need to tell your System Administrator of your ISP to ensure their PPP system recognises that you have a permanent IP address and allocates you that instead of a changing one. If you get dumped at a shell prompt, and you need to type ppp or something to start the connection, instead of typing that, change your ~/ppp-connect script to send this instead of just ppp or whatever when it sees $ or whatever your shell prompt is. <p> <it>/usr/sbin/pppd :Your_IP_Address</it> <p> Substitute your IP address for the IP address your ISP gave to you. Be sure you encapsulate the thing in " " marks when you put it into your chat script. If this doesn't work, consult your ISP where your PPP daemon is located, and ask him for the command to give. You could just try leaving it as is and seeing if the server will recognise you and give you your rightful address. <p> The next thing probably to do is to get yourself a domain name. I know that in Australia, .asn.au and .org.au are free. In the United States, you can get a .us domain for free, but they tend to be long. If your in Australia, you must go to <htmlurl url="http://www.aunic.net/" name="http://www.aunic.net/"> to register your domains. In the United States, it is <htmlurl url="http://www.internic.net/" name="http://www.internic.net/"> . <p> To register domains you need to be able to provide DNS services, and gorey stuff like that. If your ISP can't provide these, throw out an official .asn.au or whatever domain out the window, and get a Monolith Internet Domain. <p> Monolith offer free domains to anybody and anyone all around the world. Everything is done without human interaction, via a web forms interface with your browser. Your domain comes in the form of Your_Choice.ml.org. Monolith will then host the DNS locally for you. If you want to send and receive mail from that domain, ask your ISP to become a mail exchanger for you. <p> Go to <htmlurl url="http://www.ml.org/" name="http://www.ml.org/"> and fill out an application, enter the NIC with your username and password, and make a FREED domain. You'll need to enter your IP address, so have that ready. Your domain will be in the DNS in a couple of days. <p> Okay now, we'll move onto the newbies section, or for those people who can't get a permanent IP address or a domain name. All you have to do is edit /etc/hosts as root, call your site something that won't clash, give it a 10.10.10 or something for an IP address and reboot your computer. <p> There you go, you've just setup your computer with pppd and chat in just ten minutes. Now let's move onto the next section, which deals with Electronic Mail. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <sect> Electronic Mail on your Linux Box <p> One of the most important aspects of the Internet, is it's fasinating capaiblity to transfer mail to and from countries, or more locally perhaps. Linux is extreemly strong in easy mail packages for the console. The one we're going to document today is called Pine (Program for Internet Mail and News), made by the University of Washington, and to download the mail, a program called Fetchmail, made by Eric S. Raymond. Both should be included in your Linux distribution. <p> Fetchmail is a program that downloads your e-mail from your server using POP, transfers the mail onto your computer and then deletes it off the server, much like programs like Eudora or Microsoft Internet Mail/Exchange do. To configure and automate fetchmail, you use a file in your home directory called .fetchmailrc. Simply open up ~/.fetchmailrc (Remember: your doing this bit as yourself, not as root) with your favourite editor and observe the command lin eoptions below: <p> <EM>poll mail.yourisp.com proto pop3 user login_name password your_passwd</EM> <p> <EM>user login_name with pass your_passwd is login_name here</EM> <p> All you have to do is replace <EM>mail.yourisp.com</EM> with the name of the mail server of your ISP, <EM>your_passwd</EM> with your password, and <EM>login_name</EM> with your login name. <p> An important thing to note. For Pine and this procedure to work correctly, your login name must corrospond with the login name you use on your ISP. That is your local login name must match the one you use on your server, and your e-mail address. <p> Next, ensure that .fetchmailrc has the correct permissions (user read/write only) and your laughing. Fetchmail can be started in two ways, in standard mode (where it'll fetch messages from the server and terminate), or in daemon mode (where it will stay active, and check/download mail every X seconds). To use daemon mode, type <it>fetchmail -a -d(Seconds between Polls)</it>. -a ensures it downloads all mail. To use the standard mode, just type <it>fetchmail -a</it>. <p> Next, you need to setup Pine. Open up Pine, by typing pine at your prompt, choose Setup - Configuration. Setup your userdomain as the domain in your e-mail address, for example jack@linux.org, would be linux.org. Next, setup smtp-server as your POP mail server (the same you used in the fetchmail setup). So we enter www.linux.org. If you want news, setup your nntp server to your ISP's news server. <p> So there you have it folks, everything should be working now. To connect up to your ISP, just run ~/ppp-connect as root. Then, to get your e-mail run fetchmail -a as yourself. To browse your e-mail and news, use Pine. Install a text-based browser such as Lynx to browse the web if you like. <p> <it>Send any comments questions and suggestions to mstrates@croftj.net</it> <p> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - --> </article>