UnixWare PPP usage and configuration

PPP (Point to Point Protocol) was developed to allow TCP/IP to be
transported  over  serial  lines.   Setting  up  and using PPP on
UnixWare, as well as known problems and solutions are outlined in
this document.

This document will describe typical configuration steps through
the pppsetup utility.

PPP (Point to Point Protocol) was developed to allow TCP/IP to be
transported over serial lines.

To fully understand all needed components of PPP, we  must  first
understand  the Basic UNIX System NetWorking (BNU) functionality.
PPP uses the BNU facilities to make the initial connection to the
host.  Once a connection has been established, PPP takes over the
serial interface.

CONFIGURATION 
-----------------------------------------

Configuration Example:

fred 
----- 
The name of the REMOTE (answering, incoming, or  host) machine.

wilma
----- 
The name of the LOCAL (calling, outgoing, or  client)
machine.

Name    IPAddress       Phone Number    PPPLogin/password 
------- ---------       ------------    -----------------
fred    199.60.6.6      555-1212        ppplogin / abc
wilma   199.70.7.7      n/a             n/a / n/a

Both fred and wilma are using tty01 (COM2) as their serial ports.

Configuring "fred", the REMOTE (answering or incoming system)

1 -     Program the modem by doing the following.

        stty -parenb cs8 9600         cu -l tty01h

You should get a "Connect" message.

The following are modem commands that set certain attributes on
hayes compatible modems.   After you type ATQ1, you will no longer
see 'OK', this behavior is normal.  Consult your modem manual for
specific commands for your modem.

        ATS0=1
        ATS15=130
        ATS20=7 
        ATQ1
        AT&W         ~.<Return>

3 - Create a ttymon process which sends a login to incoming
callers.  You will need to use Dail-up setup under Admin-Tools -->
Networking to add a port monitor.  First create a device for the
port which is connected to your modem.  Make this device either
incoming or bidirectional.

4 - After adding the port monitor you will want to make the
incoming speed static.

        vi /etc/saf/ttymon1/_pmtab

        Find the line that defines /dev/tty01 or /dev/tty00.
Replace the word "auto" with "9600NP".

Be sure there is only one line defining /dev/tty01 in this  file;
if there are more, remove them.

Restart the port monitor using pppsetup.

        Choose General-->Reset Port Monitor

4 -     Configure PPP using pppsetup

Choose Actions --> Add Interface 

You now enter the IP address for this machine."fred"
        199.60.6.6

You now enter the IP address for the other machine. "wilma"
        199.70.7.7

Note: For either machine, you may use  the  IP  address  that  is
currently  being used by normal TCP/IP on that machine.  A unique
IP address for PPP is not necessary.

You can now choose to make the interface Outgoing or Incoming.  The
interface is automatically incoming when a ppplogin account has
been defined.

You now choose "Save/Close" to save this PPP interface.


You will now need to add a PPP login account for the remote system
to use to log in to your system.

Choose Actions --> Add PPP Login

Enter the ppplogin name that will be used by wilma to startup
PPP. "ppplogin"

Note: Use all lowercase characters for the ppplogin name

Enter the password for the ppplogin account. "abc"

Select "Save/Close" to enable this PPP login user.

5 - You will need to restart TCP/IP.  To restart TCP/IP do the
following:

        Choose General --> Reset TCP/IP

TCP/IP will automatically get reset when you choose to exit
pppsetup.

=================================================================

Configuring "wilma"  the  LOCAL  system   (outgoing,  or  calling
system)

1. Add an entry to the bottom of your /etc/uucp/Devices file.  This
entry will be used to program your modem.

      Direct  tty01h,M  - 9600NP direct_modem

Be sure you have no other entries in this file relating to tty01.

2 -     Program the modem by doing the following.

        stty -parenb cs8 9600         cu -l tty01h

