FreeBSD Handbook : PPP and SLIP : Setting up user PPP : PPP and static IP addresses
Previous: PPP Configuration
Next: PPP and Dynamic IP configuration

12.1.5. PPP and static IP addresses

Probably the easiest to configure for. You will need to create three files in the /etc/ppp directory.

The first of these is ppp.conf. It should look similar to the example below. Note that lines that end in a ``:'' start in column 1, all other lines should be indented as shown.

/etc/ppp/ppp.conf

1     default:
2       set device /dev/cuaa0
3       set speed 9600
4       disable lqr
5       deny lqr
6       set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" ATE1Q0 OK-AT-OK
\\dATDT\\T TIMEOUT 40 CONNECT"
7      provider:
8        set phone 01234567890
9	 set login "TIMEOUT 10 gin:-BREAK-gin: foo word: bar col: ppp"
10       set timeout 120
11       set ifaddr x.x.x.x y.y.y.y
12       delete ALL
13       add 0 0 HISADDR
14       set openmode active
Do not include the line numbers, they are just for this discussion.

Line 1:

Identifies the default entry. Commands in this entry are executed automatically when ppp is run.

Line 2:

Identifies the device that has the modem hanging from it. COM1: is /dev/cuaa0 and COM2: is /dev/cuaa1.

Line 3:

Sets the speed you want to connect at.

Line 4:

Tells us not to request LQR. LQR is a "keepalive" protocol used by ppp.

Line 5:

Tells us not to accept LQR negotiation from the other side.

Line 6:

Dial string commands. user ppp uses the chat(8) language. Check the manual page for information on the features of this language.

Line 7:

Identifies an entry for a provider called ``provider''.

Line 8:

Sets the phone number for this provider. Do not include any spaces in the phone number.

Line 9:

Sets the login string sequence. In this example, the string is for a service who's login session looks like

J. Random Provider
login: foo
password: bar
protocol: ppp
You will need to alter this script to suit your own needs. It is written in the chat(8) language.

Line 10:

Sets the default timeout (in seconds) for the connection. So the connection will be closed automatically after 120 seconds of inactivity.

Line 11:

Sets the interface addresses. The string x.x.x.x should be replaced by the IP address that your provider allocates you. The string y.y.y.y should be replaced by the IP address that your ISP indicated for their gateway.

Line 12:

Deletes all existing routing table entries for the acquired tun device.

Line 13:

Adds a default route to your ISPs IP number.

Line 14:

Tells our side to begin negotiation. This is not always necessary, but it does no harm to have both sides initiating the Line Control Protocol (LCP).

Now you have to edit the file /etc/ppp/ppp.linkup:

x.x.x.x:
  delete ALL
  add 0 0 HISADDR
Replace x.x.x.x with your IP address as before. This file is used to automatically delete all existing routes for the acquired line and add a default route from your ISP (who's address is automatically inserted with the HISADDR macro) to you.

With a static IP number assigned by your ISP, you don't actually need an entry in /etc/ppp.linkup, but again, it doesn't do any harm to have it.

Finally, you can create the file /etc/ppp/ppp.secret, which sets some passwords to prevent people messing around with ppp on your system. You may or may not want to do this, depending on how many people have access to your ppp system.


FreeBSD Handbook : PPP and SLIP : Setting up user PPP : PPP and static IP addresses
Previous: PPP Configuration
Next: PPP and Dynamic IP configuration