ppp options

     FreeBSD comes with an application called "ppp" which can be used to connect to the internet in multiple ways. There is an 'interactive' mode where you can configure each parameter on-the-fly for the dial-up connection. There is also a configuration script which can be used to automate the connection process once invoked by the user. The most interesting option available from the "ppp" application is the automatic mode. It will sense when a connection is needed and initiate it automatically and then disconnect once there is no longer a need for remote access.

     FreeBSD can also be connected to the internet in the usual fashion most Unix systems use, the pppd process. See the Linux ppp configuration process for configuring FreeBSD with the conventional pppd process. The only exceptions you will encounter are the differences in the modem device files. Linux uses "/dev/ttySn" device files for serial ports/devices, FreeBSD uses "/dev/cuaan" for serial ports/devices.



The PPP Application

     Connecting FreeBSD to the internet via the "ppp" application requires the superuser to edit the file "/etc/ppp/ppp.conf". This file contains both modem AT commands and the username / password for the target service.

     You can manually use ppp by typing "ppp" at the command prompt. If you would like to communicate directly with your modem like using minicom, after invoking interactive ppp, type "term".



PPP Files:
	/etc/ppp/ppp.conf
		System default configuration file.
	/etc/ppp/ppp.secret
		An authorisation file for each system.
	/etc/ppp/ppp.linkup
		A file to check when ppp establishes a network
		level connection.
	/etc/ppp/ppp.linkdown
		A file to check when ppp closes a network level connection.
	/var/log/ppp.log
		Logging and debugging information file.  Note, this name is
		specified in /etc/syslogd.conf. See syslog.conf(5) for
		further details.


The PPP Configuration File (/etc/ppp/ppp.conf)
# "/etc/ppp/ppp.conf" configuration file.
default:
	# Used with all settings
	set device /dev/cuaa0
	set speed 57600
	set timeout 300
	disable pred1
	deny pred1
	disable lqr
	deny lqr
	set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" ATE1Q0M0 \
		OK-AT-OK\\dATDT\\T TIMEOUT 40 CONNECT"
	set redial 3 10		# Redial setup
	add default HISADD	# Static IP Address

interactive:
	# Invoke with "ppp interactive"
	set phone 555-1234 : 555-1235 : 555-1236
	set authname USERNAME
	set authkey PASSWORD
	set openmode active
	accept chap
	enable dns

demand:
	# Invoke with: "ppp -auto demand"
	# or "ppp -auto -alias demand"
	set phone 555-1234 | 555-1235 | 555-1236
	set authname USERNAME
	set authkey PASSWORD
	set openmode active
	accept chap
	set ifaddr 127.1.1.1/0 127.2.2.2/0 255.255.255.0
	add 0 0 127.2.2.2

no_pap_chap:
	# Invoke with: "ppp -auto demand"
	set phone 555-1234 | 555-1235 | 555-1236
	set authkey PASSWORD
	set login "TIMEOUT 15 login:-\\r-login: USERNAME word: \\P


Setting Up IP Forwarding:
To enable IP Forwarding as the default configuration upon system boot,
edit the "/etc/rc.conf" file to contain the following:

	gateway="YES"

Either invoke the ppp application with the "-alias" option or include
"alias enable yes" in the "/etc/ppp/ppp.conf" configuration file.


Setting Up Auto Dialing (dial on demand):
To enable automatic dialing when a network connection is needed to route
packets to a destination outside the internal LAN or just the standalone
machine, edit the "/etc/rc.conf" file:

Look for the "network_interfaces" variable. Make sure the "tun0" device
is added to the list.

	network_interfaces="lo0 tun0"

Add the following variable to the "/etc/rc.conf" file and leave it's
argument blank:

	ifconfig_tun0=

Create a file named "/etc/start_if.tun0". This script is executed at
network configuration time, starting your ppp daemon in automatic mode.
If you have a LAN for which this machine is a gateway, you may also wish
to use the -alias switch or include "alias enable yes" in the
"/etc/ppp/ppp.conf" configuration file.

This file "/etc/start_if.tun0" should contain the following line:

	ppp -auto YOURISP

Set the router program to NO with following line in your /etc/rc.conf:

	router_enable="NO"

It is important that the routed daemon is not started (it is started by
default), as it routed tends to delete the default routing table entries
created by ppp.