You should get a "Connect"  message.   The  following  are  modem
commands that set certain attributes on a hayes compatible modem. 
Consult your modem manual for modem commands specific to your
modem.

        ATS0=1
        ATS15=130
        ATS20=7
        ATQ0
        AT&W
        ~.<Return>


3 - Configure PPP through pppsetup

You now enter the IP address for this machine. "wilma"
        199.70.7.7

You now enter the IP address for the other machine. "fred"
        199.60.6.6

Note: For either machine, you may use the IP address that is
currently  being used by normal TCP/IP on that machine.  A unique
IP address for PPP is not necessary.

You now select the "Enable Outgoing" box.

It now asks for the UUCP name used to dial this system.  This is
the name you included in the /etc/uucp/Systems file. "fred"

You next enter the remote phone number of the sytem you wish to
call.     "5551212"

You now enter the remote PPP login user ID.  "ppplogin"

You now enter the remote password for the remote PPP login user.
"abc"

You now enter the port device you will be using to connect to your
modem.  Usually this will be tty00h or tty01h for COM1 and COM2
respectively.  You should always use the hardware device denoted by
"h" instead of the software device.

You now have the option of selecting the "Advanced" button.

The default login sequence is used to login to another UnixWare
machine to initiate ppp.  The default "opyrigh" expect string is
used to tell the calling machine when to start negotiating PPP.
While "Copyright" is a text string found on UnixWare systems, it
may not be present on other PPP hosts.  To determine what text
string your PPP host returns before negoitating PPP, try dialing
into the sytem manually.  In some situations, this final expect
string may not be needed at all. Select "help" under the Advanced
screen for more information specific to that screen.

4 - You will now need to restart TCP/IP.  To restart TCP/IP do the
following:

        Choose General --> Reset TCP/IP

TCP/IP will automatically get reset when you exit pppsetup.

Following the configuration of the two machines, you are ready to
test the PPP interface.

USAGE 
------------------------------------------

* Establishing a PPP connection from 'fred' to 'wilma':

To establish a PPP connection to a remote host, simply ping the
host.

        General-->Connect-->Select the remote host-->Ping(Ping -s)

The modem should dial fred, and after a few seconds,  you  should
see that fred has answered the ping.

You will  now  be  able  to  use  any  other  TCP/IP  utility  to
communicate with fred, ie. telnet, ftp, etc.

If problems  occur, consult the TESTING AND TROUBLESHOOTING
portion of the document.

* Bringing down the PPP connection:

Once the ppp connection has been established, the default is for
the connection to stay up forever, regardless of the idle time.
To manually bring down the ppp connection do:

        Select Interface-->Configure-->Down Interface

Once this is done, the command:

        General-->Show Interfaces

will show that the interface will not be marked 'up'.  Before  ppp
can be used again, you must mark the interface 'up' again by
doing:

        Select Interface-->Configure-->Up Interface

Each interface can include a idle timeout parameter.   If an idle
timeout is desired, Double click on the interface in question and
go into the Advanced section and choose "Idle".

ROUTING 
------------------------------------------
To  configure UnixWare  PPP  to route IP packets from an ethernet
or token ring interface, to the PPP interface and vice versa, do
the following:

1  -  Setup IP forwarding using the System Tuner under Admin-Tools.
Choose the Networking area, Make IPFORWARDING become 1 instead of
0.  You may need to reboot the system to make this change
effective.
     
2 - The system will now  be  able  to  route  packets.   However,
depending on your configuration, the UnixWare machine may need to
have an entry added to it's routing table by  using  the  'route'
command.  This is explained below.

In the example used above, wilma is connecting with fred via ppp.

Configuration examples

Example 1 - If both wilma and fred have ethernet  or  token  ring
cards  in  their  machines  as well, and need traffic routed from
those interfaces to the ppp interface, you would have to  do  the
following:

on fred: route add default wilma 1 on wilma: 
        route add default fred 1

