Networking and ISP Setup with RedHat Linux


  PPP dial-in and dial-out server configuration


 ISP Connectivity

ISP connectivity is one type of serial connection. TCP/IP runs over a wide varity of physical media. The media can be Ethernet cables, as in your local Ethernet, or telephone circuits as in a wide area network.
All most all data communications takes place via serial interfaces. A serial interface is just an interface that sends data as a series of bits over a single wire, it is just opposite of parallel interface that sends data bits in over several wires simultaneously.
In TCP/IP world, dial-up serial connections are popular due to low cost. TCP /IP supports two types of serial line protocol : (1)Serial Lne Interface Protociol (SLIP) and (2)Point-to-Point Protocol(PPP).

(1)SLIP: This protocol has some deficiencies, which fall into two categories:

  1. The SLIP protocol does not define any link control information that could be used to dynamically control the characteristics of a connection. Therefore, SLIP systems must assume certain link characteristics. Because of this limition, SLIp can only be used when both hosts know each other’s address, and only when IP diagrams are being transmitted.
  2. SLIP does not compensate for noisy, low-speed telephone lines. The protocol does not provide any error correction or data compression. The most important is, there is no security policy for SLIP connection.

PPP has over come the weakness of SLIP with a three-layered protocol:

  1. Data Link Layer Protocol(DLLP): The data Link Layer Protocol used by PPP is a slightly modified version of High Level Data Link Control Protocol (HDLC).  PPP modofies Protocol field that allows PPP to pass traffic for multiple Network Layer protocols. HDLC is an international standard protocol for reliably sending data over syschronous , serial communication lines. PPP can guarantee reliable delivery over any type of serial line.

  1. Link Control Protocol(LCP): The Link Contro Protocol provides control for the serial link. It is used to estabklish the connection, negotiate configuration parameters, check link quality,a nd close the connection. LCP was developed specially for PPP

  1. Network Control Protocol(NCP): The Network Control Protocols are individual protocols that provide configuration and control information for the Network Layer Protocols. NCP is also called Internet Control Protocol(IPCP)

Choosing Serial Line Protocol:
PPP is the best TCP/IP serial protocol. PPP is preferred because it is an Internet Standard, which ensures interoperability between systems from wide variety of vendors. It has more feature than SLIP and robust.
PPP is the best choice as non-proprietary protocol for connecting routers over serial lines and for connecting in remote computers via dial-up lines.

PPP Connection:
Point –to-Point Protocol is implemented on the Linux system using the program PPP daemon (pppd). PPP can be configured as a PPP client and as a PPP server over dial-up connection and over dedicated connections.

Dedicated Leased Connection : A dedicated connection is a direct cable connection or a leased telephone; neither of which need to have a telephone call placed to establish the connection.

Dial-up Connection: A dial-up connection is a modem link is established by dialing a telephone number.


Step by Step Dial-up PPP Connection:

PPP connection between Your Side and ISP Side

Your Side:
Requirements:
    1. Linux PC
    2. Modem
    3. Telephone Line


Modem Can be Internal or External

Internal Modem Installation:
Normal PC comes with two serial or communication ports i.e. COM1 and COM2. Internal modem comes with a COM port that is to be fixed by setting jumper before installing with PC. Also IRQ is fixed by setting jumper. So it is better to select the COM port COM3 for Internal Modem.

Communication or serial ports in Linux and  Windows

DOS/Windows                              Linux

COM1                                            ttyS0
COM2                                            ttyS1
COM3                                            ttyS2
COM4                                            ttyS3

External Modem Installation:
Following are the tools for installing and testing modem connection

  1. minicom  à text mode
  2. modemtool -à graphics mode


Now We shall use minicom  for setting up modem ports and testing dialing out.

Use the following command:
# minicom –s (for setting modem port like ttyS0 for COM1)
# minicom –m (for modem dialing)

PPP interface configuration tools (Connectivity with ISP server)
  1. wvdial -à text mode
  2. rp3 à graphics mode
  3. manual scripting

  1. wvdial
Issue the command
# /usr/bin/wvdialconf create or wvdialconf wvdial.conf

This wvdial.conf file contains modem initializing string, phone number , User account name and Password.
Now  edit /etc/wvdial.conf file and save it.
Finally issue the command
# /usr/bin/wvdial
And in another terminal see the progress by issuing the command
# tail –f /var/log/messages

From the log
For ppp0 interface
Local IP: Remote IP
Example : Local IP 192.168.1
                        Remote IP 192.168.1.2 (May be this the eth0 of ISP’s dial-in server)

  1. rp3
