SUMMARY: dynamic PPP / ananlog Line connection

From: Mr.Venkat D (venki21@hotmail.com)
Date: Thu Feb 19 1998 - 08:24:09 CST


hi .

Thanks to all of them who have responded and helped me to solve this
problem.

My original Question was whether i could have a PPP account with the
ISP on the SUN box.

The answer is yes we can have the PPP configuration on Solaris by
dialup line to an ISP.

I first choose ann ISP and tried to get connected but was refused
the login !!!! this made me go crazy and started suspecting the
TElebit 3K modem and went into a loop.

Finally MR.Jim Musso gave me his ISP name and I choose them and
was able to configure the PPP and is working fine.

One thing i noticed was when we do a tip /dev/cua/a and dial the number
we must get a login then only we can go ahead and configure PPP
This is happening with my new ISP but with my old ISP what i got was
junk !!!!! Any one has any ideas on this ?????

Here is some notes on PPP.

PPP comes already installed on Solaris based systems if you choose
a full install.

Packages required for PPP:

        SUNWpppk
        SUNWapppu
        SUNWapppr
        SUNWbnur
        SUNWbnuu
        
        
Files and Daemons:
------------------

        /usr/sbin/aspppd -> ppp daemon that reads the configuration
file
                                asppp.cf. start it with the command:

                                /etc/init.d/asppp <start|stop>

        aspppls -> The shell used with ppp accounts.

        /tmp/.aspppfifo -> Temp info from aspppd stored here. If
corrupt
                                then remove file and restart aspppd to
recreate.

        /etc/asppp.cf -> PPP configuration file used by both
server and
client

        /dev/ipdptp* -> Devices used for virtual connections
when
client
                                connects to server

        /etc/log/asppp.log -> Monitors aspppd daemon activity. BEST
debugging
                                tool is to run: tail -f /etc/asppp.log.
This
                                will allow you to do interactive visual
logging!

        /etc/uucp/Systems -> Used to establish the dialup connection
to
server

        /etc/uucp/Devices -> Used by Systems to choose the device.

                               
        /etc/uucp/Dialers -> This is your modem specific
                                entry that is referenced from Dialers.

 

First Setup the PPP client system...

     Dynamic Addressed Client
     ------------------------

etc/asppp.cf:
 
ifconfig ipdptp0 plumb <Local-IP> <Remote-IP> up
 
path
       interface ipdptp0
       inactivity_timeout 120
       peer_system_name <Systems-entry> # first field in
/etc/uucp/Systems.
       ipcp_async_map 0 # Better performance.
# debug_level 9 # uncomment for debugging
/etc/log/asppp.log.
       default_route # Calls <Remote-IP> as default
route.
       negotiate_address on # available with 2.5 and above.
comment
                                       # out for static client
configuration

Note for dynamic configuration (when specifying negotiate_address on):
----------------------------------------------------------------------

The client ip address (Local-IP) and server ip address (Remote-IP) are
not that
important because with the negotiate_address on it will get the ip
addresses
from
the server when you make a good connection.

If you absitively, posilutely know what your ip addresses are, you can
forgo
the
negotiate_address "on" line and specify the ip addresses in the ifconfig
line.

The instance where the statement I made above was true, would be in the
circumstance
that you were attempting to connect to a static server.

Please note that if you are attempting to connect to an ISP, then they
will
almost
*always* require that you set the negotiate_address "on".

                                      
                                       
    Dial-out Client UUCP Configuration Files
    ----------------------------------------

Sample /etc/uucp/Systems:

  <ppp-server> Any ACU 9600 5551212 "" P_ZERO "" \c\r ogin: pppuser
ssword:
pppuser

Now, comment out the old entry for hayes and put this entry in the
Dialers
file.
This entry doesn't change any modem registers so it will work no matter
which
brand of modem you are using.

Sample /etc/uucp/Dialers:

        hayes =,-, "" P_ZERO "" \EATDT\T\r\c CONNECT

If you have NO LUCK with the above hayes entry later on when you try to
test
ppp,
then comment it out and try one of these on for size instead:

        hayes =,-, "" P_ZERO "" \EATDT\T\r\c CONNECT
        hayes =,-, "" P_ZERO "" \EATDT\T\r\c CONNECT STTY=-parity
        hayes =,-, "" P_ZERO "" \EATDT\T\r\c CONNECT STTY=crtscts
        hayes =,-, "" P_ZERO "" \EATDT\T\r\c CONNECT
STTY=crtscts,cs8,-parenb
        hayes =,-, "" P_ZERO "" \EATDT\T\r\c CONNECT STTY=cs8,-parenb