Also, all clients on fred's side, would have to have fred
designated as their router - the same applies to clients on wilma's 
side. This is usually done by default, but if the routing does
not work, it gives you a place to start.

Sometimes it may be necessary to add yourself to your routing
tables. First remove all existing default routes.  Type 'netstat -
r' to see what default routes you may already have, use 'route
delete (remote system name)'to delete.  Then type 'route add
default (your sytem name) 0'.  If you still can't route beyound
your host, try adding your host as another default router but with
1 hop. 'route add default (remote system name) 1'.

Example 2 - If only one system, fred, has an  ethernet  or  token
ring card that requires routing to be done, do the following:

        on wilma: route add default fred 1

        For clients on  fred's  network, the same rule applies  as 
described in Example 1 for client routing tables.

Example 3 - If only wilma has clients on her network, simply  use
the opposite as example 2 above.

Special routing note:  In order for TCP/IP routing to  work,  the
network  addresses  for  the two networks you are connecting must
specify different networks.  In  our  example  above,  fred's  ip
address is 199.60.6.6 with a class b netmask.  wilma's ip address
is 199.70.7.7 also with a class b  netmask.   These  two  network
addresses  are different; 199.60 and 199.70, so routing will work
OK.

If the two networks are the same, ie. 199.60.6.6  and  199.60.7.7
with  a class b netmask, the network portion is the same; 199.60,
you will need to do the following on the PPP host.

Type 'cat /etc/inet/macaddr' record your network card's mac
address.  Use the macaddress for the network card not the one
assigned to the ppp interface.  Next type the following 'arp -s
199.60.7.7 macaddr pub' each section of the macaddress should be
delimited by a colon ':' not a period.

MULTIPLE  PPP INTERFACES

* Make sure you are using the VJ and ipaddr ppp negotiation
parameters.

* One other item  to  keep  in  mind  when  setting  up  multiple
interfaces.   It is important to assure that the routing table is
setup properly.  First, look at the table of interfaces:

        ifconfig -a

This displays the ip addresses of both the local and remote sides
of  the  interface,  as  well as the interface number, ppp0, ppp1
etc.

The routing table must agree with this information.  To view  the
routing table do:

        netstat -r

If the routing table does not display the same  interface  number
for the pair of local and remote addresses, then one of two
things must be done:

        1 - Reboot the system to reset the routing table.

        or

        2 - Remove all ppp interfaces from the table and restart
            TCP/IP.
               a - route delete <destination> <gateway> for each
                   ppp interface.
               b - follow the RESTARTING TCP/IP section below.

TESTING AND TROUBLESHOOTING
------------------------------------------
Troubleshooting  and Known Problems

BASIC SERIAL COMMUNCATION  *  A  document  is  available  on  the
UnixWare  Faxback  system,  or  from the NSE to help troubleshoot
serial  problems.   It  is  entitled  "Serial  Communications  on
UnixWare".  Obtain this document if you are not able to get basic
serial communications working, ie. communication with the  modem,
etc.

* One problem we have seen is if you have a port monitor  running
on a port, as 'fred' does to issue a login prompt.  Sometimes you
cannot communicate directly with the modem;  ie.  cu  -l  tty01h.
The  message: DEVICE FAILED or DEVICE NOT AVAILABLE is displayed.
To get around this, you must disable the  ttymon  service  before
the cu -l command will work:

        pmadm -d -p ttymon1 -s 01h

(The service '01h' may differ depending  on  the  port  your  are
using.   Do a pmadm -l to see the service tag for your particular
port.)  After the '-d' (disable) has been done,  'cu  -l  tty01h'
will  work.  When you are done, you must enable the service again
for the login prompt to be issued again to imcoming callers.

        pmadm -e -p ttymon1 -s 01h

* You were once able to 'cu' into the host and get a  login,  but
now no login prompt is given.  This is caused by the host machine
still having the ppp link semi-active on the port.  Do the
following:

        ps -ef | grep ppp

