Dial-up PPP in FreeBSD

The following works with me, on FreeBSD 3.4-RELEASE and an USR modem, but YMMV some.

nameserver 193.216.1.10 #my ISPs primary nameserver
nameserver 193.216.69.10 #my ISPs secondary nameserver
domain c2i.net #my ISPs..um..domain, like

(man resolv.conf)

  127.0.0.1 localhost
  10.0.0.1 igloo.my.domain igloo # My local hostname. The default will do just fine.(localhost.localdomain)

----START OF FILE---

#################################################################

  # PPP Sample Configuration File

  # Originally written by Toshiharu OHNO

  # This is the default file that came with 3.3, where I have inserted sections and text

  # Refer to the ppp man page for all details

  #################################################################

  

default:

	set device /dev/cuaa1
	set log Phase Chat LCP IPCP CCP tun command # add "local" to see all messages 	
	set speed 115200
	set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" AT OK-AT-OK ATE1Q0 OK \\
	dATDT\\T TIMEOUT 40 CONNECT"



# set timeout 120

	set timeout 0
	set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
	add default HISADDR
	enable dns

papchap:
    # edit the next three lines and replace the items in caps with
    # the values which have been assigned by your ISP.
    #  
	# set phone PHONE_NUM
	# set authname USERNAME
	# set authkey PASSWORD

# I have two sections, one for my primary ISP and one for my secondary 

tele2:

	set phone myISPsphonenumber
	set authname  myusername
	set authkey mypassword


sensewave:

	set phone myISPsphonenumberwithsensewave
	set authname myusernamewithsensewave
	set authkey mypasswordwithsensewave

----END OF FILE---

Other files

This may be obsolete in FreeBSD=>3.3-RELEASE, but I kept a backup and copied them into /etc/ppp after upgrading.

My /etc/ppp/ppp.linkup:

tele2:
delete ALL
add 0 0 HISADDR

MYADDR:
delete ALL
add 0 0 HISADDR


sensewave:
delete all
add 0 0 HISADDR

 

My /etc/ppp/options:

/dev/cuaa1 115200
crtscts
modem
passive
noipdefault
defaultroute
domain c2i.net

 


 

Then what?

Then I start ppp as root in a spare VT or xterm. Users can be given access to ppp and modem, however.

at the ppp on yourhostname> prompt, I type dial tele2, to get to my primary ISP. PPP then reads the Tele2: section of ppp.conf. When the connection is established, I can go to my users terminal and do whatever.

The ppp on myhost> prompt mean you're not online. It changes to ppP on myhost> when connecting, then pPP, and PPP on myhost> when we are connected.

To close the ppp connection, I type close (duh) at the ppp prompt. To end ppp alltogether I type quit.

 


(Remember: In the /etc/ppp/ppp.conf file, the headers for the sections have a trailing colon, and all the other lines have to be indented. Otherwise, ppp will stop with an error message.)

Troubleshooting

In a perfect world, you will only have to set the three last values (phone, authname and password). In a less perfect world (like ours), you will have to tweak the set log value (man ppp), maybe set timeout to 0, or add other stuff. This is where you have to read the following:

The FreeBSD online manual: ppp

The ppp section of the Handbook

The FreeBSD ppp FAQ

http://www.oz.net/~sm/faq/Linux.html#Method2 (a bit outdated)

When you have the local option in the set log line of ppp.conf, the messages scroll down your screen when you dial with ppp. Otherwise, you can read the /var/log/ppp.log file. (or you can open an Xterm and run "tail -f /var/log/ppp.conf" in it.)A tip when troubleshooting is to copy and paste the exact error message when the dialup fails into a dejanews search, or post it in a FreeBSD newsgroup.