Copyright © 2001 Lauri Watts
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
kppp is a dialer and front end for pppd, allowing for interactive script generation and network setup.
Table of Contents
kppp is a dialer and front end for pppd. It allows for interactive script generation and network setup. It will automate the dialing in process to your ISP while letting you conveniently monitor the entire process.
Once connected kppp will provide a rich set of statistics and keep track of the time spent online for you.
A built-in terminal and script generator will enable you to set up your connection with ease. You will no longer need an additional terminal program such as seyon or minicom to test and setup your connection.
kppp features elaborate phone cost accounting, which enables you to easily track your online costs.
We hope you enjoy this dialler, and that it eases your way onto the internet.
If you have a fairly modern Linux® distribution, you might find the rest of this document superfluous. kppp comes with a clever little wizard that in many cases can have you up and running with an internet connection in just a few minutes.
Whether using the wizard or not, you should know the following information before you begin:
Your ISP modem pool phone number.
Your username and password for your ISP.
Your ISP's DNS servers (one is sufficient, but two is better).
Other optional information you should find out to fully access your ISP's services are:
The incoming mail server address (often pop.yourisp.com or mail.yourisp.com)
Also find out if your ISP uses the POP3 protocol or IMAP.
The outgoing (SMTP) mail server address (it could be the same as the incoming mail server, or it is often called something like smtp.yourisp.com).
The Usenet News (NNTP) server address (possibly news.yourisp.com or nntp.yourisp.com).
Any proxy servers your ISP has set up.
All this information is probably available on any paperwork you received from your ISP when you signed up with them, or you can find it out from your ISP's support telephone line.
Armed with the above, and a fairly recent default installation of Linux®, you may well find that setting up an internet connection is as simple as running the kppp wizard.
You can start the wizard from kppp's initial screen. Start kppp from your K menu, where you will find it's entry in the Internet as Internet Dialer.
The following dialog will appear:
The kppp dialer startup screen
It will probably not have any entries to begin with, and that's what we're about to do now.
Click the Setup button to begin setting up a new Internet connection.
The wizard will offer you three choices, Wizard, Dialog Setup and Cancel
The wizard asks you what you want to do
Choose this if you really don't want to be setting up a new account right now. The message box will go away, and you will be left with the dialler screen as before.
If you have a fairly standard modem, and use one of the larger ISP's for your country, the wizard will probably be able to set you up immediately with a working Internet Connection. Try this first, before you try to set up the connection manually.
If you don't succeed with the Wizard, or you just want to do things yourself, choose this. The wizard currently is only useful for a small subset of countries and Internet Providers.
For the purposes of this chapter, we'll assume you are choosing Wizard, and the dialog based setup will be described in a later chapter.
The first screen you see contains just introductory text, explaining the things you read about in the first section of this chapter. Press Next to move on.
The second screen asks you to choose the country you live in. Not all countries are represented here, and if the country you live in is not listed, you will have to press Cancel, in which case the Dialog based setup will start for you to continue with.
On the next screen, you will be given a choice of Internet Providers that kppp knows about, based on your choice of location in the previous screen. Again, if your ISP is not listed here, you will have to press Cancel and do your setup in the Dialog based setup
You will now be asked to enter your username and password for your internet connection. Please note, that for some ISPs this differs from your mail account user name and password, so make sure you use the right one. Choose Next to continue.
On the next screen, you have a chance to enter any special dial prefixes you might have - for example, if you must dial “0” for an outside line, or if have a prefix you can dial to turn off call waiting. Choose Next to continue.
And that's all! If you want to revisit any of your choices, you can use the Back and Next buttons to move back and forth through the dialogs. When you're happy, press the Finish button, and you're all done.
Of course, any of this information can be edited at a later time, from the kppp Configuration dialog.
Setting up a connection with the dialog based setup is not too much more difficult than using the wizard.
You can reach the setup dialog the same way you did the wizard. Start kppp from your K menu, where you will find its entry in the Internet as Internet Dialler.
The following dialog will appear:
The kppp dialer startup screen
It will probably not have any entries to begin with, and that's what we're about to do now.
Click the Setup button to begin setting up a new Internet connection.
This time, choose Dialog setup and you'll see the following Dialog appear:
The New Account Dialog
The New Account dialog contains the following sections:
You normally won't need to fill in all these, although each of them is described in the following sections.
The Accounts Dial tab
The Dial tab has the following options:
You must give the account a name. This can be anything you like, but if you have more than one account, each name must be unique.
Specify the phone number to dial. You can use characters such as ‘-’ to make the number more legible. If you concatenate a series of numbers separated by a colon (e.g. 1111111:2222222:3333333, kppp will try these numbers one after the other whenever it receives a busy signal. You can use the Add button to add another number, Remove to remove a number from the list, and the up and down arrows to change the order of the list.
Choose the appropriate method of authentication that kppp should use to log into the server. Check with your provider for more information. Use of PAP and CHAP are described in the chapter Chapter 7.
Check this option if you want kppp to remember your password between sessions.
This will bring up the pppd arguments dialog. You can use this dialog to add any desired options that you want kppp to hand to pppd. See the pppd man page for a list of available options, but unless you know exactly what you are doing, you should probably restrain yourself from tinkering with these.
The Accounts IP tab
Check this if your ISP uses dynamic IP address assignment. In this case, your IP address will change every time you establish a connection.
Check this if your ISP has given you a static IP address. In that case you will also need to fill in that address in the IP Address box, and any Subnet Mask if applicable. Ask your ISP if unsure. Dynamically assigned addresses are used in the huge majority if ISP's and leaving this checked will in most cases be the right choice.
Select this option if you want kppp to set the hostname and domain for your machine after a successful ppp connection.
This is done by querying the defined Domain Name Server with the IP assigned for the ppp link.
This option is useful for those stand-alone machines which want to use protocols such as talk, which require the hostname to be the same as your machine is known on the internet. It overrides the Domain Name option in the DNS section, and the machine defaults are restored to their original values when you close the ppp connection.
This option is not useful if you just want to connect to the internet and surf, check mail, or chat. It has the side-effect of disallowing any new connections to your X server - in other words, you can't open any more GUI programs.
Only turn this on if you are absolutely sure you need it.
The Accounts Gateway tab
Check this if you want pppd to use the default Gateway for your machine. This is the default.
Check this if you want to specify the Gateway to be used in place of the default.
You almost certainly will need this to be checked (the default).
The Accounts DNS tab
Specify the domain name for your machine. As with DNS addresses, it is restored to the original specified in /etc/resolv.conf when the connection goes down. If it is left blank, no changes are made to the domain name specified in /etc/resolv.conf
Choose between Automatic (the ISP will automatically issue you DNS server addresses when you connect) and Manual. If you choose manual, the DNS IP Address section is then enabled.
This section is only enabled if you chose Manual in the previous option. Add the Domain Name Servers assigned to you by your ISP. You must specify at least one Domain Name Server for your OS to be able to resolve human readable IP addresses such as ftp.kde.org. The DNS server addresses supplied must be in numeric form, e.g. 128.231.231.233. These addresses will be added at runtime to /etc/resolv.conf.
Choose the Add button to add each new DNS server address to the list box below. Choose Remove to remove an entry from the list.
If you check this box, any DNS servers listed in /etc/resolv.conf will be disabled while the connection remains up.
The Accounts Login Script tab
Use this dialog to compose a dial in script for your ISP dialup connection. You can use the mini-terminal and the information supplied by your ISP to find out what sequence of actions needs to be executed.
Choose an option from the drop down box on the left, and then add any parameters for that action in the edit box on the right. Use Add to add each entry to the bottom of the script, which is displayed in the lower part of the dialog. Use Insert to insert an entry anywhere in the script, and use Remove to delete a line from the script.
The options available are:
kppp will wait for the specified string to be received.
kppp will send the specified string.
kppp will scan the input stream for the specified string, and will store any character from the end of the string up to the next newline, in an internal buffer. Trailing and leading whitespace will be stripped off.
Permanently store the previously scanned string in the specified register. Currently the only valid register is password.
Pause for the specified number of seconds.
kppp will send the hangup to the modem.
kppp will set the modem into answer mode.
Change the default timeout to the specified number of seconds dynamically during the script. You can change the timeout several times during script execution if necessary.
Prompt the kppp user to enter a string, given the specified string as a hint. The user will see what is typed. If the specified string includes the mark ##, the mark will be replaced with the current content of the internal scan buffer, as previously stored with the scan command.
Prompt the kppp user to enter a string, given the specified string as a hint. An asterisk will be printed for each character the user types.
If the Login ID field on kppp's main dialog is filled in, send that ID. If the Login ID field is not filled in, prompt the kppp user to enter an ID, given the specified string as a hint. The user will see what is typed. On a second pass, such as in a loop on a second iteration, or during callback authentication, the prompt will be displayed regardless of whether the Login ID field is filled in.
If the Password field on kppp's main dialog is filled in, send that password. If the Password field is not filled in, prompt the kppp user to enter a password, with the specified string as a hint. An asterisk will be printed for each character typed. On a second pass, such as in a loop on a second iteration, or during callback authentication, the prompt will be displayed regardless of whether the Password field is filled in.
kppp will wait for the specified string to be received. It will save the string for use by LoopEnd.
kppp will wait for the specified string to be received to exit the loop. If the string given by the corresponding LoopStart is received first, it will trigger a jump to the line after LoopStart, enabling repetition of username/password style paired dialogs.
Example 4.1. A simple example login script
Here is a simple example script I could use to connect to my ISP
Expect ID: # wait for ID: Send myid # you have to substitute myid with your id Expect word: # wait for 'password' Send 4u3fjkl # send my password '4u3fjkl' Expect granted # My ISP send 'Permission granted' on login success. Send ppp # This starts a ppp connection for # me on the ISP side.
Example 4.2. A login script that prompts for ID and password, and has loops.
Here is a script for the same account with an ID and password prompt. This script will prompt for ID and password each time, no matter what is typed into the Login ID and password fields on kppp's main screen.
This script also illustrates the use of the LoopStart/LoopEnd structure. If something goes wrong during the login procedure, for example, I mistype the password, my ISP will print an error message and restart the id/password loop by issuing the string ID: again. If the string ID: is caught before the LoopEnd keyword was parsed, kppp will start the script again, from the line after the LoopStart keyword.
LoopStart ID: # wait for ID: Prompt Enter ID: # Prompt me for my ID and send it off. Expect word: # wait for 'password' PWPrompt Enter Password: # Prompt me for my password and send it off. LoopEnd granted # My ISP send 'Permission granted' on login success. Send ppp # This starts a ppp connection for me
Example 4.3. Prompts for information not filled in on the main dialog.
Here is the script that I actually use to connect to my ISP. This script will prompt for ID and password only if I haven't filled in the respective fields on kppp's main dialog.
LoopStart ID: # wait for ID: ID Enter ID: # Prompt me for my ID and send it off. Expect word: # wait for 'password' Password Enter Password # Prompt me for my password and send it off. LoopEnd granted # My ISP send 'Permission granted' on login success. Send ppp # This starts a ppp connection for me # on the ISP side
Example 4.4. A script for an ISP using challenge/response authentication.
Here is a script that I use to connect to an ISP which is using some sort of challenge/response authentication. Usually you got a hardware token (a smart card with a display and calculator like keypad) from the ISP. You have to know a password to use the token. After dialling in your ISP displays your challenge. You have to type in the challenge to your token and get a dynamic password as a response. Then you have to enter that password.
LoopStart ID: # wait for ID: ID Enter ID: # Prompt me for my ID and send it off. Scan Challenge: # Scan for 'Challenge' and store everything behind up to the next newline. Expect Password: # wait for 'password' Prompt Your token is ## - Enter Password # Prompt me for my password and send it off. LoopEnd granted # My ISP sends 'Permission granted' on login success. Send ppp # This starts a ppp connection for me # on the ISP side
Example 4.5. Using Scan and Save in scripts
The following log shows the login procedure of a fictitious ISP that provides a new password on each login. The new password has to be verified and recorded for the next session.
University of Lummerland Login:mylogin Password: The password for your next session is: YLeLfkZb Please record and enter it for verification. Verification:YLeLfkZb 1 = telnet 2 = SLIP 3 = PPP Your choice:
kppp can be used to this cumbersome task for you, eliminating the risk of losing that little sheet of paper that holds your current password at the same time. The key part of the following script is the combination of Scan/Save keywords.
7 Expect Login: # wait for login prompt ID # send ID Expect Password: # wait for password prompt Password # send password Scan is: # wait for '... next session is:' and # scan the preceding password Save password # save the new password for next login Expect Verification: # wait for 'Verification:' Password # send new password Expect choice: # wait for a prompt that let's you choose # between different options (telnet, SLIP, PPP) Send 3 # choose option 3, i.e. PPP
The Accounts Execute tab
Here you can select commands to run at certain stages of the connection. These commands are run with your real user id, so you cannot run any commands here requiring root permissions, unless you are of course dialled in as root (a bad thing to do for many reasons!)
Make sure to supply the whole path to the program, otherwise kppp may not be able to find it.
You can add commands to be run at four distinct times during the connection process:
Run this command before the dialling is initiated, so it is already running when you connect to your ISP.
Run this command only after a successful connection is made.
Run this command while still connected, before hanging up the modem.
Run this command after the connection has been closed.
You might for example want to run leafnode as soon as you have connected, or check your mail. You might want to make sure any mail in your queue is sent, before you close your connection down. You might want a “clean-up” script to tidy up logs and clear your cache after you have disconnected.
The Accounts Accounting tab
Check the Enable Accounting box to enable or disable telephone cost accounting for this account.
Select from the list the applicable rule for your telecoms provider.
If you can't find one, you can write one yourself by copying the supplied template, which you will find in an appendix.
The final option on this page is Volume Accounting, described below.
Basically, it means to count the number of bytes transmitted to and from the Internet. kppp can count incoming bytes, outgoing bytes, or both. It's up to you what you want (or must) use.
Many Internet Service Providers bill their customers based on the number of bytes transferred. Even more commonly, ISP's offer a flat rate up to some arbitrary transfer limit, and then charge more for every megabyte above this limit. kppp shows you your current volume and can help you keep your bills to the minimum. Of course, even if you're not billed based on volume, you can turn on volume accounting just to satisfy your own curiosity.
That depends mainly on your provider. Many of them only count how many megabytes you download from the Internet,and ignore how much you send. In that case you should choose Bytes In. If you have to pay for both, you should choose Bytes In and Out. Bytes Out is really only here for completeness, as we're not aware of any providers using it as a billing basis. It might be useful to those of you running a web or FTP server at home though.
Unfortunately, there is a drawback on volume accounting. kppp will only count the number of bytes, regardless of their origin. Many providers set their limit only for Internet access, and not for data on their own network. Some providers set different limits for data that is on their own network, in the same country, and coming from overseas. So, if you're doing not much websurfing, and getting most of your pages from your ISP's own proxy cache, then your provider is probably not charging you for that data. kppp will not know these IP packets are coming from the proxy, and so it will count them. So if you this situation applies to you, or, as another example, your provider uses a caching news server such as nntpcached, then the volume reported by kppp may be higher than the amount you are going to be billed for. On the bright side, at least kppp will never underestimate your bills.
The changes made here affect all accounts you have set up in kppp
The Accounts tab
In this dialog, you can manage the accounts themselves. The names of the accounts appear in a list on the left of the dialog.
To delete an account, select the Delete button. You will be asked to confirm before the account is finally deleted.
You can make a copy of an account with the Copy button. You could use this for example, to separate different users in the family, although that would normally be better done by having them be different users in the OS as well! Or perhaps you just have more than one account with the same ISP and wish to use both of them.
Choosing Edit... will take you to the dialog described in Dialog Setup, but with the selected accounts details.
Choosing New... will offer you the choice between the Wizard or the Dialog Setup already described.
If you select an account, and you have turned on accounting then the accumulated information for that account will appear in the two panels labelled Phone Costs: and Volume: respectively.
To the left of the accounting display, are two buttons: Reset... and View Logs.
Pressing Reset... will reset the Phone Costs: and Volume: information to 0. You would typically want to do this once a month or quarter, when you have recieved your phone bill and reconciled the telephone costs. You can reset either independently, and are offered the choice of which item you want to reset, when you press the Reset button.
Pressing View Logs will open another window, where a log of all the calls made with kppp will be displayed. If you have kept logs, you can move forward and backward, in monthly steps. This might be useful if you have received an abnormally large phone bill and are investigating why!
The Device tab
Here you can select and configure your modem.
Choose the device appropriate for your hardware.
DOS or Windows® users will know this as COM1, while COM2 is /dev/ttys1 and so on. These devices are the ones normally used on Linux® systems.
The first serial line (COM1). COM2 is usually /dev/cua1 and so on. These devices are commonly used on BSD systems, namely FreeBSD, NetBSD and OpenBSD. Older Linux® systems may also have these, although on Linux® they were renamed some time ago to /dev/ttySx.
On Linux® these belong to internal ISDN cards. These devices emulate a common Hayes compatible modem. /dev/ttyI0 is for the first, /dev/ttyI1 is for the second ISDN card and so on. These devices are only available in the Linux® version.
Many Linux® distributions make a symbolic link from the real modem device to /dev/modem. You should avoid using this one.. Use the real device that it is pointing to instead.
Select from Hardware (CRTSCTS), Software (XON/XOFF) and no flow control. The recommended setting is Hardware flow control.
Choose the correct ‘Enter’ character sequence for your modem. Most modems will use ‘CR/LF’, however some modems need a different setting. If you experience trouble while running a login script, play with this parameter.
Choose from the list of connection speeds supported by your serial port. Note that the serial port supports much higher speeds than your modem in most cases. You should probably start with the highest number available, and only reduce it if you have connection problems.
Activate this option if you want kppp to create a lockfile. Under Linux® the directory for such a file will be /var/lock. Programs such as mgetty depend on the existence of such lock files, and kppp will not work with mgetty if the lock file is not set. Make sure that you don't use the option lock for pppd if you want kppp to lock the modem, since the pppd option lock will induce pppd to try to lock the modem device. Since kppp will have already locked the device, pppd will fail, and kppp will display the error pppd died unexpectedly.
This is the time in seconds that kppp will wait for the CONNECT response from your modem. A setting of about 30 seconds should be sufficient for most purposes.
The Modem tab
This is the length of time the modem should wait before redialling, after it has received a busy signal. Note there are requirements by telecom providers in some countries, which ask you to not set this too low.
Use the slider to set the modem volume. Left is low volume, center is medium volume, and right is high volume. On some modems, low volume is the same as turning the volume off, and on other modems, medium and high are effectively the same thing.
In this dialog you can fill in any particular commands appropriate for your modem. If you own a Hayes compatible modem, you most likely won't need to change any of the defaults, but you are encouraged to read the Hayes Commands Appendix in this help file. The information supplied there can be very helpful in cases where you experience trouble setting up a stable connection with your ISP's modems. In particular the two settings for Pre-Init Delay and for Post-Init Delay if you are experienceing modem lockups. These settings make kppp pause a little just before and just after sending the initialization string to your modem. The Pre-Init Delay will by default also send a CR, unless you have set it the delay interval to 0.
Pushing this button will make kppp ask your modem to identify itself. On success, your modems response will be displayed in a dialog. This may or may not prove to be informative, depending on your modem.
Pushing the Terminal button will bring up a mini terminal. You can use the mini terminal to test your modem and to experiment with the negotiation protocol for initialising a ppp connection with your ISP. You no longer need a terminal program such as minicom or Seyon.
The Misc. tab
Here are some options that don't really fit in with other sections, but can be very useful nonetheless.
kppp will wait this amount of time after running the script and starting pppd for pppd to establish a valid ppp link before giving up and killing pppd
If this option is chosen, kppp will dock into the panel where it will be symbolized by a small animated icon. Use the left mouse button on this icon to restore kppp's window. The right mouse button will open a popup menu that offers to restore the window, show transfer statistics, or close the connection. This option overrides Minimize Window on Connect.
Selectintg this will have kppp try to reconnect if you are disconnected.
This will have kppp display the time connected on the caption of the kppp window, while you are online.
Checking this will cause kppp to terminate the ppp link, disconnect the modem, and terminate accounting in an orderly fashion, when the X-server shuts down. This is useful if you are prone to forgetting you are online, when you shut down the X-server, or if you simply don't want to worry about manually disconnecting your session. If you don't want kppp to hang up the modem on X-server exit, you should leave this checkbox empty. Beware that if you have accounting enabled, and you leave this option turned off, you will have an unterminated accounting entry in your logs, from each time the X-server exits and kppp terminates.
If this option is chosen, kppp will be minimized after a connection is established. The elapsed connection time will be shown in the taskbar.
This section is mainly for superusers (root) people with high security demands, or simply technically interested people. It is not necessary to read this if you only use Linux® at home for yourself, although you may learn a thing or two in any case.
A system administrator might want to restrict access as to who is allowed to use kppp. There are two ways to accomplish this.
Create a new group (you might want to name it dialout or similar), and put every user that should be allowed to use kppp into that group. Then type at the prompt:
# chown root.dialout /opt/kde/bin/kppp # chmod 4750 /opt/kde/bin/kppp
This assumes that KDE was installed in /opt/kde/ and that your new group is named dialout.
Before doing anything, kppp checks if there is a file named /etc/kppp.allow. If such a file exists, only users named in this file are allowed to dial out. This file must be readable by everyone (but of course NOT writable.) Only login names are recognized, so you cannot use UID's in this file. Here is a short example:
# /etc/kppp.allow # comment lines like this are ignored # as well as empty lines fred karl daisy
In the example above, only the users fred, karl and daisy are allowed to dial out, as well as every user with a UID of 0 (so you don't have to explicitly list root in the file).
It's virtually impossible to write a dialler without the SUID bit that is both safe and easy to use for inexperienced users. kppp addresses the security issues with the following strategy.
Immediately after the program starts, kppp forks.
The master process, which handles all the GUI stuff such as user interaction) drops the SUID state after the fork, and runs with normal user privileges.
The slave process keeps its privileges, and is responsible for all actions that need root privileges. To keep this part safe, no KDE or Qt™ library calls are used here, just simple library calls. The source code for this process is short (around 500 lines) and well documented, so it's easy for you to check it for security holes.
Master and slave processes communicate with standard UNIX® IPC.
Special thanks to Harri Porten for writing this excellent piece of code. It was thought to be impossible, but he managed it within a week.
Starting with version 0.9.1, kppp has supported directly the most commonly used form of PAP authentication.
There are two different ways to use PAP.
This variant is used by many commercial ISP's. It basically means that you (or rather, your computer) must authenticate yourself to the ISP's PPP server. The PPP server does not need to authenticate itself to your computer. This is no security issue, as you should know which computer you just tried to dial to.
If your ISP gives you a username and password, and tells you to use PAP authentication, this is the variant you should choose.
As above, but in this case your computer requires the ISP PPP server to authenticate itself. In order to establish a connection, you must chose the authentication method Script based, not PAP, and you will have to manually edit /etc/ppp/pap-secrets. While kppp doesn't provide built in support for this variant, it is nevertheless easy to establish a connection.
Procedure 7.1.
Make sure that the file /etc/ppp/options (and ˜/.ppprc if it exists) do not contain one of the following arguments:
+pap
-pap
papcrypt
+chap
+chap
+ua
remotename
It is very unlikely that any of these options are already there, but just to be sure, please check.
Start kppp
Click Setup
Choose the account you want to use PAP with and click Edit
Choose the Dial tab
Select PAP in the Authentication drop down box.
If you do not want to retype the password each time you dial in, select Store password. This will save the password to a file, so make sure that nobody else has access to your account.
That's it. Close the dialogs, type in the username and password your ISP supplied, and click Connect.
This section is based on an email from Keith Brown <kbrown@pdq.net> and explains how to make kppp work with a generic PAP or CHAP account. If your ISP just gave you a user id and a password for an account, you probably can skip this section, and the instructions in the previous one will be all you need.
PAP seems a lot more complicated at first glance than it really is. The server (the machine you are connecting to) basically tells the client (your machine) to authenticate using PAP. The client (pppd) looks in a specific file for an entry that contains a matching server name, and a client name for this connection, and then sends the password it finds there. That's about it!
Now here's how to make that happen. I am assuming a pppd version of 2.2.x or better and a standard installation of configuration files under /etc/ppp.
For the purposes of illustration, imagine that you have an internet account with glob.net with the username userbaz and the password foobar
First, you need to add all this to a file called /etc/ppp/pap-secrets. The format of an entry for our purposes is:
USERNAME SERVERNAME PASSWORD
So you would add the following line to /etc/ppp/pap-secrets and then save it :
userbaz glob foobar
You can use any name for the server you wish, so long as you use the same name in the pppd arguments, as you'll see shortly. Here it's been shortened to glob, but this name is only used to locate the correct password.
Next you need to set up the connection in kppp. The basics are the same as any other connection, so we won't go into details here, except to say that you probably want to make sure that /etc/ppp/options is empty, and you don't want to create a login script either.
In the kppp settings dialog, at the bottom of the Dial tab, is a pppd arguments button. This brings up an editing dialog. Here you can enter values that will be sent to pppd as command line arguments, and in the case of multiple value arguments, you need to enter each value as a separate entry in the listbox, in the correct order.
You can put in any other arguments you want first. Then add the arguments that pppd uses to handle PAP authentication. In this example, we are going to add user, userbaz, remotename and glob in that order.
The user tells the pppd what user name to look for in the pap-secrets file and then to send to the server. The remotename is used by pppd to match the entry in the pap-secrets file, so again, it can be anything you want so long as it is consistent with the entry in the pap-secrets file.
That's all there is to it, and you should now be able to set up your own connection to a server with PAP authentication. CHAP is not much different. You can see the Linux® Network Administrators Guide for a chap-secrets file format, and the pppd arguments used, and the rest should be simple.
This section should get the fearful started on the (not so) arcane art of modem tweaking. The commands here are all Hayes AT standard, but all modems are not equal, so your mileage may vary.
A Modem session allows you to interact with the modem directly. You type commands, and it will respond. To obtain a modem session, when no connection is active, go into Setup, then Modem Terminal dialog. This will open a window for interactive configuration of the modem. Try typing ATZ (which resets your modem) Your should get an OK response. Use File->Close to end the session.
One reason you might want to send the modem commands directly is if you have a set of modem configurations you want to keep, and not have to specify for every connection. A good way to do that is via modem profiles. Modems can have several stored profiles numbered 0,1,... AT&V can be used to view them all. The default profile is usually 0 (this can be changed via AT&Y.) The profile currently in use is called the “active” profile.
When you change a setting, the active profile is modified. The ATZ command will have the modem load the default profile, erasing any changes you have made. To save changes, Load the profile you want to change via ATZn (where n is the profile number). Make the changes you want, then save it with AT&Wn. To have kppp use the profile you want, change the modem initialization string (Setup Modem Modem Commands Initialization String.) For example ATZ1 will have the kppp reset the modem and use stored profile #1.
If you want reset you modem to get back to some known starting point, use AT&F&W to set the active profile to the factory defaults, and store those settings as the default profile.
Examples of profile changes are in the next section
Sometimes you may find that kppp has difficulties hanging up the modem. This is likely the result of a mismatch between kppp settings and those of the modem. A standard modem uses two methods to decide to hangup: Command, and DTR. The Command method involves sending an escape sequence to the modem, which puts it in command mode, then issuing the hangup command (ATH).
Outside of kppp, when configuring the pppd package manually, it's often helpful to use the command method, so that one can exit a terminal session, and then start pppd without having the modem hangup. In most other situations, the DTR method is preferred, as it is simpler.
The DTR method will have the modem hangup whenever kppp stops using the modem. If you obtain a modem session, and query the state via AT&V, and you can see among the displayed settings for the active profile a &D0, then the DTR hangup method is disabled. To enable the DTR method, use the Terminal button to get a modem session, then:
ATZ # reset to default profile AT&D2 # Set to hang up on DTR drop AT&W # Write to default profile
Whenever the Data Terminal Ready (DTR) line on the serial line between the host computer and the modem goes high, the modem hangs up. When kppp opens the serial port, the DTR line is pulled low, on an external modem, you can see the DTR (or TR) light come on when this happens. When the TR light goes out (because kppp has closed the serial port, or something worse!), the modem will hangup.
The other way to have a modem hang up when connected (used when AT&Dn where n is not 2) is to have the modem accept the command when a session is in progress. To have it hang up properly, get a modem session, and set the guard time to a short interval like so:
ATZ ATS12=5 AT&W
Then use the Guard Time slider in the Modem commands section to match the register (S12 to this value 5. The modem should then hangup properly.
When the local modem is connected to a remote modem, it is in the “connect” state, where it passes all characters it receives to the remote modem without interpretation. To have the modem accept the characters as commands for itself, one must put the modem into the command state. The escape code does this.
The escape code is defined as being three intervals of time whose length is defined by S12 in fiftieths of a second.
Quiet (must last more than S12/50 seconds)
Escape character (defined by the register S2, the default is “+”), repeated three times (less than S12/50 seconds between each.
Quiet (must last more than S12/50 seconds)
Once the modem is in the command state, you can send it commands. To have it hang up, send the command ATH. The escape codes and the hangup string used by kppp are shown in the Modem Commands dialog. These should match your modem.
If you can use tone dialling, the amount of time it takes to dial can be changed using the S11 register. It gives the duration (in 100hundreds of a second) to send each tone while dialling. The default is usually 95 (almost a second.) How fast you can dial depends on the phone company's switching equipment which handles your line. The minimum duration is 50, almost twice as fast, and that speed often works.
ATZ # reset to default profile ATS11=50 # fastest possible dialling, use a higher number if it doesn't work AT&W # write to default profile
This chapter is based on material provided by Martin Häfner, <mh@ap-dec717c.physik.uni-karlsruhe.de>
This section introduces UNIX® (Linux®) callback, and how kppp can be configured to connect to a UNIX® callback server, especially to a script based Linux® callback server
There are several reasons to consider using callback. Some of these are:
To increase the security of your local network
To reduce expenses of external co-workers
To control telephone costs where calls are claimed as business expenses
Think about someone calling the number of your dial in server, and then cracking a password. Why bother to maintain a firewall for your internet connection, if access to your network is that easy?.
Callback software generally asks for your name, and then hangs up the line. It then calls you back, usually at a number that is stored on the server in a database. The client then picks up the phone line and continues with the dial-in as if nothing had happened. The server now requests your username and password, knowing that you are who you said you were when you first dialled in, or at the least, you are where you said you were. The connection is established normally, and the pppd is started.
Now the big question is, how to tell the client to pick up the phone, when the server calls you back. Do you need a special program, such as mgetty? The answer is, no, you don't need a special client program. In general, any client can be used for callback connections, you could even use an ordinary terminal program such as minicom to connect.
The only thing you have to do is tell your modem to AutoAnswer the phone when a RING is detected by the modem. This is done with the following modem command:
AT&SO=1
This tells the modem to pick the phone up after one RING.
Like a lot of other client programs, kppp checks to see if the connection is closed by the server, and then stops the current session if a NO CARRIER is detected. This, then, is the real problem when setting up callback. NO CARRIER will of course be detected the moment the callback server hangs up the line. Some servers therefore use a special login program. So how do you solve this problem? You tell your modem to show CARRIER UP at all times (which causes no problems if you tell the client to hang up the line.) You can do this with the following modem command:
AT&C0
If you want to test this, you can first use an ordinary terminal program such as minicom, and call your callback server, to see what hapens.
So, now that you've seen the theory in action, how do you go about setting up kppp to handle the connection?
The procedure is quite straightforward, as follows.
Procedure 9.1.
First tell the modem to accept connections, and to not stop the negotiation when the callback server hangs up the line for the first time. You can add both these options in the Modem tab of the kppp configuration, by adding to the option Dial String the string AT&C0S0=1DT
There are no other changes with configuration for kppp. If you meet trouble with modem init and reset, check the Troubleshooting section for more information.
Think about your server for a moment. Remember that UNIX®, Windows® and Macintosh operating systems have differing opinions about how to end a line in a text file, and therefore, in login procedures too. If you are connecting to a Windows® server, use CR/LF, if you are connecting to a UNIX® server, use CR, and if you are connecting to a Macintosh server, use LF
We are assuming for these instructions that you are calling a Linux® callback package which uses ordinary login (not PAP or such).
Set the Authentication style in the Dial tab of the account configuration to Script-based
Now you have to build the login script. Editing of login scripts is one of the very cool features of kppp You can find it in the Login Script tab of the Edit Account dialog.
In this example, the user userxyz needs the following script to be called. The callback server already knows the table of names and their applicable phone numbers, so you select the phone number to be used with an alias, for security purposes.
For each line, choose the criteria from the drop down list on the left of the diaog, and type in the action in the text box on it's right. Choose the Add to add each line to the script. You can use Insert to add a line into the middle of the script, and Remove to delete a line if you made a mistake.
The entire script should look something like this (without the comments, shown here starting with a #)
Expect ogin: # remember, we do ordinary terminal login ID "" # kppp sends the id you configured in the main dialog Expect for userxyz: # a list of available numbers is shown, the user should choose one Send userxyz-home # the user wants to be called back on their home number Expect ogin: # The callback process is now running, a new connection, and so a new login. ID Expect assword: # Now send your password Expect > # Wait for the command prompt (the prompt may vary) Send start_ppp # this command starts the pppd
After waiting for the login request, the user sends his ID and waits for a list of available phone numbers for that username. Then he tells the server which of the numbers offered he would like to be called back on. kppp can open a dialog for this, if your location changes often, e.g. you are a sales representative and move from hotel to hotel. Now the server is expecting login and password for authentication, but in the meantime, the server hangs up and calls the user back. The authentication information is sent, and kppp waits for a command prompt, and then starts a small script (here called start_ppp which fires up pppd on the server.
The start_ppp script might look something like the following:
#!/bin/sh stty -echo exec /usr/sbin/pppd -detach silent modem
Of course, setting up a PPP server is not within the scope of this document. For detailed information, see the pppd man pages. An excellent description of a callback server can be found at http://ap-dec717c.physik.uni-karlsruhe.de/~mh/callback
All other configuration issues, such as pppd configuration or IP settings work as normal, and no special software is required to pick up the line.
kppp callback and other programs such as mgetty or any other faxgetty can be run on the same serial port. There are no problems with the dial in, as kppp creates a lock file which will tell the getty program that another application (in this case, kppp of course,) is using the line at that time.
There are some known problems with kppp in callback mode:
As you initialize the modem to auto answer, you need to reset the modem after your connection is closed. Otherwise, your modem will continue to pick up the line for you, which is not a good idea if the line in question is your main phone line.
kppp has some small problems when sharing a line with another program, such as mgetty. If mgetty is running on the same modem line, kppp is not able to initialize the modem correctly.
kppp is unable to prompt for certain user input during a scripting based login. Unfortunately, when using the example script above, kppp also asks for the user name the second time the callback server requests it. You can get rid of this by hardcoding your userid into the login script (not very portable or nice, but it works.
Linux® callback server software bundles are available in many places.
The well known mgetty is a very powerful program, and is also able to handle callback connections. A description of how to set up mgetty for this purpose is maintained at http://www.dyer.demon.co.uk/slug/tipscrip.htm, by Colin McKinnon, <colin@wew.co.uk>.
There is also a ready to use package for Linux® at http://www.icce.rug.nl/docs/programs/callback/callback.html. This package is maintained by Frank B. Brokken, <frank@icce.rug.nl>. As the setup, although straightforward, is not very easy, I have written a short introduction for it at http://ap-dec717c.physik.uni-karlsruhe.de/~mh/callback/, which also contains a more general introduction to callback.
Windows® NT uses a completely different approach than the one described above. NT requires an extension to the PPP protocol itself, called CBCP (Call Back Control Protocol). pppd has support for this protocol, but you must recompile pppd. If anybody has experience with successfully connecting to an NT callback server, please let us know.
10.1. Questions about Dialling | |
10.10.1.1. | I can't get kppp to work. kppp tells me pppd has died or that a timeout has expired. What's going on? |
Did you read this manual carefully? Here are once more the most common pitfalls:
If nothing helps, you might obtain some debugging info from your systems log by issuing: # tail /var/log/messages | |
10.10.1.2. | Why does kppp tell me Sorry, can't open the modem? |
This means that kppp doesn't have permissions to open the modem device or that you selected a modem device on the Modem Tab Dialog that is not valid. First make sure you selected the right modem device. Once you are sure you have selected the right modem device, you must give kppp the right permission to access the modem device and to be able to modify /etc/resolv.conf in case you want kppp to configure DNS correctly for you. If you can afford to run kppp setuid root this would solve all access problems for you, if not you will have to figure out what the right permissions are for your purposes. In order to give kppp setuid root permissions do the following: % su root # chown root:root $KDEDIR/bin/kppp # chmod +s $KDEDIR/bin/kppp # exit | |
10.10.1.3. | Why does kppp tell me it can't create a modem lock file? |
This in most instances means that you have installed kppp without SETUID bit on while you, the person executing kppp, doesn't have write access to the lock file directory which by default is /var/lock. This for example is the case on Red Hat® systems. Check the modem dialog for the precise location you have chosen. The solution is easy -- either run kppp SETUID if you can afford to, or give regular users write access to /var/lock or create a modem group that will have access to the /var/lock file. | |
10.10.1.4. | Why is kppp installed with the SETUID bit on? |
para>There is no need for the SETUID bit, if you know a bit of UNIX® systems administration. Simply create a modem group, add all users that you want to give access to the modem to that group and make the modem device read/writable for that group. Also if you want DNS configuration to work with kppp, then /etc/resolv.conf must be read/writable by the members of that group. The same counts for /etc/ppp/pap-secrets and /etc/ppp/chap-secrets if you want to use the built-in PAP or CHAP support, respectively. The kppp team has lately done a lot of work to make kppp setuid-safe. But it's up to you to decide if you install and how you install it. You might also want to read the Security section. | |
10.10.1.5. | What do I do when kppp just sits there and waits with the message: Expecting OK |
Have you played with the CR/LF setting? Try CR, LF or CR/LF. Alternatively, your modem might need some time to respond to its intialization. Open the Modem Commands dialog on the Modem tab and adjust the Pre-Init and Post-Init delays. See if you are successful when drastically increasing their values, and then do some fine-tuning later. | |
10.10.1.6. | The connection works fine, but I can't start any applications! |
You have probably selected the Auto Configure Host Name option, and the X Server has problems connecting to your newly named host. If you really need this option (and chances are you really don't), you are unfortunately on your own to set up the appropriate authorisations. Issuing xhost + before starting the connection would do the job, but be warned of the security risks involved, since this effectively gives everyone else access to your X Server. | |
10.10.1.7. | kppp reports a successful connection, but Konqueror just says Unknown host hostname, and Netscape® reports The server does not have a DNS entry. |
Try pinging another server by its IP number, e.g. ping 195.0.254.76. If that works, you could try the following:
| |
10.10.1.8. | How do I make kppp send a \n or a \r |
Just send an empty string such as in the following script: Send # send an empty string Expect ID: Send itsme Expect word: Send forgot Expect granted Send ppp | |
10.10.1.9. | How can I stop kppp complaining: Can't create lock file? |
This happens because you don't have permissions to create a lock file. If you chose to use a lock file, you must have write permision to the directory (typically /var/lock). This is of course no problem if you have given kppp setuid permissions. Please read the section on Lock files. | |
10.10.1.10. | Why is my modem making so much noise when dialling? |
Click on Setup, then Modem. You can control the modem volume here in three steps: Off, medium and high. For most modems, medium or high result in the same volume. If changing this setting doesn't work, make sure the correct settings for your modem are specified in Setup, Modem, Modem Commands. | |
10.10.1.11. | I turned the modem volume to ‘Off’ and verified the modem commands, but I still hear that awful noise during dialling. Why? |
The volume initialisation string can get lost if your modem can't cope with the speed it is receiving commands from kppp. Increase the value of Post-Init Delay in Setup, Modem, Modem Commands. | |
10.10.1.12. | kppp keeps reporting unusual modem speeds like ‘115200’ or ‘57600’ |
Many modems only report the speed of the serial line and not the speed over the telephone line as default. You must configure these modems to report the true line speed by adding some commands to the modem init or dial strings. For many modems this command is ATW2. If you want to add it to the dial string (which normally starts with ATD), the new dial string would be ATW2D. | |
10.10.1.13. | Why does kppp report ‘Unknown speed’ |
New modems often have very complex connection messages like CONNECT LAP.M/V42.bis/115000:RX/31200:TX, and kppp cannot parse this message correctly. Turn on Show Log and you'll see the connection speed. | |
10.10.1.14. | I get a slow connection speed |
If you are not satisfied with the modem speed, make sure you've set the connection speed (you can reach it by clicking on Setup, Device, Connection Speed) to 57600 or higher. Make sure your serial ports support higher speeds. Many older systems based on i486 do not work correctly if you set the speed to 115200. If you have an old 8250 UART chip, it won't work. If you have a 16550 or 16550A it should work flawlessly. Additionally, you should consult your modem manual to look for init strings that enable a high speed mode. | |
10.10.1.15. | I get a REALLY slow connection speed! |
If data drips on at a rate of just a few bytes per second, you should check your hardware setup. If moving your mouse speeds up the transmission this is definitely a hardware issue! You can obtain some information about your serial port with setserial -a /dev/ttySx and check for interrupt conflicts with other components of your system. The KControl module Information might also be of help here. | |
10.10.1.16. | My phone line needs pulse dialling instead of tone dialling (or vice-versa). How do I change that? |
You must modify your modem dial string. Nearly all modems support the following AT commands:
| |
10.2. Questions about Telephone Cost Rules | |
10.10.2.1. | How do I write a telephones cost rules file? |
Just follow the TEMPLATE rules file supplied with kppp. You should be able to find a copy in $KDEDIR/doc/HTML/yourlang/kppp/. Use the -r kppp command line option to check the syntax of your proposed rules file. | |
10.10.2.2. | I have written a telephone cost rules for my region. Where can I submit it so that others can make use of it? |
10.10.2.3. | Can my phone cost rulefile contain fractional time units like "(0.17, 45.5)"? |
Yes this is possible. But you shouldn't use unusually small time units below a tenth of a second, because this would result in higher CPU load, although you probably won't notice on a modern CPU. | |
10.10.2.4. | My country observes other ‘moving’ holidays than Easter. |
In that case, you need to write new code that allows for the computation of that holiday. Please have a look at ruleset.cpp and emulate the ‘easter’ example. Then send in the patches!. | |
10.3. Questions about the System Logs | |
10.10.3.1. | I see a message saying Serial line is looped back. What does this mean? |
Short answer: You didn't start the PPP software on the peer system. | |
10.10.3.2. | The logs show Signal 15 |
If you see the following lines, you've probably just received a timeout error from kppp. kppp has been waiting for the PPP interface to come up and gave up after the specified timeout. pppd was signalled to shut down, with signal number 15, i.e. SIGTERM. pppd[26921]: pppd 2.3.5 started by me, uid 500 pppd[26921]: Using interface ppp0 pppd[26921]: Connect: ppp0 <--> /dev/ttyS0 pppd[26921]: Terminating on signal 15. pppd[26921]: Connection terminated. pppd[26921]: Exit. | |
10.10.3.3. | What about Receive serial link is not 8-bit clean |
The PPP daemon is alarmed by the fact that all the data it receives has bit 8 set to zero. In most cases this simply indicates that the remote PPP server isn't running yet. You might still be confronted by a login prompt that echoes back all the data sent by your pppd. | |
10.10.3.4. | and can't locate module ppp-compress? What's this? |
Do you see the following messages? modprobe: can't locate module ppp-compress-21 modprobe: can't locate module ppp-compress-26 modprobe: can't locate module ppp-compress-24 Just add the lines: alias ppp-compress-21 bsd_comp alias ppp-compress-24 ppp_deflate alias ppp-compress-26 ppp_deflate to your /etc/conf.modules file. |
kppp
kppp is derived from ezppp 0.6, by Jay Painter. However, nearly everything in kppp was rewritten so ezppp and kppp do not have much in common any longer.
Primary Developers:
Bernd Johannes Wuebben <wuebben@kde.org>
Mario Weilguni <mweilguni@sime.com>
Harri Porten <porten@kde.org> (Current maintainer)
Many thanks to the following people who have contributed code to kppp
Jesus Fuentes Saaverdra <jesus.fuentes@etsi.tel.uva.esfor> implementing several options and miscellaneous work.
Markus Wuebben <wuebben@eure.de> for the ATI query dialog
Peter Silva <peter.silva@videotron.ca> for pop up dialogs and other contributions
Martin A. Brown <MABrown@etcconnect.org>
Martin Häfner <mh@ap-dec717c.physik.uni-karlsruhe.de> for the section on callback.
Olaf Kirch <okir@caldera.de> for the introduction to the mysteries of file descriptor passing.
Documentation copyright 2001 Lauri Watts <lauri@kde.org>, although largely based on the original by Bernd Johannes Wuebben <wuebben@kde.org>
This documentation is licensed under the terms of the GNU Free Documentation License.
This program is licensed under the terms of the GNU General Public License.
kppp is part of the KDE project http://www.kde.org/.
kppp can be found in the kdenetwork package on ftp://ftp.kde.org/pub/kde/, the main FTP site of the KDE project.
In order to compile and install kppp on your system, type the following in the base directory of the kppp distribution:
% ./configure % make % make install
Since kppp uses autoconf and automake you should have no trouble compiling it. Should you run into problems please report them to the KDE mailing lists.
The following sections contain some fairly generic information for several common operating systems which might run kppp. The following sites may be of interest for further information about the ppp protocol, pppd and networking in general:
The Linux® PPP FAQ: http://metalab.unc.edu/mdw/FAQ/PPP-FAQ.html
The Linux® PPP HOWTO: http://metalab.unc.edu/mdw/HOWTO/PPP-HOWTO.html
The Network Administrators' Guide: http://metalab.unc.edu/mdw/LDP/nag/nag.html
In order for kppp (or indeed, pppd) to work, your kernel must have ppp support compiled in. If this is not the case, get yourself the latest version of pppd from any of the popular Linux® archives (such as ftp://sunsite.unc.edu/pub/Linux/system/Network/serial/ppp/, and recompile your kernel with ppp support enabled.
Don't fret, since this sounds a lot scarier than it actually is. Don't forget to install pppd afterwards.
If you're not sure if you have a kernel with ppp support, issue the dmesg at the command prompt and look for something like this:
PPP: version 2.3.0 (demand dialling) TCP compression code copyright 1989 Regents of the University of California PPP Dynamic channel allocation code copyright 1995 Caldera, Inc. PPP line discipline registered
kppp tries to find out for itself if your kernel supports PPP. If not, you will be notified as soon as kppp starts up.
For Linux® 2.x kernels, the pppd daemon should be version 2.3 or greater. You can find out what version your system has, by issuing the command pppd --version on the comamnd line. None of the pppd daemons actually have a --version, but putting the option in will cause the pppd daemon to issue an error message, and then to print out a list of options and other information, which includes the version of the ppd daemon.
Here is a description of the Hayes Command Set. Most modems follow this command set to large extent. If you lost your modem manual or never had one in the first place, this reference might come in handy. I for instance finally found out how to turn my modems speaker off: ATM0 -- Finally: Silence!
The modem initialization string consists of a series of commands. It prepares the modem for communications, setting such features as dialing mode, waits, detection of the busy signal and many other settings. Newer modem communications programs reset the initializations string for you according to which menu options you select, which features you enable, etc..
For many years Hayes modems have been the standard. As the field of modem manufactures has grown, most have adhered at least loosely to the Hayes standard. The following is a partial list of the Hayes command set. (called the ‘AT’ commands). The Hayes Command Set can be divided into four groups:
A capital character followed by a digit. For example, M1.
An “&” (ampersand) and a capital character followed by a digit. This is an extension of the basic command set. For example, &M1. Note that M1 is different from &M1.
Usually started by either a backslash (“\”), or a percent sign (“%”), these commands vary widely among modem manufacturers. For that reason, only a few of these commands are listed below.
Sr=n where r is the number of the register to be changed, and n is the new value that is assigned.
A “register” is computerese for a specific physical location in memory. Modems have small amounts of memory onboard. This fourth set of commands is used to enter values in a particular register (memory location). The register will be storing a particular “variable” (alpha-numeric information) which is utilized by the modem and communication software. For example, S7=60 instructs your computer to “Set register #7 to the value 60”.
Although most commands are defined by a letter-number combination (L0, L1 etc.), the user of a zero is optional. In this example, L0 is the same as a plain L. Keep this in mind when reading the table below!
Here are some of the most important characters that may appear in the modem initialization string. These characers normally should not be changed.
Tells the modem that modem commands follow. This must begin each line of commands.
Resets the modem to it's default state
makes your software pause for a second. You can use more than one , in a row. For example, ,,,, tells the software to pause four seconds. (The duration of the pause is governed by the setting of register S8.
Sends the terminating Carriage Return character to the modem. This is a control code that most communication software translates as “Carriage Return”
In alphabetical order:
Table B.1. Basic Hayes Command Set
Command | Description | Comments |
---|---|---|
A0 or A | Answer incoming call | |
A/ | Repeat last command | Don't preface with AT. Enter usually aborts. |
B0 or B | Call negotiation | V32 Mode/CCITT Answer Seq. |
B1 | Call negotiation | Bell 212A Answer Seq. |
B2 | Call negotiation | Verbose/Quiet On Answer |
D | Dial | Dial the following number and then handshake in orginate mode.
|
E0 or E | No Echo | Will not echo commands to the computer |
E1 | Echo | Will echo commands to the computer (so one can see what one types) |
H0 | Hook Status | On hook - Hang up |
H1 | Hook status | Off hook - phone picked up |
I0 or I | Inquiry, Information, or Interrogation | This command is very model specific. I0 usually returns a number or code, while higher numbers often provide much more useful information. |
L0 or L | Speaker Loudness. Modems with volume control knobs will not have these options. | Off or low volume |
L1 | Low Volume | |
L2 | Medium Volume | |
L3 | Loud or High Volume | |
M0 or M | Speaker off | M3 is also common, but different on many brands |
M1 | Speaker on until remote carrier detected (i.e. until the other modem is heard) | |
M2 | Speaker is always on (data sounds are heard after CONNECT) | |
N0 or N | Handshake Speed | Handshake only at speed in S37 |
N1 | Handshake at highest speed larger than S37 | |
O0 or O | Return Online | See also X1 as dial tone detection may be active. |
O1 | Return Online after an equalizer retrain sequence | |
Q0 or Q1 | Quiet Mode | Off - Displays result codes, user sees command responses (e.g.OK) |
Q1 | Quiet Mode | On - Result codes are suppressed, user does not see responses. |
Sn? | Query the contents of S-register n | |
Sn=r | Store | Store the value of r in S-register n |
V0 or V | Verbose | Numeric result codes |
V1 | English result codes (e.g.CONNECT, BUSY, NO CARRIERetc.) | |
X0 or X | Smartmodem | Hayes Smartmodem 300 compatible result codes |
X1 | Usually adds connection speed to basic result codes (e.g.CONNECT 1200 | |
X2 | Usually adds dial tone detection (preventing blind dial, and sometimes preventing AT0) | |
X3 | Usually adds busy signal detection | |
X4 | Usually adds both busy signal and dial tone detection | |
Z0 or Z | Reset | Reset modem to stored configuration. Use Z0, Z1etc. for multiple profiles. This is the same as &F for factory default on modems without NVRAM (non voltaile memory) |
Table B.2. The Extended Hayes Command Set
Command | Description | Comments |
---|---|---|
&B0 or &B | Retrain Parameters | Disable auto retrain function |
&B1 | Retrain Parameters | Enable auto retrain function |
&B2 | Retrain Parameters | Enable auto retrain, but disconnect if no line improvement over the period dictated by S7 |
&C0 or &C1 | Carrier detect | Signal always on |
&C1 | Carrier detect | Indicates remote carrier (usual preferred default) |
&D0 or &D | Data Terminal Ready (DTR | Signal ignored (This is modem specific, you must see your manual for information on this one!) |
&D1 | Data Terminal Ready (DTR | If DTR goes from On to Off the modem goes into command mode (Some modems only) |
&D2 | Data Terminal Ready (DTR | Some modems hang up on DTR On to Off transition (This is the usual preferred default) |
&D3 | Data Terminal Ready (DTR | Hang up, reset the modem, and return to command mode upon DTR |
&F0 or &F | Factory defaults | Generic Hayes-compatible defaults. This is usually a good thing to use in your init string, since the &F1-&F3 settings can vary among modems, and they may actually be the cause of connection problems. (Since you never know exactly what Brand X's &F2 really changes. On the other hand, it pays to try out the other options below; many people's problems can be solved by replacing a complicated init string with a simple &F2 or the like. However, if you're building an init string, it's best to start with a simple &F, and not use the ‘customized’ form of defaults. |
&F1 | Factory Defaults | Factory Defaults tailored to an IBM PC compatible user |
&F2 | Factory Defaults | Factory defaults for a Mac w/software handshaking |
&F3 | Factory Defaults | Factory defaults for a Mac w/hardware handshaking |
&G0 or &G | Guard tones | Disable guard tones |
&K0 or &K | Local flow control | Disable local flow control |
&K1 | Local flow control | Enable RTS/CTS hardware local flow control |
&K2 | Local flow control | Enable XON/XOFF software local flow control |
&K3 | Local flow control | Enable RTS/CTS hardware local flow control |
&K4 | Local flow control | Enable XON/XOFF software local flow control |
&L0 or &L | Dial mode | Select dial-up mode |
&M0 or &M | Error control mode | Select asynchronous non-EC mode (the same as &Q0) |
&P0 or &P | Pulse dialing ratio | U.S./Canada pulse dialing 39% make / 61% break ratio |
&P1 | Pulse dialing ratio | U.K./Hong Kong pulse dialing 33% make / 67% break ratio |
&Q0 or &Q | Error control mode | Asynchronous non-EC more. No data buffering. ASB disabled. |
&Q5 | Error control mode | Select V.42 EC operation (requires flow control) |
&Q6 | Error control mode | Asynchronous mode with ASB (requires flow control) |
&Q8 | Error control mode | Select alternate EC protocol (MNP) |
&Q9 | Error control mode | Conditional data compression: V.42bis = yes, MNP5 = no. |
&S0 or &S | DSR action select | Always on (default) |
&S1 | DSR action select | Follows EIA specification (Active following carrier tone, and until carrier is lost.) |
&T0 or &T | Self test | Model specific self test on some modems |
&U0 or &U | Trellis code modulation | Enable V.32 TCM |
&U1 | Trellis code modulation | Disable V.32 TCM |
&V0 or &V1 | View active | (and often stored) configuration profile settings (or ATI4 |
&W0 or &W | Store profile | In NVRAM (&W0, &W1 etc. for multiple profiles) Some settings cannot be stored. These often don't show on &V or ATI4 |
&Y0 or &Y | Select configuration loaded at power-up | Load profile 0 (default) |
&Y1 | Select configuration loaded at power-up | Load profile 1 |
&Zn=x | Soft reset and load stored profile number n | Note that all items after the &Z on the command line are ignored |
Table B.3. Backslash and Percent Commands
Command | Description | Comments |
---|---|---|
\A0 or \A | Character maximum MNP block size | 64 character maximum |
\A1 | Character maximum MNP block size | 128 character maximum |
\A2 | Character maximum MNP block size | 192 character maximum |
\A3 | Character maximum MNP block size | 256 character maximum |
%C0 or %C | Data Compression Enable/Disable | Disabled |
%C1 | Data Compression Enable/Disable | MNP5 enabled |
%C2 | Data Compression Enable/Disable | V.42bis (BTLZ) Enabled |
%C3 | Data Compression Enable/Disable | MNP5 & V.42bis (BTLZ) Enabled |
%D0 or %D | Data compression | 512 BLTZ dictionary size |
%D1 | Data compression | 1024 BLTZ dictionary size |
%D2 | Data compression | 2048 BLTZ dictionary size |
%D3 | Data compression | 4096 BLTZ dictionary size |
%E0 or %E1 | Escape method | ESCAPE DISABLED |
%E1 | Escape method | +++AT method (default) |
%E2 | Escape method | BreakAT method |
%E3 | Escape method | BOTH methods enabled |
%E4 | Escape method | Disable OK to +++ |
%E5 | Escape method | Enable OK to +++ |
\J0 or \J | DTE Auto Rate Adjustment | Disabled |
\J1 | DTE Auto Rate Adjustment | DTE rate is adjusted to match carrier rate. |
\N0 or \N | Connection type | Normal connection (see below for definitions) |
\N1 | Connection type | Direction connection |
\N2 | Connection type | MNP Auto-reliable connection |
\N3 | Connection type | Auto-reliable connection |
\N4 | Connection type | V.42bis reliable link with phase detection |
\N5 | Connection type | V.42bis auto-reliable link with phase detection |
\N6 | Connection type | V.42 reliable link with phase detection |
\N7 | Connection type | V.42 auto-reliable link with phase detection |
A direct connection is a simple straight-through connection without any error connection or data compression. In this case, the computer-to-modem and modem-to-modem speeds must be identical.
A normal connection uses flow control (either software or hardware) to buffer the data being sent or received, so that the modem can transmit data at a different rate than the computer is actually sending or receiving it. For example, a computer may send actual data at 57kbps, but using compression, the modem only actually sends 28.8kbps. This is the mode use by most modems.
A reliable connection is a type of normal connection; if, for some reason, data compression or error correction cannot be established or maintained, the connection will hang up. (In essence, such a modem ensures that all connections are reliable, for it will hang up if the connection isn't.)
Likewise, an auto-reliable connection is virtually the same, except that the modem will try to renegotiate the connection in order to establish a reliable connection. Again, this is the mode that most modems use.
Table B.4. S Registers
Register | Range | Default | Function |
---|---|---|---|
S0 | 0-255 rings | 1-2 | Answer on ring number. Don't answer if 0 |
S1 | 0-255 rings | 0 | if S0 is greater than 0 this register counts the incoming rings. |
S2 | 0-127 ASCII | 43 + | Escape to command mode character |
S2 | >127 | no ESC | |
S3 | 0-127 ASCII | 13 CR | Carriage return character |
S4 | 0-127 ASCII | 10 LF | Line feed character |
S5 | 0-32, 127 ASCII | 8 BS | Backspace character |
S6 | 2-255 seconds | 2 | Dial tone wait time (blind dialling, see Xn |
S7 | 1-255 seconds | 30-60 | Wait time for remote carrier |
S8 | 0-255 seconds | 2 | Comma pause time used in dialing |
S9 | 1-255 1/10ths second | 6 | Carrier detect time required for recognition |
S10 | 1-255 1/10ths second | 7-14 | Time between loss of carrier and hangup |
S11 | 50-255 milliseconds | 70-95 | Duration and spacing of tones when tone dialing |
S12 | 0-255 1/50th seconds | 50 | Guard time for pause around +++ command sequence |
S36 | Fallback options when error correction link fails:
| 7 | Negotiation Failure Treatment |
S37 |
| 0 | Negotiation Speed (Intial handshake) |
Many modems have dozens, even hundreds, of S registers, but only the first dozen or so are fairly standard. They are changed with a command like ATSn=N, and examined with ATSn? (e.g. AT S10=70 S1? would tell the modem not to hang up for seven seconds should it not hear the answering modem, and return the number of times the phone last rang.)
If you can't find a rule for your region you will have to write one by following the following template. Don't be afraid though it is really easy.
Don't forget to submit your newly created rules file to kppp's maintainer. The newly created rules file can be checked for valid syntax with the -r rule_file command line option to kppp and must be installed in ${KDEDIR}/share/apps/kppp/Rules or in ${HOME}/.kde/share/apps/kppp/Rules before you will be able to select it in this dialog.
################################################################ # # Disclaimer/License # This Template ist (c) by Mario Weilguni <mweilguni@kde.org> # It ist licenced under the same terms as the kppp package, # which it is part of # ################################################################ # # This is a sample rule set for kppp. You can use it as a # template when you have to create your own ruleset. If you do # so, remove all comments and add your own. This will allow # other users to check your ruleset more easily. # # Please sign the the tarif file with your name an email address # so that I can contact you if necessary. # # NOTE: the rules in this rule set do not make much sense and # are only for demonstration purposes # # NOTE ON FILENAMES: # when you create your own ruleset, use "_" in filename # instead of spaces and use ".rst as extension # i.e. "Austria city calls" # --> file should be saved as "Austria_city_calls.rst" # # Thanks, Bernd Wuebben # wuebben@math.cornell.edu / wuebben@kde.org ################################################################ ################################################################ # # NAME OF THE RULESET. This is NEEDED for accounting purposes. # ################################################################ name=default ################################################################ # currency settings ################################################################ # defines ATS (Austrian Schilling) to be used as currency # symbol (not absolutely needed, default = "$") currency_symbol=ATS # Define the position of the currency symbol. # (not absolutely needed, default is "right") currency_position=right # Define the number of significant digits. # (not absolutely needed, default is "2" currency_digits=2 ################################################################ # connection settings ################################################################ # NOTE: rules are applied from top to bottom - the # LAST matching rule is the one used for the # cost computations. # This is charged whenever you connect. If you don't have to # pay per-connection, use "0" here or comment it out. per_connection=0.0 # minimum costs per per connection. If the costs of a phone # call are less than this value, this value is used instead minimum_costs=0.0 # You pay .74 for the first 180 seconds ( 3 minutes) no matter # whether you are connected for 1 second or 180 seconds. # This rule will take priority during the first 180 seconds # over any other rule, in particular the 'default' rule. # have a look at costgraphs.gif in the docs directory # of the kppp distribution for a graphic illustration. flat_init_costs=(0.74,180) # This is the default rule which is used when no other rule # applies. The first component "0.1" is the price of one # "unit", while "72" is the duration in seconds. # Therefore the following rule means: "Every 72 seconds 0.1 # ATS are added to the bill" default=(0.1, 72) # # more complicated rules: # # "on monday until sunday from 12:00 am until 11:59 pm the costs # are 0.2 each 72 seconds" on () between () use (0.2, 2) # same as above on (monday..sunday) between () use (0.2, 2) # same as above. You must use 24 hour notation, or the accounting # will not work correctly. (Example: write 15:00 for 3 pm) on (monday..sunday) between (0:00..23:59) use (0.2, 2) # applies on friday, saturday, sunday and monday 8am until 1pm on (friday..monday) between (8:00..13:00) use(0.3,72) # ATTENTION: on(monday..friday) between (21:00..5:00) use (0.4,2) # does NOT include saturday 0:00-5:00, just monday..friday, as it says. # applies on a given date (christmas) on (12/25) between () use (0.3,72) # a range of dates and one weekday on (12/25..12/27, 12/31, 07/04, monday) between () use (0.4, 72) # use this for easter on (easter) between () use (0.3,72) # easter + 50 days (Pfingstmontag/ Pentecost Monday ) on (easter+50) between () use (0.3,72) on (thursday) between (20:00..21:52) use (8.2, 1) # The "on()" rules above all relates to current time only. You can also # make a rule depend on the number of seconds you have been connected # by specifying this time as a third argument to "use()". # For instance, let's say normal rate in the evening is 0.20 per minute, # and it drops by 20% after one hour of connect time. This can be modelled # like: on () between (19:30..08:00) use (0.20, 60) on () between (19:30..08:00) use (0.16, 60, 3600) # Note that these rules, just like other rules, are sensitive to the # order in which they appear.