PPP on Sun3

Contents

  1. Introduction
  2. What is needed
  3. Installation
  4. Use it
  5. Hints

Introduction

PPP is an extension to the well known TCP/IP protocol suite. It allows TCP/IP connections over a serial modem line. This document describes, how to make PPP work on a Sun3. With PPP installed, you can connect your Sun with a hayes compatible modem to an Internet service provider.

What is needed

The version of PPP i use (ppp-2.1.2b) is somewhat old, but it works smoothly and installs easily on Sun3. Additionally, you should install some other software too: cslip-2.7, the tty jumbo patch and the hardware handshake patch. While ppp-2.1.2b and cslip-2.7 can be found on many anonymous ftp servers, sun patches are rare indeed.

The tty jumbo patch is 100513-04 and can be found on the Sun3/3x-Archive.

The Sun-Patches directory contains all Sun3 relevant patches from Sun. If you're regulary using SunOS 4.1.1, you should apply a couple of them to fix some bugs and close some security gaps.

The hardware handshake patch can be found on the Sun3/3x-Archive too.

There are some more Misc-Patches on the Sun3/3x-Archive, which are very helpfull. I regulary use the hsfs, st, tty and ufs patch and enjoy them very much.

Ok, you should have:

Installation

All of the four packages require building a new kernel. To be sure everything works, you can do it step by step and test each new kernel. If you're crazy, you can wait until the last step to build the kernel ;-)

First, install the patch 100513-04. It replaces the kernel modules mcp_async.o, mti.o, zs_async.o, cons.o, tty_ldterm.o and tty_pty.o. Follow the instructions in the README. You do not have to build a new kernel (yet).

Second, install the tty.hwh.patch. This is even easier than the patch before, because it replaces only zs_async.o. Now, i'd suggest to build a new kernel and try it. The next steps are more complicated.