If you type them ALL into your Dialers file, you MUST comment out all
but the
ONE you
want to use. If you don't the system will only read the first "hayes"
line in
that
file!!!!!!!

Sample /etc/uucp/Devices:

    Direct cua/a - 9600 direct
    ACU cua/a - Any hayes

    Note: Only the *first* ACU line will be read so comment out extra
lines!

        Setup the PPP Server System...
        ---------------------------

   
a.) All PPP user accounts use the /usr/sbin/aspppls shell.
    To test ppp-accounts, telnet to yourself and login using the
ppp-account
name.

    You should see PPP packets as below...

        ~}#@!}!}!} }?}!}$}%t}"}&} }*} } }'}"}(}"}1}$}%t}3})}#}
@{^CD}61~~}#@!}!}!} }?}!}$}%t}"}&}
        }*} } }'}"}(}"}1}$}%t}3})}#} @{^CD}61~~}#@!}!}!} }?}!}$}%t}"}&} }*} }
}'}"}(}"}1}$}%t}3})}
        #} @{^CD}61

    Wait about 60 seconds and the connection will eventually time out
and give
control
    of the terminal window back to you...

****************************************************************************
*********************** Static PPP Server
**********************************
****************************************************************************

/etc/hosts:
127.0.0.1 localhost
192.9.200.1 myserver loghost
192.9.200.100 ppplink1
192.9.200.101 ppplink2

/etc/asppp.cf:
 
ifconfig ipdptp0 plumb <myserver> <ppplink1> up # modem 1
ifconfig ipdptp1 plumb <myserver> <ppplink2> up # modem 2

defaults
       inactivity_timeout 120 # 2 minutes
       ipcp_async_map 0 # Better performance.
# debug_level 9 # uncomment for debugging
/etc/log/asppp.log

path
        interface ipdptp0 # ppp interface device
        peer_system_name <ppp-account1> # in /etc/passwd, /etc/shadow
                                           # or use Admintool
                         
path
        interface ipdptp1 # ppp interface device
        peer_system_name <ppp-account2> # in /etc/passwd, /etc/shadow
                                           # or use Admintool

************************************************************************
*********************** Dynamic PPP Sever
********************************
***************************************************************************

This will setup a server such that when two people call in, they can
each be
given their own ip address.

The two potential client systems are noted by ppplink1 and ppplink2 in
the
hosts
file and the asppp.cf file.

/etc/hosts:

127.0.0.1 localhost
192.9.200.1 myserver loghost
192.9.200.100 ppplink1
192.9.200.101 ppplink2

/etc/asppp.cf:
 
ifconfig ipdptp0 plumb <myserver> <ppplink1> down # modem 1
ifconfig ipdptp1 plumb <myserver> <ppplink2> down # modem 2

defaults
       interface ipdptp* # ppp interface device
       inactivity_timeout 120 # 2 minutes
       ipcp_async_map 0 # Better performance.
# debug_level 9 # uncomment for debugging
/etc/log/asppp.log

path peer_system_name <ppp-account1> # in /etc/passwd; or Admintool
path peer_system_name <ppp-account2> # in /etc/passwd; or Admintool

Are you unsure of how to setup the serial ports for your modem?

Consult the "How to TIP" info doc for info on setting up your port
to allow modems to dialin to your system succesfully!

        How To Test and Troubleshoot PPP
        --------------------------------

Test UUCP files and chat scripts...
--------------------------------

Verify that at least your chat script is corret enough such that you can
dial
out
from your client and connect to your server.
                     -------

On the client, type:

        cu -d -L pppserver (ok, this is the name (first entry) in your
/etc/uucp/Systems file)

You will see something like this:

conn(pppserver)
Trying entry from '/etc/uucp/Systems' - device type ACU.
Device Type ACU wanted
Trying device entry 'cua/b' from '/etc/uucp/Devices'.
processdev: calling setdevcfg(cu, ACU)
fd_mklock: ok
fixline(6, 38400)
gdial(hayes) called
Trying caller script 'hayes' from '/etc/uucp/Dialers'.
expect: ("")
got it
expect: ("")
got it
sendthem (ECHO CHECK ON
AATTDDTT991122113333330000996644^M^M<NO CR>)
expect: (CONNECT)
^M^JCONNECTgot it
STTY cs8,-parenb
getto ret 6
expect: ("")
got it
expect: ("")
got it
sendthem (^M^M)
expect: (ogin:)
^M^J^M^J^M^JLogin:got it Yes!!! we reached the login
sendthem (loginname^M) and now we send the login (as per the
System
file)
expect: (ssword:) Yes!!! we reached the password prompt
 ^M^JLogin: brian^M^JPassword:got it
