Point to Point Protocol, or ppp, is used to create your connection over one's analog telephone modem to your ISP and the internet. Your computer will use communication ports, known as "COM" ports to access your modem. Linux will refer to these hardware COM ports as Unix devices as follows:
Device | DOS com port number |
/dev/ttyS0 | COM1 |
/dev/ttyS1 | COM2 (Typically used for external modems) |
/dev/ttyS2 | COM3 |
/dev/ttyS3 | COM4 |
Currently many systems will auto-detect your modem and assign the device /dev/modem. Use this device if configured properly.
When connected to the internet, a Domain Name Server (DNS) is provided by your ISP to resolv the names of URL's. The IP addresses of these DNS servers must be provided during configuration as well as the ISP access phone number, your login and password.
This example is the manual configuration specific to Red Hat 5.2 /6.0/6.1/6.2 and a US Robotics 56k external modem.
Perform the following configuration as user root.
Edit the following files:
File: /etc/resolv.conf - Add:
domain your-isp.com - When connected, you become a node under their domain. nameserver XXX.XXX.XXX.XXX - Use nameserver IP addresses specified by your ISP nameserver XXX.XXX.XXX.XXX
nameserver XXX.XXX.XXX.XXX
File: /etc/nsswitch - Change: (older systems use hosts.conf)
Change from:
.. ... hosts: files nisplus nis dns ... ..To:
.. ... hosts: files dns nisplus nis ... ..
File: /etc/ppp/options - File should look like this:
debug - log transactions to /var/log/messages /dev/ttyS1 - ( S1 = COM2, S2 = COM3, S3 = COM4) 115200 - Baud rate. Max supported bu UART chipset, not modem. modem - Serial link is connected to a modem crtscts - Use hardware flow control (RTS and CTS) to control serial line asyncmap 0 - Choice of mapping of control characters defaultroute - PPP becomes the default route to the internet noipdefault - Not a static IP address. IP address assigned by ISP. lock - Don't let other processes besides PPP use device (/var/lock/) connect "/usr/sbin/chat -v -t 240 -f /etc/ppp/chat-isp" :
Valid baud rates: 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800
Choose the rate which is the next number higher than your modem speed.
For a full list of options see pppd man page.
File: /etc/ppp/chat-isp - File should look like this:
ABORT 'BUSY'Note that it really is "ogin:" and not "login:" and "sword:" and not "password:".
ABORT 'NO CARRIER'
'' ATZ
OK ATE1M1V1X4L3S0=0Q0&C1&D2DT*70,XXX-XXXX - Use dial in number specified by your ISP CONNECT "" and modem settings specified by your modem manual ogin: login_id (ATDT as a minimum) sword: your_password
Other options include:
ABORT 'NO DIALTONE' ABORT 'NO ANSWER' ABORT 'ERROR'
Configuration Done!
Note:
- The *70 is used to suppress call waiting. Do not include this if your telephone service does not support this.
- The string ATE1M1V1X4L3S0=0Q0&C1&D2DT is specific to a USR 56k modem. Use ATDT if you do not know what to put here. It is modem feature specific.
- See http://www.56k.com/inits/ for a full list of init strings based on the modem manufacturer.
- The /etc/ppp/options file may be omitted by placing all the pppd arguments on the command line. Example: pppd /dev/ttyS1 115200 modem crtscts .... Some or all options may be placed in the file. Those not specified in the file may be specified on the command line.
Using PPP
- Login as a user.
- In a command shell, su (to switch user to root) and login as root.
- As root, /usr/sbin/pppd
Then start Netscape: (as user)
netscape&OR by clicking on toolbar icon.
Hang up / Disconnect: (From root shell)
killall -HUP pppd
Notes:
[Pitfall]: If your network is using a SOCKS proxy server and Netscape can not resolve the URL destination, try executing this command before starting Netscape. In this scenario, you must start netscape from the same shell in which you executed the "export" command in order for Netscape to pick up the environment variable.export SOCKS_NS = XXX.XXX.XXX.XXXWhere XXX.XXX.XXX.XXX is the IP address of the SOCKS proxy server.
[Pitfall]: Its seems weird, but on a typical default installation, you must be root to execute pppd. You must use the su command to switch your user id to root. This will maintain the user configuration. Read on to learn how to configure users to run pppd.
Explanation:
- pppd searches the /etc/ppp/options file
- ppp will use the chat-isp script which is input to the chat program which invokes the dialog with your modem.
- ppp will create a network device ppp0 and use it to communicate with the ppp program at the other end. This is where your local IP address is defined.
- ppp will configure your routing table with a route to the ppp link.
Launching PPP from the Gnome desktop:
The pppd command requires root privileges. There are two ways to grant this privilege to a user for the sole purpose of using pppd. Command preparation:- Setting the "sticky bit":
chmod u+s /usr/sbin/pppd
To view everything pppd is doing while it is operating, launch pppd from a console terminal with the command exec /usr/sbin/pppd -detach
- Using the sudo facility:
To launch PPP as a regular user one must get root privileges to run PPP.
Add the user id to the "sudoer" list: /etc/sudoers
user_id host_name=NOPASSWD:/usr/sbin/pppd
Note: The RPM package sudo must be installed.
Right button click on the open desktop + New + Launcher:
- Name: PPP
- Command:
- Type: Application
- select "Run in Terminal"
- Click the icon to select and display an icon.
To terminate pppd, issue the command: killall pppd
Note: Linuxconf is no longer included with most Linux distributions. (Red Hat 7.3+)
- Launch linuxconf. (Command /bin/linuxconf)
- Select "Config" + Networking" + "Client Tasks" + "PPP/SLIP/PLIP"
- Select "Add"
- Select type of interface: PPP
- Then select Accept.
- Panel "PPP interface"
- Add the following entries:
- Phone number:
- Modem port: /dev/modem
- Login name:
- Password:
- Selected options: (Tab "Hardware")
- Use hardware flow control
- Abort connection on well-known errors
- Allow any user to (de)activate interface
- Line speed: 115200
- Modem port: /dev/modem
- Add the following entries:
- Select "Add"
- Select "Config" + Networking" + "Client Tasks" + "Name server specification (DNS)"
- List the IP addresses of the DNS name servers as provided by your ISP
The previous set-up configures the ifup and ifdown commands.
See "Adding a toolbar applet to invoke ifup/ifdown"
in the Gnome control panel configuration below.
- Launch the Gnome control panel. (Command /usr/bin/control-panel).
- Select the "Telephone/Modem" icon.
- This launches a selection panel. Select the device/com port you wish to use.
Device DOS com port number /dev/ttyS0 COM1 /dev/ttyS1 COM2 (Typically used for external modems) /dev/ttyS2 COM3 /dev/ttyS3 COM4
Currently many systems will auto-detect your modem and assign the device /dev/modem. Use this device if configured properly.
Then select "Ok".
This will set up a symbolic link between the device /dev/modem and the serial port.
- This launches a selection panel. Select the device/com port you wish to use.
- Select the "Network" icon.
- Tab - "Names": Enter the Nameserver IP addresses provided by your ISP. These are the IP addresses of the ISP's Domain Name Servers (DNS) used for domain name resolution. This information will update the file /etc/resolv.conf
- Tab - "Interfaces":
- Select button "Add".
- This Launches a new dialog box. Select the interface type: PPP. Then select "Ok".
- Enter the phone number of your ISP as well as your login and password. Select "Done".
- New dialog box asks "Save current configuration?" Save/Concel: "Save"
- Select button "Edit":
- Selected options: (Tab "Hardware")
- Use hardware flow control
- Abort connection on well-known errors
- Allow any user to (de)activate interface
- Line speed: 115200
- Modem port: /dev/modem
- New dialog box asks "Save current configuration?" Save/Concel: "Save"
- Selected options: (Tab "Hardware")
- Select button "Add".
The console commands:
- Start ppp connection to internet: /sbin/ifup ppp0
- Terminate ppp connection to internet: /sbin/ifdown ppp0
Adding a toolbar applet to invoke ifup/ifdown:
- Right click on an empty space on the Gnome toolbar.
- From the menu that appears, left click the selections "Add Applet" + "Network" + "RH PPP Dialer"
- Select the appropriate interface: ppp0 + "Ok".
This creates a small icon on the toolbar which contains a performance meter. (Measures Kilobits/sec.)
- Select this icon on the toolbar to either start or stop a ppp connection to the internet.
- This will launch a dialog box with the question "Start interface ppp0?".
Select choice Yes to connect or No. - Selecting the toolbar icon a second time will present the question:
"Stop interface ppp0?".
Select choice Yes to disconnect or No.
Notes:
This configuration of scripts /sbin/ifup / /sbin/ifdown will alter/create the files:- File: /etc/sysconfig/network-scripts/ifcfg-ppp0
PERSIST=yes - Re-dial if connection is broken. DEFROUTE=yes - Direct unspecified network traffic out this connection ONBOOT=no INITSTRING=ATZ MODEMPORT=/dev/modem - Can also use raw device i.e. /dev/ttyS1 LINESPEED=115200 ESCAPECHARS=no DEFABORT=yes HARDFLOWCTL=yes DEVICE=ppp0 PPPOPTIONS= DEBUG=no PAPNAME= REMIP= IPADDR= WVDIALSECT= - Can place optional text label here. BOOTPROTO=none MTU= MRU= DISCONNECTTIMEOUT= RETRYTIMEOUT= USERCTL=yes
- File /etc/sysconfig/network-scripts/chat-ppp0
'ABORT' 'BUSY' 'ABORT' 'ERROR' 'ABORT' 'NO CARRIER' 'ABORT' 'NO DIALTONE' 'ABORT' 'Invalid Login' 'ABORT' 'Login incorrect' '' 'ATZ' 'OK' 'ATDT*70,555-1212' 'CONNECT' '' 'ogin:' 'my-login' 'ord:' 'my-password' 'TIMEOUT' '5' '~--' ''
Red Hat network config file (typical): /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=name-of-your-node FORWARD_IPV4="yes" GATEWAYDEV="" GATEWAY="XXX.XXX.XXX.XXX"
The scripts will employ the commands:
- usernetctl - allows user to manipulate a network interface (if permitted)
- ipcalc - perform simple manipulation of IP addresses
- route - manipulate the IP routing table
From the Gnome start menu select:
- Red Hat 6.x: "Internet" + "Dialup Configuration Tool"
- Red Hat 7.1:
- "Programs" + "Internet" + "Dialup Configuration Tool" (RP3)
or
- select the desktop icon "Dialup Configuration".
- "Programs" + "Internet" + "Dialup Configuration Tool" (RP3)
This method of dialing is simple but less flexible because it does not rely on chat. This method is only good for generic ISP's which query for a login and password.
Man page for wvdial
Notes:
This configuration of ifup/ifdown will alter/create the files:- File: /etc/wvdial.conf
[Modem0] Modem = /dev/ttyS1 Baud = 115200 Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0 [Dialer Defaults] Modem = /dev/ttyS1 Baud = 115200 Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0 [Dialer BIGISP] Username = login-name Password = super-secret-password Phone = 373-9131 Dial Prefix = *70 Inherits = Dialer Defaults Stupid mode = 0
- File: /etc/sysconfig/network-scripts/ifcfg-ppp1
DEVICE=ppp1
NAME=Name-of-ISP WVDIALSECT=Name-of-ISP MODEMPORT=/dev/ttyS1 LINESPEED=115200 PAPNAME=Login-name USERCTL=true ONBOOT=no PERSIST=no - Uses but does not configure the file: /etc/ppp/peers/wvdial
- File: /etc/ppp/peers/ppp0
connect "/usr/bin/wvdial --remotename ppp0 --chat script-name
- File: /etc/ppp/pap-secrets
Contains login and password information.
Home page: Xisp
Requires pppd (v2.2.0 or better, X11R6, XPM library (libXpm >= v3.4f) and XFroms.
X-Forms:
- Download: xForms
Install xisp:
tar zxf xisp-2.5p4.tar.gz cd xisp-2.5p4/SunOS/ufc-crypt make cd ../.. gnp Makefile - Use your favorite editor gnp, vi... Change: USRLOCAL = opt/bin - Choose destination directory EXTRALIBS = SunOS/ufc-crypt/libufc.a
Edit file xispid.c: by line 67, change in two places
Change from:
#ifdef GLIBC2 static const char *private_strerror (errnum) #else static char *private_strerror (errnum) #endifTO:
static const char *private_strerror (errnum)
Edit file xispdial.c: Edit line 603
/*strcat(modemInit, " H0"); */ -- Comment out this line H0 = Hang up!!!!
Then issue the command:
makeAs root:
make install
This results in the following files:
/usr/X11R6/bin/xisp /usr/X11R6/bin/xisprccv /usr/lib/ppp/xispdial /usr/lib/ppp/xispterm /opt/bin/xisprccv /opt/bin/xispid /usr/X11R6/man/man1/xisp.1 /etc/ppp/ip-up - make back-up. Copy to ip-up.bak before install /etc/ppp/ip-down - make back-up. Copy to ip-down.bak /etc/ppp/peers/xisp_modem /etc/ppp/peers/xisp_dialer
File: /etc/ppp/peers/xisp_dialer (created by install
connect /usr/lib/ppp/xispdial
Configuration
As root create directory: /etc/ppp/peers
Create files: /etc/ppp/peers/xisp_ttyS1 (for COM2)
This is the default in xisp_modem thus:
cp xisp_modem xisp_ttyS1
Note:
Running xisp creates the file $HOME/.xispenv, $HOME/.xisp-up, $HOME/.xisp-down and /tmp/.xisppipe.UserNameXisp will start the process:
/usr/sbin/pppd 38400 call xisp_ttyS1 bsdcomp 0.0 noipdefault modem lock mru 1500and
/usr/sbin/chat -V -f /root/.xispscriptThe file /root/.xispscript is created and the deleted.
X-Isp Menu Configuration:
"Options" + "Account Information"
Phone no: XXX-XXXX - Enter number i=of your ISP Account name: login-id Password: password Authentication protocol: None "Options" + "Dialing and Login" Maximum tries: 2 Inter-dialing delay: 60 Max wait: 50 Ring bell: No ISP will call back: No Terminal after connection: No Expect: Send: ogin: %U sword: %P "Options" + "Communications Options" Device: /dev/ttyS1 Serial port COM1 (0-COM1 1-COM2 2-COM3 3-COM4) Reset: ATZ - Default Init: DT Connect String: CONNECT Serial Port Baud Rate: 38400 Flow Control: Hardware RTS/CTS Dialing method: Tone SW Compression: OFF Asyncmap: 00 "Options" + " TCP/IP Options" Dynamic local: Yes Dynamic remote: Yes Add default route to routing table: Yes Netmask: 255.255.255.0 MTU: 1500 - Same as pppd default values MRU: 1500 DNS support: No - Thus system will use resolv.conf
If you specify "Yes", xisp will blow away
your /etc/resolv.conf file!!!
The X-Isp process generates temporary scripts $HOME/.xispscript and .xisppap
This program alters /etc/ppp/ip-up and /etc/ppp/ip-down. Make backups of these scripts.
Operation of xisp requires that /etc/resolv.conf contain the IP addresses of ISP's DNS.
-
[Pitfall]: Kernel is not installed with
ppp support: Check (Pre Red Hat 7.1 kernel 2.4) with the command:
dmesg | grep -i ppp
This should return a message acknowledging ppp and the version. If not it may have been installed as a module. By default, the Redhat configuration and kernel are ready to support pppd. You can manually load the module with the command:insmod ppp
If this fails, you must re-build the kernel with ppp support or re-install linux.Note: My Red Hat 7.1 (kernel 2.4) installation has no reference to PPP in the file /etc/modules.conf.
- [Pitfall]: Must use a modem cable with external modems. Most cables do NOT include a wire for each pin in the connector. A modem cable will contain the wires necessary for modem support.
- [Pitfall]: Many BIOS's can control/assign COM ports. Make sure the bios enables or assigns the use of the COM port you wish to use.
- [Pitfall]: Many internal modem cards are NOT supported by Linux because they are "winmodems". They work under Windows because the necessary windows drivers can talk to the modem card. Linux requires a pure hardware modem which uses the Linux COM port drivers. Also the "winmodems" are inferior because they require additional processing to communicate and add an additional burden on the CPU.
- [Pitfall]: Slow modem connect speed story (FYI): Once upon a time I was working in an old mill town in eastern Connecticut and my new 56.6k modem would not connect faster than 26k. I added caller ID to my phone service and the caller ID feature did not work. The telephone company's solution was to upgrade a card at one of the junctions boxes. My caller ID started to work and my modem started to connect at full speed. The upgrade to the telephone company's hardware did the trick.
- [Pitfall]:
According to more than one source, one may test the modem connection
manually with the following commands: (IT NEVER WORKED FOR ME!!!)
- echo -e "ATZ\n" > /dev/ttyS1 - Reset
- echo -e "ATDTXXX-XXXX\n" > /dev/ttyS1 - Dial phone number XXX-XXXX
- echo -e "ATH0\n" > /dev/ttyS1 - Hang-up
- To see the serial port settings use the command:
setserial /dev/ttyS1
Results on my PC: /dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3, Flags: spd_vhi
Serial port settings may be altered with the setserial command.
See file: /etc/rc.serial for settings used during boot sequence.
The "standard MS-DOS" port associations are given below:Device DOS port Port Address IRQ /dev/ttyS0 (COM1) 0x3f8 4 /dev/ttyS1 (COM2) 0x2f8 3 /dev/ttyS2 (COM3) 0x3e8 4 /dev/ttyS3 (COM4) 0x2e8 3 - Use the following command to view the interrupts used by your system: cat /proc/interrupts
- The COM2 serial port on the rear of the typical PC is a 25 pin DB-25 male connector.
- The devices labeled /dev/ttyS* are for dial in and dial out by modem.
Devices labeled /dev/cua* are dial out ports only. - The file /etc/gettydefs contains the tty line speed settings for the serial ports. (Dial in)
- Modem Standards:
Standard Name Bits Per Second (BPS) V.90 56,600 V.34 28,800 V.32bis 14,400 V.32 9,600 V.23 1,200 V.22bis 2,400 V.22 1,200 V.21 300 V.29 (Group III FAX) 9,600 V.27ter (Group III FAX) 4,800 V.17 (Group III FAX) 14,400
Devfs will generate the /dev/ entry or use the command: mknod /dev/ppp c 108 0
Modules:
alias char-major-108 ppp_generic alias /dev/ppp ppp_generic alias tty-ldisc-3 ppp_async alias tty-ldisc-14 ppp_synctty alias ppp-compress-21 bsd_comp alias ppp-compress-24 ppp_deflate alias ppp-compress-26 ppp_deflate
Devfs config file: /etc/devfsd.conf
LOOKUP PPP MODLOADThe default Red Hat 7.1 install uses "module autoloading":
LOOKUP .* MODLOAD
- PPP HOWTO Guide
- PPP FAQ
- System monitor gkrellm - Monitors PPP speed/bandwidth
- IRQTUNE - A Linux IRQ Priority Optimizer (modem speed optimization)
- Free-Nets & Community Networks
- TheList.com - Comprehensive list of ISP's
Man pages:
- pppd - Point-to-Point Protocol Daemon
- chat - Automated conversational script with a modem
- resolv.conf - network name resolver configuration file (system access to DNS)
- nsswitch.conf - System Databases and Name Service Switch configuration file
- sudo - execute a command as another user (including root)
- nohup - run a command immune to hangups, with output to a non-tty
- killall - kill processes by process name
Modems for use with the Linux serial port, PPP and your phone line. Digital cable modems and DSL typically use traditional ethernet connections through a network card (NIC).
- Modem Init strings
- YoLinux Hardware page - Modems
- Modem diagnostic Tool
- linmodems.org
- Linux PPP HOWTO - Robert Hart
- ISP-Hookup-HOWTO - Egil Kvaleberg
- Linux Modem HOWTO - David S.Lawyer
- Linux Serial HOWTO - David S.Lawyer, Greg Hankins
- qpage - Applications to send message to qpage server which dials pager and sends text message..
The diald daemon is used to automatically dial out when a network request is made.
- Diald home page
- DialMon - The Linux DialD monitor