Setting up an internet connection can be fairly easy. Theres only one stumbling block, and we'll get to that later. All the files we need to edit are in the /etc directory. The kernel your using needs to support ppp - if you installed the one that came with Red Hat, theres no need to worry, but if your using a non compliant one, your going to have to recompile.
The first file we're going to edit is /etc/resolv.conf - the resolv in the name shows us that if we put in, lets say www.linux.ie, that it'll resolve it to its real name 123.123.123.123. In windows, youd call what your putting in here the DNS server addresses. The first line should say 'search', and then on a separate line for each other DNS server, you should put 'nameserver 123.123.123.123', or whatever address you are using is. Write that file, and thats step one out of the way.
Now cd to the /etc/ppp directory, and have a look at whats there (ls). The ones we're interested in are the chatfile, and the options file. The chatfile is a script where our computer chats to your isps computer and they exchange your user data, such as your password and your usename. We'll come to that in a minute, the first one were going to edit is the options file.
This is how my options file looks :
/dev/modem
57600
modem
crtscts
lock
connect "/usr/sbin/chat -vf /etc/ppp/chatfile"
defaultroute
name username
noipdefault
The line above dont mean anything too complicated : The first tells the OS where to look for the modem, the second the speed of the connection (Real or desired), the third tells us its a modem connection (It could be an ISDN), I havent a clue what the fourth does, nor am I interested, the fifth locks the modem so that no other communictions application can use it when your online (A good idea), defaultroute tells the OS to use the DNS nameservers we set up in /etc/resolv.conf, name is where you specify your isp login name - here Ive used username, and the noipdefailut means that your server allocated you a new IP address each time you log in.
The only thing you should need to change here is the name line. The next thing we need to edit is the chatfile, and this will vary for *every* isp online. If you know of someone online using Linux and you have the same IP, ask them for their one. If not try and search for a sample one. If your're based in Ireland, www.linux.ie has chatfiles for all the Irish ISP's on the main page.
Heres what my chatfile looks like :
ABORT BUSY
ABORT 'NO CARRIER'
REPORT CARRIER
REPORT CONNECT
'' ATDT1234567890
name : username
word : password
chf ppp
The chatfile works like this, the first few lines start with ABORT and have a term after them. If the monitoring application (chat) picks up any of the terms after your modem has dialled, then it gives up. In most cases if the line is busy, theres no dialtone, or your modem cant connect, the ABORT signal is sent, and the pppd (The ppp (Internet) daemon (controller)) is killed. The next line is usually atz, this resets the modem and prepares it for a call. The REPORT lines aren't necessary, but theyre a good idea if you wish to examine the log file for the connection at a later date. In my case, Ive asked the computer to note in the log file when my modem either detects a carrier, or when it connects. The next line is interesting. The first two '' get the attention of the modem, at the ATDT command is followed by the number of the ISP I use. Up until here, everyone's chatfile is the same.
In my chatfile, I have three more lines. My computer waits to see the line 'name :', when it sees that it sends username (Or your username), then it waits for 'word :', an abbreviation of password, and sends my password (Or yours), the next line is specific to my ISP, I need to tell my ISP that Im using a ppp connection, so when my isp gives me the 'chf :' prompt, I say ppp, and the connection is established.
For the last few lines of the chatfile, your going to have to talk patiently with your ISP. At the mere mention of Linux most will simply say "Sorry, Linux doesnt work with our servers". Remember that most people on Tech Support are sitting there with a book of Questions and Answers, and Linux just isnt in there. Talk nicely, explain that what you need is needed in Windows too, and then maybe you'll get some answers.
When you've all that done, type pppd, and you should connect. The way to check is using this command - 'tail /var/log/messages', that log file shows you the responses we asked the chatfile to note earlier.
Please dont eMail me asking for chatfiles for specific ISP's, I dont have them. Ive had to respond to over a hundred mails like that already.
Click here to return to the BLG
|