sendthem (password^M) and we send the password....
expect: ("")
got it
sendthem (^M^M)
device status for fd=6
F_GETFL=2,iflag=`12045',oflag=`0',cflag=`2275',lflag=`0',line=`0'
cc[0]=`3',[1]=`34',[2]=`177',[3]=`25',[4]=`1',[5]=`0',[6]=`0',[7]=`0',
call _mode(1)
Connected
_receive started
  
transmit started
~}#@!}!}!} }?}!}$}%t}"}&} }*} } }'}"}(}"}1}$}%t}3})}#}
@{^CD}61~~}#@!}!}!}
}?}!}$}%t}"}&}
}*} } }'}"}(}"}1}$}%t}3})}#} @{^CD}61~~}#@!}!}!} }?}!}$}%t}"}&} }*} }
}'}"}(}"}1}$}%t}3})}
#} @{^CD}61

The strange characters you see above are PPP characters. If you see
this, then
we are ready to try PPP for real!

Now it's time to test the PPP side of the world....
-----------------------------------------------

a.) Troubleshooting:

       Open a window just for the log file and type in it:

       tail -f /etc/log/asppp.log
     

b.) The PPP daemon MUST be stopped, and restarted after every
modification
     of the /etc/asppp.cf file:

    /etc/init.d/asppp stop
    /etc/init.d/asppp start

    If your asppp.cf file is set up correctly your should see this in
your
    asppp.log file.

    09:20:17 Link manager (8505) started 07/17/97
    09:20:17 parse_config_file: Successful configuration

    If it doesn't say successful configuration you have a problem with
your
    asppp.cf file.

c.) Try to ping the server from the client...

    # ping 2.2.2.2 100 (the 100 says to not time out the ping
command for
100 seconds)

    If you don't add the 100 to the ping line, then ping will DEFINATELY
time
out
    before the connection is completed. Don't worry, you can just type
ping
again and
    it will pick up where it left off. Remember to keep that watchful
eye on
the
    log file (from step a).

    Anyway, the action of pinging should start the connection to the
server,
dial the
    number get logged in and start transfering PPP packets back and
forth.

    Watch your log file as noted in step (A). You should see the same
    info as when you did the cu command...

    When you see the ppp packets being tranfered back and forth
    you can verify your connection with the ifconfig command.

   # ifconfig -a

   ipdptp0: flags=8d0<POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
           inet 200.125.50.10 --> 200.125.50.10 netmask ffff0000
           ether 0:0:0:0:0:0

   This shows the connection for your ipdptp0 interface.
   The first ipaddress is your new ip address and the second ipaddress
is the
ip
address
   of the system you are connected to.

   Oh, yes, by the way, your ping should also have come back with an
"alive"
message...

   **** Other Neat Stuff to worry about... ****

d.)

>>> To prevent a PPP client from dialing at bootup, or automatically,
    turn off RIP:
    
    With 2.5/2.5.1 make the file /etc/gateways and add the entry
    
            norip ipdptpn (where n is the number of the interface)
    

>>> To make sure your system doesn't act as a router on another network
create
a
file
    /etc/notrouter.

       # touch /etc/notrouter

>>> The following files are for name resolution after you get connected
to the
isp.
    This allows you to talk to the rest of the world. The ip address of
the
nameserver
    needs to be supplied by the isp.

      /etc/resolv.conf:

         domain abc.com ---- domain name for isp
         nameserver 192.0.0.2 ---- ip address of the dns server for
the
isp
   
   

      /etc/nsswitch.conf ----- set the hosts line for files dns

         hosts: files dns

e.) To allow a PPP client to talk to other systems on the Servers
network
    add the following:
    
 Create an executable file called /etc/rc2.d/S99proxyarp. This should
 have an arp entry for each of your PPP clients, listing your server's
 ethernet address (ppplink1, ppplink2 are IP addresses for the PPP
clients):

        ndd -set /dev/ip ip_forwarding 1
        arp -s <ppplink1> 8:0:20:1:2:3 pub
        arp -s <ppplink2> 8:0:20:1:2:3 pub
        
        
        Make it executable, and run it:

        # chmod +x /etc/rc2.d/S99proxyarp
        # ./etc/rc2.d/S99proxyarp

Thanks to all of you for your help ..

CHEERS ..

VENKAT

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:31 CDT