|
Related YoLinux Tutorials:
°Linux Networking
°Securing Linux
°Internet Gateway
°YoLinux Tutorials Index
Free Information Technology Magazines and Document Downloads
|
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.
| 1) Command line ppp and Manual configuration: |
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:
/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
|
/etc/nsswitch - Change: (older systems use hosts.conf)
Change from:
-
.. ...
hosts: files nisplus nis dns
... ..
|
To:
-
.. ...
hosts: files dns nisplus nis
... ..
|
/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.
/etc/ppp/chat-isp - File should look like this:
-
ABORT 'BUSY' 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
Test connection with command /sbin/ifconfig and look for device ppp0.
This will display the IP address and node name assigned by your ISP for this
connection.
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.XXX
Where 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.
- Use "set-uid" root privilege "sticky bit"
- Use the sudo facility.
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.
Add a Gnome icon to the desktop to launch PPP:
Right button click on the open desktop + New + Launcher:
- Name: PPP
- Command:
- /usr/sbin/pppd
OR:
- nohup sudo /usr/sbin/pppd
- Type: Application
- select "Run in Terminal"
- Click the icon to select and display an icon.
To terminate pppd, issue the command: killall pppd
| 2)Using the LinuxConf configuration tool: |
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
You can also verify other Tab option "Communication".
Then select "Done".
- Select "Config" + Networking" + "Client Tasks" + "Name server specification (DNS)"
- List the IP addresses of the DNS name servers as provided by your ISP
This edits the /etc/resolv.conf file.
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.
| 3)Using the Gnome control panel configuration tool: |
 |
- 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.
- 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
You can also verify other Tab option "Communication".
Then select "Done".
- New dialog box asks "Save current configuration?" Save/Concel: "Save"
The console commands:
- Start ppp connection to internet: /sbin/ifup ppp0
- Terminate ppp connection to internet: /sbin/ifdown ppp0
These commands can be added as a Gnome desktop launcher or by a toolbar applet.
|
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:
- /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
|
- /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
| 4) wvdial and Redhat "Dialup configuration tool": |
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".
If you are not root it will display a dialog box which prompts for the root
password. It will lead you through a series of simple questions such as
the account name (give name of ISP), the phone number to your ISP, login name
and password.
The first time this is launched it will probe for your modem.
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:
- /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
|
- /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
- /etc/ppp/peers/ppp0
-
connect "/usr/bin/wvdial --remotename ppp0 --chat script-name
|
- /etc/ppp/pap-secrets
Contains login and password information.
| 4) GUI dial program X-isp. Download/Installation/Configuration: |
Home page: Xisp
Requires pppd (v2.2.0 or better, X11R6, XPM library (libXpm >= v3.4f) and XFroms.
X-Forms:
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) #endif
|
TO:
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:
make
As 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.UserName
Xisp will start the process:
/usr/sbin/pppd 38400 call xisp_ttyS1 bsdcomp 0.0 noipdefault modem lock mru 1500
and
/usr/sbin/chat -V -f /root/.xispscript
The 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.
| Pitfalls and Troubleshooting: |
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 MODLOAD
The default Red Hat 7.1 install uses "module autoloading":
LOOKUP .* MODLOAD
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).
The diald daemon is used to automatically dial out when a network request is made.
Linux Books: |
-
 |
"Ubuntu Unleashed 2011 edition:"
Covering 10.10 and 11.04 (6th Edition)
by Matthew Helmke, Ryan Troy, Andrew Hudson and Paul Hudson
Surfing Turtle Press, ISBN# 0672333449
(Dec 24, 2010)
|
|
 |
"Fedora 14 Desktop Handbook"
by Richard Petersen
Surfing Turtle Press, ISBN# 1936280167
(Nov 30, 2010)
|
|
 |
"Fedora 14 Administration and Security"
by Richard Petersen
Surfing Turtle Press, ISBN# 1936280221
(Jan 6, 2011)
|
|
 |
"Fedora 14 Networking and Servers"
by Richard Petersen
Surfing Turtle Press, ISBN# 1936280191
(Dec 26, 2010)
|
|
 |
"Practical Guide to Ubuntu Linux (Versions 8.10 and 8.04)"
by Mark Sobell
Prentice Hall PTR, ISBN# 0137003889
2 edition (January 9, 2009)
|
|
 |
"Fedora 10 and Red Hat Enterprise Linux Bible"
by Christopher Negus
Wiley, ISBN# 0470413395
|
|
 |
"Red Hat Fedora 6 and Enterprise Linux Bible"
by Christopher Negus
Sams, ISBN# 047008278X
|
|
 |
"Fedora 7 & Red Hat Enterprise Linux: The Complete Reference"
by Richard Petersen
Sams, ISBN# 0071486429
|
|
 |
"Red Hat Fedora Core 6 Unleashed"
by Paul Hudson, Andrew Hudson
Sams, ISBN# 0672329298
|
|
 |
"Red Hat Linux Fedora 3 Unleashed"
by Bill Ball, Hoyt Duff
Sams, ISBN# 0672327082
|
|
 |
"Red Hat Linux 9 Unleashed"
by Bill Ball, Hoyt Duff
Sams, ISBN# 0672325888
I have the Red Hat 6 version and I have found it to be very helpful.
I have found it to be way more complete than the other Linux books.
It is the most complete general Linux book in publication. While other
books in the "Unleashed" series have dissapointed me, this book
is the best out there.
|
|
 |
"Redhat Linux 9 (Visual QuickPro Guide)"
by Harold Davis
ISBN #032121918X, Peachpit Press, Addison Wesley
The best basic Linux book around for the GUI generation.
This book can be best described as a guide to using the GUI
configuration tools.
|
|
|
|