Linux Tutorial - Using PPP


Dialing the ISP:
Four methods are presented here:

1. Command line PPP and Manual configuration: - Works with any Linux distribution.
* Configuration for generic ISP
* Old legacy Compuserve "Classic"
* Connecting to AOL
2. Using the Linuxconf configuration tool (For Red Hat compatible distributions) - Configures the scripts ifup/ifdown to start and stop a PPP connection - Does the same thing as Gnome control panel
3. Using the Gnome control panel configuration tool - Configures the scripts ifup/ifdown to start and stop a PPP connection - My favorite for Redhat 6.2 and Gnome
4. WVDIAL and the Redhat "Dialup configuration tool"
5. GUI dial program X-isp. Download/Installation/Configuration

General PPP Info:
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

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 the 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 (NOT XXX...)
CONNECT "" and modem settings specified by your modem manual (ATDT as a minimum)
ogin: login_id
sword: your_password

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
1. Login as a user.
2. In a command shell, su (to switch user to root) and login as root.
3. 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:

1. pppd searches the /etc/ppp/options file
2. ppp will use the chat-isp script which is input to the chat program which invokes the dialog with your modem.
3. 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.
4. 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.

1. Use "set-uid" root privilege "sticky bit"
2. Use the sudo facility.

Command preparation:

1. 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

2. 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

The RPM package sudo must be installed. [Download sudo rpm] - Base Red Hat 7.X install

Add a Gnome icon to the desktop to launch PPP:

Right button click on the open desktop + New + Launcher:

* Name: PPP
* Command:
1. /usr/sbin/pppd
OR:
2. 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"
o Select "Add"
+ Select type of interface: PPP
+ Then select Accept.
o 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)"
o List the IP addresses of the DNS name servers as provided by your ISP
This edits the /etc/resolv.conf file.

0 comments:

Post a Comment

 

NBA Live Streaming. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com | Distributed by Blogger Templates Blog