Run startx&
Open a terminal
And use the following command
# /usr/bin/rp3-config
Follow the screen and finally issue the command
# /usr/bin/rp3
This also works with the config file wvdial.conf
  1. Manual Scripting

# cd /etc/ppp
    1. vi chat-isp
ABORT "NO CARRIER"
            ABORT "NO DIALTONE"
            ABORT "ERROR"
            ABORT "NO ANSWER"
            ABORT "BUSY"
            ABORT "Username/Password Incorrect"
            "" "at"
            OK "atdt9,8823949"
            "ogin:" "pppin"
            "ord:" "pppin"

b. vi pppdialout
#!/bin/sh
/usr/sbin/pppd  /dev/ttyS0 38400 connect "chat -v -f /etc/ppp/chat-isp"\
            crtscts modem defaultroute


ISP Side
  1. Your account and password
  2. Telephone number of your ISP, which you be dialed into their server.
  3. DNS server’s IP address


Dial-out PPP server Configuration by Scripting


  1. /etc/chat-isp
‘’ ATZ
OK ATDT8823949
CONNECT \d\d\r
ogin: username   ; (e.g. pppin)
word: userpassword ; (e.g. pppin)

chat-isp is a “expect/send” pair style file
In line# 3 \d is 1-second delay \r is enter key

  1. /etc/ppp/peers/pppdialout

ttyS0 38400 crtscts
connect “chat –v –f /etc/ppp/chat-isp”
noauth
persist
defaultroute
proxyarp
hide-passwd


Keywords :
Noauth :- No authentication like PAP and CHAP is not required.
persist :– To reconnect ppp connection if it is disconnected.
Defaultroute: - The default gateway will be the IP of remote host of remotely provided IP from the server.
Proxyarp :- Routing table of the ISP machine will be the same for Remote Client
hide-passwd :- This will hide the passwd when ppp connection will be made.


pppd in command mode:

pppd  device  options

Example:
pppd /dev/ttS0 38400 connect “chat –v –f /etc/ppp/chat-file”  crtscts modem defaultroute 192.168.0.2
Here this IP is the IP for point-to-point link from the remote server.

  1. Put this in /etc/rc.d/rc.local
/usr/sbin/pppd call pppdialout

Dialin Server Configuration


1.       Install modem in any port like ttyS0,ttyS1
2.       vi  /etc/inittab
S0:2345:/respawn:/sbin/mgetty ttyS0 –D /dev/ttyS2

Here The option “-D” tells mgetty to expect data , no faxes. After bring any changes you must have to restart mgetty by using the command #init q to reread inittab file. Or # kill –1 1.

3.       Change the mod of pppd as other user can run without being root. Because root only can run this program.
Issue the command
# chmod u+s  pppd

4.       Create PPP account or shell account
Example:
ppp account
pppin:x:351:230:ppp dialup account:/home/pppin:/usr/sbin/pppd

shell account
pppin:x:351:230:ppp dialup account:/home/pppin:/bin/bash

For shell account, to run pppd automatically add the foolwoing lines in /etc/bashrc

Alias ppp=”exec /usr/sbin/pppd –detach”
In this way the user can run pppd by typing ppp.

/etc/ppp/options file
Options means optional files.
System default options for pppd, read before user default options or command line options.

~/.ppprc
User default options, read before command line options.

/etc/ppp/options.ttyS0 or ttyS1

System default options for the serial port being used , read after command line options.

So the order of what is looked at is:

/etc/ppp/options, ~/.ppprc , command line  and then /etc/ppp/options.ttyS0,S1

Example of options.ttyS0


Local-IP:Remote-IP

192.168.0.1:192.168.0.2

/etc/ppp/options.ttyC1
192.168.1.1: 192.168.1.2
require-pap
refuse-chap
Now see /etc/ppp/pap-secrets file for pap authentication
#/etc/ppp/pap-secrets
#              client                      server                     secret                                                      IP-Adress
                pppin                      * or ppp0               pppin (user’s password)      192.168.1.2 (if necessary)

or Simply

/etc/ppp/options.ttyC1
: 192.168.1.2
This is the Local IP of for client’s ppp interface

Example of   ~/.ppprc

-detach
modem
crtscts
lock
proxyarp
192.168.0.1:192.168.0.2


Comments

Popular posts from this blog

English to Bengali Names of Vegetables, Legumes and Spices

How To Remove Powered By Blogger From Blogger

Advantages of Rapid Application Development