Linux Index |
Internet connection with PPPIntroductionIf you want to connect to the Internet, you have to use the pppd daemon. In KDE, you will find kppp which is an easy graphical interface to manage the connection. For a first test, you try it. If you have special requirements or if kppp doesn't work properly, don't be afraid, you can configure pppd manually. That's not so difficult and you have more control. Another benefit is that you can make a connection script where you can manage automatic tasks such as fetching and sending mails. Step 1 : Make the link /dev/modemThe special character device /dev/cua0 .. /dev/cua3 correspond
respectively to the serial port COM1 .. COM4.
Make a link to /dev/modem to the appropriate character device.
For example, if you use port COM2 for your modem, you can type
(as user root)
Step 2 : Check the serial port parametersType Step 3 : Select the serial port baud rateThis is the data rate between the computer and the modem.
Start the communication software minicom and try to communicate with this baud-rate : set the correct speed in the 'serial port setup' and type 'AT' in the terminal. If it communicates, you should get 'OK' as answer. If not, look into your modem manual. Step 4 : Set the modem parametersYou should try to set correct parameters in the flash of your modem. It's really important that you carefully look in your manual. In order to communicate with your modem, use minicom. You should take care at the following :
Step 5 : check that you don't have any default routeWhen you are querying for an IP address, the system looks into his routing table to see which interface has to be used. As one should expect, the default route specifies the default interface. After connection, ppp will automatically try to set the default route to ppp0, at least if there is no default route defined at this moment. Check that you don't have any default route by typing : If present, you can identify the default route by the address 0.0.0.0 in the first column.
In this case, you have to remove it by typing Step 6 : Make the secret filesThis concerns the files which contains the password to connect to your local Internet provider. There are mainly two authentication protocols, namely PAP and CHAP. Typically one provider will use only one of those two protocols, but it doesn't hurt if you configure both. My PAP secret file looks like this :
My CHAP secret file is exactly the same than the PAP secret file. The name of the PAP secret file is /etc/ppp/chap-secrets Change the right access of those files :
Step 7 : set the name serversTo translate a domain name in a IP address, you need a domain name server. Your Internet provider give you one or more domain name server addresses. You can make the /etc/resolv.conf file with a maximum
of 3 name server addresses. For example,
As you see, the keyword 'domain' serves to declare the local domain name. Step 8 : make the /etc/ppp/ppp-on-dialer fileThis is basically a script which use the chat command to dial the number. For example, my file looks like this :
If needed, you can set your modem init string in this file. See the chat manual page for details. Step 9 : Edit the pppd options fileThis file is named /etc/ppp/options.
This file must contain security sensitive parameters.
But you can set all the parameters in this file.
Two important parameters are :
Change the right access of this file :
Step 10 : have a look at /etc/ppp/ppp-on and /etc/ppp/ppp-offThese two files are meant to start and to stop the connection. The former just call pppd (optionally with extra parameters) and the later send the signal 'INT' to pppd. To send a signal to the process pppd, one need to know the process number. You can find it in /var/run/ppp0.pidMy /etc/ppp/ppp-on is really minimum and looks like this :
My /etc/ppp/ppp-off is also very short
Step 11 : Set user id for pppdIf you want that every user be able to initiate a connection, type
Step 12 : try itTo connect, type
To check that your are connected, type An other way to check for the connection is to type To disconnect, type
Step 13 : If it doesn't work ...If you experience problems with the connection, don't panic !
In order to enable logging information, edit the file /etc/syslog.conf and check that the following
line is present : To reset the syslogd deamon without rebooting, send it the signal SIGHUP : As root user, start the xconsole by typing: Modify the logon script (/etc/ppp/ppp-on) to add debugging information :
|