Quick Reference


Configure Hardware:
You will log in as root for all modifications.

Determine which COM port your modem is on:

	COM1	= /dev/ttyS0
	COM2	= /dev/ttyS1
	COM3	= /dev/ttyS2
	COM4	= /dev/ttyS3

Change access permissions for the modem device port:

	% chmod 770 /dev/ttySn
	% chmod 770 /sbin/setserial

Create a symbolic link to the modem device file:

	% ln -s /dev/ttySn /dev/modem

Configure the Port:

	% /bin/setserial /dev/modem auto_irq autoconfig

Troubleshooting:

	% cat /proc/interrupts
	% /bin/setserial -a /dev/ttyS[0,1,2,3]
	% /bin/setserial -b /dev/ttySn IRQ nn

Finalization:

	Once the setserial application is configuring the device correctly,
	place the line of code in the file '/etc/rc.d/rc.serial'. This will
	execute the command during the startup phase and will have the
	devices pre-configured for a PPP connection.



Configure Software:
Files Needed:

	/usr/sbin/pppd          # the PPP bin application.
	/etc/ppp/options        # the options pppd uses for connections.
	/etc/ppp/options.ttySn  # the options specific to a connection on this port.

Edit /etc/host.conf:

	#/etc/host.conf
		order hosts, bind

Make sure /etc/nsswitch.conf contains this line:

	#/etc/nsswitch.conf
		hosts:  files dns

Edit /etc/resolv.conf, this file handles the nameserver addressing:

	#/etc/resolv.conf
		#nameserver w.x.y.z
		nameserver  206.124.64.253
		nameserver  206.124.65.253

Make sure that these files are readable by everyone:

	%chmod a+r /etc/resolv.conf /etc/host.conf /etc/nsswitch.conf

Edit /etc/sysconfig/network, in Redhat/Mandrake it sets your domain:

	#/etc/sysconfig/network
		HOSTNAME=

Edit /etc/ppp/options, this file handles network configuration:

	How To Configure /etc/ppp/options

Edit /etc/ppp/chatscript, this file handles authentication process:

	How To Configure /etc/ppp/chatscript

Configure a PPP connection script:

	How To Configure A PPP script

Troubleshooting:

	No Default Route?
		/sbin/route del default

	To test if kerneld is running, run the command:
		% ps aux|grep kerneld|grep -v grep

	Assuming that you find that kerneld is not running, then on a
	Redhat system, run:
		/etc/rc.d/init.d/kerneld start
		or
		/sbin/kerneld

	Message Logging:
		% cp /etc/syslog.conf /etc/syslog.conf.orig
		Edit /etc/syslog.conf and add the lines:
			local2.*            /var/log/ppp
			daemon.*            /var/log/ppp
		Then, to tell syslogd to actually log the information:
			% killall -1 syslogd



Group Usage:
To allow ordinary users (or usually you as an ordinary user) to use ppp,
some changes need to be made.

You will want to setup a group for all users with permission to run the
pppd daemon and connect to the internet. For this example, we will assume
that the group we created is called 'ppp' in the file '/etc/group'.

Add the users who will be firing up PPP to the ppp group in /etc/group

Change the group of /usr/sbin/pppd to 'ppp'. With the chgrp command:

	% chgrp ppp /usr/sbin/pppd

Change permissions so that the ppp group can access the binary pppd:

	% chmod g+rx /usr/sbin/pppd
	% chmod o-rx /usr/sbin/pppd

Setup pppd as setuid root:

	% chmod +s /usr/sbin/pppd

What this does is make pppd run with root privileges even if the binary is
run by an ordinary user. This allows a normal user to run pppd with the
necessary privileges to set up the network interfaces and the kernel routing
table.

Change group of related files and devices to ppp:

	% chgrp ppp /dev/ttyS1
	% chgrp ppp /dev/modem
	% chgrp ppp /etc/ppp/ppp_script

An alternative (and better method) to this set up is to use the sudo program.
This offers superior security and will allow you to set things up so that any
(authorised) user can activate/deactivate the link using the scripts. Using
sudo will allow an authorised user to activate/deactivate the PPP link cleanly
and securely.