Look for the ppp 'shell', shown as "-ppp" running on the port you
are attempting to dial into.  If the shell is still active on the
port, simply kill the process.  This will free the  port so the
tty monitor can issue a login prompt once again.

PING WILL NOT DIAL THE REMOTE  MACHINE  *  If  you  are  able  to
communicate  with  your  modem directly as outlined in the Serial
Communcations document mentioned  above,  the  next  step  is  to
attempt  access to the remote System via cu (call unix).  cu uses
the same files to dial the remote system as PPP does.  The syntax
is simply:

        cu systemname

where 'systemname' is the  name  of  the  remote  system  in  the
/etc/uucp/Systems  file.  When you run cu, UnixWare will dial the
remote system and you will see a login  prompt.   To  exit  type:
~.<Enter>   If  cu  does  not  work,  see  the  section  entitled
CONNECTION SERVER later in this document.

* If cu works, yet ping will still not dial  the  remote  machine
the  ppp demon could be hung.  Try restarting TCP/IP discussed in
the RESTARTING TCP/IP section.

* Check to make sure the 'in.pppd' deamon(s) are running. Do this
by running: ps -ef | grep pppd If in.pppd is not running, your
/etc/hosts file may be setup incorrectly.  In the /etc/hosts file, 
the first uncommented line must be: 

127.0.0.1 localhost 

If this line does not exist  in /etc/hosts, the in.pppd deamon will 
not start.  You need to correct the /etc/hosts file, then restart
TCP/IP or reboot.

* Down the interface and bring it back up  again.   For  example:

        ifconfig ppp0 down
        ifconfig ppp0 up

* Improper configuration could also inhibit 'ping' from  dialing.
To  assure  the  configuration  is  setup  properly,  consult the
section called CONFIGURATION FILES later in this document

PING DIALS THE REMOTE HOST, THEN HANGS UP  *  This  problem  will
occur if one of you, but not both has been setup for PAP (Peer
Authentication Protocol).   The pppconf program does this
automatically for you if you chose to modify the negotiation
parameters during configuration.  To check this do:

        vi /etc/inet/ppphosts

Be sure the option:

        paptmout=n

is not in your configuration line.   Remove it if it is.   Be
careful to leave only one space between all fields in this line.

This problem has also been seen when there is no final expect
string or the expect string in incorrect.  The final expect string
is set under the Advanced window in pppsetup.

* You may want to see if ping can properly login to the remote
system as the ppplogin user.  Do this by following the steps in
the CONNECTION SERVER section.

* If the remote host is a UnixWare machine, the login name MUST
be in all lowercase characters.  In the example above, the login
name is: ppplogin.

THE PPP CONNECTION IS SLOW,  OR  HANGS  *  In  the  configuration
example  above,  we  used  the  port /dev/tty01h.  The 'h' is for
hardware flow control and should be used to avoid flow problems.

* Speeds above 9600 baud cause problems on normal serial ports.
Try 9600 baud if you are having problems.

* If speed or flow control is an issue, try using a third party
multi-port  serial device.  The problem with using these devices,
is the utility mentioned above in setting up the HOST system,
'/usr/X/adm/addttymon' does not work with these device names.
Obtain the faxback or NSE document regarding multi-port serial
adapters for a workaround to this problem.

PING WILL NOT DIAL IMMEDIATELY, BUT WILL EVENTUALLY *  One cause
of this problem has been  the /etc/netconfig file.  Check the
following: vi /etc/netconfig There are four lines that contain the 
libraries: tcpip.so and resolv.so In these lines, the library
"tcpip.so" must come before the "resolv.so" library.  Switch the
order of these libraries if this is not the case.  Restart TCP/IP
after doing so.

* Another cause of this problem that  has  been  encountered  are
extra spaces in  the /etc/resolv.conf file following the domain
name and the nameserver ip address.