Now install cslip-2.7. The README suggests to install a new networking code, but i can guarantee you that this is no longer necessary if you have a state of the art high speed modem, which does V.34 or V.34+.

	cp common/net/* /sys/net
	cp common/net/*.h /usr/include/net
	cp sunos4/net/* /sys/net
	cp sunos4/net/*.h /usr/include/net
Edit /sys/conf.common/files.cmn and add these lines (where the other net/* entries occur):
	net/bpf.c		optional bpfilter
	net/bpf_filter.c	optional bpfilter
	net/if_sl.c		optional sl INET
	net/slcompress.c	standard
Edit /sys/sun/str_conf.c and add the following lines at the appropriate places (right after the entries for db.h and NDB):
	#include "sl.h"
:
:
	NSL > 0
	extern struct streamtab if_slinfo;
	#endif
:
:
	NSL > 0
		{ "slip",	&if_slinfo },
	#endif
Edit your kernel config file and add this lines (after pseudo-device loop):
	#
	# Two slip interfaces
	#
	pseudo-device	sl2	init slattach
If you do not have your own kernel config file, make a copy of the GENERIC config file and give it a fancy name (MYKERNEL for example). Ok, you might now config a kernel and install it. On bootup, it should show you
	sl0 attached
	sl1 attached
and when ifconfig -a is called, it should show you two POINTTOPOINT interfaces, which are DOWN.

Make the programs:

	make clean
	foreach i ( myetheraddr slinfo sliplogin slstats )
		cd $i
		make
		cd ..
	end
	cd tools/ifconfig
	make -f Makefile.oldmake 
	cd ../..
Install the programs:
	mv /usr/bin/tip /usr/bin/tip.old
	chmod 700 /usr/bin/tip.old
	install -m 4750 -o uucp -g uucp tip/tip /usr/bin/tip
	install -m 750 -g uucp sliplogin/sliplogin /usr/bin/sliplogin
	install -m 444 sliplogin/sliplogin.8 /usr/man/man8/sliplogin.8
	install -m 750 -g uucp slstats/slstats /usr/bin/slstats
	install -m 444 slstats/slstats.8 /usr/man/man8/slstats.8
	install -m 750 -g uucp slinfo/slinfo /usr/bin/slinfo
	install -m 444 slinfo/slinfo.8 /usr/man/man8/slinfo.8
	install -m 750 -g uucp myetheraddr/myetheraddr /usr/bin/myetheraddr
	install -m 444 myetheraddr/myetheraddr.8 /usr/man/man8/myetheraddr.8
	install -m 750 -g uucp tools/ifconfig/ifconfig /usr/bin/ifconfig.slip
	install -m 444 tools/ifconfig/ifconfig.8c /usr/man/man8/ifconfig.slip.8
Install the configuration files:
	install -m 640 -g uucp sliplogin/slip.logout /etc
	install -m 640 -g uucp sliplogin/slip.login /etc
	install -m 640 -g uucp sliplogin/slip.hosts /etc
	install -m 640 -g uucp tip/login.script.unix /etc
	install -m 640 -g uucp tip/login.script.netblazer /etc
Edit /etc/slip.login and comment out the portion reading:
	# route set $R $L mtu 552 pipesize 2048 rtt 5 || exit 2
and change all occurences of "ifconfig" to "ifconfig.slip".

Follow the instructions in the README and create entries in /etc/remote. If you really want to use slip, you'll need entries in /etc/passwd too. The entries in /etc/remote are nice to have, because this will enable you to configure your modem with "tip".

modem:\
        :dv=/dev/cua0:br#38400:el=^C^S^Q^U^D:ie=%$:oe=^D:
dial38400:\
	:dv=/dev/cua0:br#38400:nt:fc:at=mymodem:du:
mymodem|US Robotics Courier V.everything:\
	:el=^U^C^R^O^D^S^Q@:ie=#%$:oe=^D:tc=dial38400:
dial-foo:\
	:pn=dt06331800510:tc=mymodem:
foo|slip-foo:\
	:st=slip:ls=/etc/login.script.unix S%h {passwd}:\
	:cc=/etc/sliplogin Sfoo:tc=dial-foo:
Hints: /dev/cua0 is the outgoing counterpart of ttya. We'll create this device later. Speed is at maximum of 38400 baud. The pn= is followed by the apropriate phone number. the name of the remote host is "foo". These names must match the entries in /etc/passwd. Choose short hostnames!

The devices need to be created:

	mknod /dev/cua0 c 12 128
	mknod /dev/cua1 c 12 129
	chgrp uupc /dev/tty? /dev/cua?
	chmod g+rw /dev/tty? /dev/cua?
Prepare /etc/gettytab and /etc/ttytab:
	p8.38400|38400-baud-8bit:\
        	:sp#38400:p8:
	H|D38400|Fast-Dial-38400:\
		:nx=D38400:fc:fd@:tc=38400-baud:	

	ttya    "/usr/etc/getty D38400"       dialup           on remote
If you can find a slip host nearby, you can try to make slip work. I had no luck with it (yet). Nevertheless, cslip-2.7 describes accurately the process of setting up /etc/remote, tip and the cua devices.

Installing ppp-2.1.2b is the last step. Since modload is broken in SunOS 4.1.1, we will put the ppp-driver into the kernel directly. The instructions tell you to install it to /sys/os, but of course, the apropriate directory is /sys/net! ppp-2.1.2b will overwrite slcompress.c, but slip will continue to work, since the new slcompress.c only adds some definitions, leaving the rest untouched.

Edit /sys/conf.common/files.cmn:

	net/slcompress.c        standard
	net/ppp_if.c            optional ppp INET
	net/ppp_async.c         optional ppp INET
Edit /sys/sun/str_conf.c:
	#include "ppp.h"
:
:
        #if     NPPP > 0
	extern struct streamtab ppp_asyncinfo;
	extern struct streamtab ppp_ifinfo;
	#endif
:
:
	#if     NPPP > 0
		{ "pppif",     &ppp_ifinfo },
		{ "pppasync",  &ppp_asyncinfo },
	#endif
Put the entries right behind the entries for slip.

Change your kernel config file (MYKERNEL) and add:

	#
	# Two ppp interfaces
	#
	pseudo-device   ppp2    init ppp_attach
Edit ppp_if.c and add (after #include <netinet/ip.h>):
	#include <net/slcompress.h>
	#include <net/if_ppp.h>
Change the entries in if_ppp.h and ppp_str.h, that read
	typedef u_long ext_accm[8];
to
	#ifndef EXT_ACCM
	typedef u_long  ext_accm[8];
	#define EXT_ACCM
	#endif
Copy the stuff into the right directories:
	cp sunos/*.c /sys/net
	cp net/*.h /sys/net
	cp net/*.h /usr/include/net
Make a new kernel. No way to get around this now :-)
	cd /sys/sun3/conf
	config MYKERNEL
	cd ../MYKERNEL
	make
Try it and enjoy. If the machine comes up, it should show you four POINTTOPOINT interfaces, ppp0, ppp1, sl0 and sl1.

Fine.

Now its time to compile and install the ppp programs. But before, you need to make sure, that the right lockfiles are used! Change the Makefile and the sources, if necessary.

	foreach i (chat pppstats pppd)
		cd $i
		rm Makefile
		ln -s Makefile.sun Makefile
		make clean
		make
		cd ..
	end
	install -m 4750 -o root -g uucp pppd/pppd /usr/bin
	install -m 444 pppd/pppd.8 /usr/man/man8
	install -m 4750 -o root -g uucp pppstats/pppstats /usr/bin
	install -m 750 -o root -g uucp chat/chat /usr/bin
	install -m 444 chat/chat.8 /usr/man/man8

Use it

You now need configuration files to feed your daemons.

Hints

First of all, you should make sure, that all programs, that work with ttys use THE SAME lockfile. Sun's tip and uucp use /usr/spool/locks/LCK..ttyname. The tip that comes with cslip uses /tmp/LCK..ttyname, chat and pppd use /var/spool/uucp/LCK..ttyname. Change the sources appropriately. All the shell scripts in this HOWTO use /var/spool/locks (which is the same as /usr/spool/locks). If you have C-Kermit installed, check it's lock behaviour too!

It is a good idea to have all programs, that work with ttys in the same group. Users, which are allowed to work with modems can be put into this group and if you set the access rights to the programs 750, only these people can use the ttys (e.g. modems). For me, the group "uucp" is fine. Make the devices group "uucp" too. The cua-devices should be user "uucp".


Copyright 2007 Peter Koch