xref: /freebsd/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.8 (revision 6b3455a7665208c366849f0b2b3bc916fb97516e)
1.\" Copyright (c) 2001-2003 Maksim Yevmenkin <m_evmenkin@yahoo.com>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $Id: rfcomm_pppd.8,v 1.7 2003/09/07 18:32:11 max Exp $
26.\" $FreeBSD$
27.\"
28.Dd February 4, 2003
29.Dt RFCOMM_PPPD 8
30.Os
31.Sh NAME
32.Nm rfcomm_pppd
33.Nd RFCOMM PPP daemon
34.Sh SYNOPSIS
35.Nm
36.Fl c
37.Op Fl dh
38.Fl a Ar BD_ADDR
39.Fl C Ar channel
40.Fl l Ar label
41.Fl u Ar N
42.Nm
43.Fl s
44.Op Fl dhS
45.Op Fl a Ar BD_ADDR
46.Fl C Ar channel
47.Fl l Ar label
48.Sh DESCRIPTION
49The
50.Nm
51daemon is a simple wrapper daemon that allows to use standard
52.Xr ppp 8
53on RFCOMM connection.
54It can operate in two modes: client and server.
55.Pp
56In the client mode,
57.Nm
58opens an RFCOMM connection to the specified server's
59.Ar BD_ADRR
60and
61.Ar channel .
62Once RFCOMM connection is established,
63.Nm
64executes
65.Xr ppp 8
66in
67.Fl direct
68mode with the specified
69.Ar label .
70The
71.Xr ppp 8
72in its turn operates over the RFCOMM connection just like it would operate
73over the standard serial port thus allowing user to
74.Dq "dial out"
75and connect to the Internet.
76.Pp
77In the server mode,
78.Nm
79opens an RFCOMM socket and listens for incomming connections from remote clients.
80Once the new incomming connection is accepted,
81.Nm
82forks and executes
83.Xr ppp 8
84in
85.Fl direct
86mode with the specified
87.Ar label .
88The
89.Xr ppp 8
90in its turn operates over the RFCOMM connection just like it would operate over
91the standard serial port thus providing network connectivity to remote clients.
92.Pp
93The options are as follows:
94.Bl -tag -width indent
95.It Fl a Ar BD_ADDR
96In the client mode, this required option specifies the remote BD_ADDR of the
97RFCOMM server.
98In the server mode, this option can be used to specify the local
99BD_ADDR to listen on.
100By default, server will listen on
101.Dv ANY
102address.
103.It Fl C Ar channel
104In both client and server modes, this required option specifies RFCOMM channel
105to connect to or listen on.
106In the server mode, RFCOMM channel should be a number between 1 and 30.
107In the client mode, RFCOMM channel could either be a number between 1 and 30
108or a service name.
109Supported service names are:
110.Cm DUN
111(for DialUp Networking service) and
112.Cm LAN
113(for LAN Access Using PPP service).
114If service name was specified instead of numeric RFCOMM channel then
115.Nm
116utility will try to obtain RFCOMM channel for the service via Service
117Discovery Protocol.
118.It Fl c
119Act as an RFCOMM client.
120This is the default mode.
121.It Fl d
122Do not detach from the controlling terminal, i.e., run in foreground.
123.It Fl h
124Display usage message and exit.
125.It Fl l Ar label
126In both client and server modes, this required option specifies which
127.Xr ppp 8
128label will be used.
129.It Fl S
130In the server mode register the Serial Port (SP) service in addition to the
131LAN Access Using PPP (LAN) service.
132It appears that some cell phones are using so called
133.Dq callback mechanism .
134In this scenario the user is trying to connect his cell phone to the Internet,
135and, user's host computer is acting as the gateway server.
136It seems that it is not possible to tell the phone to just connect and start
137using the LAN service.
138Instead the user's host computer must
139.Dq jump start
140the phone by connecting to the phone's SP service.
141What happens next is the phone kills the existing connection and opens another
142connection back to the user's host computer.
143The phone really wants to use LAN service, but for whatever reason it looks
144for the SP service on the user's host computer.
145This brain damaged behavior was reported for Nokia 6600 and Sony/Ericsson P900.
146.It Fl s
147Act as an RFCOMM server.
148.It Fl u Ar N
149This option maps directly onto
150.Fl unit
151.Xr ppp 8
152command line option and tells
153.Nm
154to instruct
155.Xr ppp 8
156to only attempt to open
157.Pa /dev/tun Ns Ar N .
158This option only works in the client mode.
159.El
160.Sh PPP CONFIGURATION
161.Ss Important Notes on PPP Configuration
162Special attention is required when adding new RFCOMM configurations to the
163existing PPP configuration.
164Please keep in mind that PPP will
165.Em always
166execute commands in the
167.Dq Li default
168label of your
169.Pa /etc/ppp/ppp.conf
170file.
171Please make sure that the
172.Dq Li default
173label
174.Em only
175contains commands that apply to
176.Em every
177other label.
178If you need to use PPP for both dialing out and accepting incoming
179RFCOMM connections, please make sure you have moved all commands related to
180dialing out from the
181.Dq Li default
182section into an appropriate outgoing label.
183.Ss RFCOMM Server
184One of the typical examples is the LAN access.
185In this example, RFCOMM connection
186is used as a null-modem connection between client and server.
187Both client
188and server will start talking PPP right after RFCOMM connection was established.
189.Bd -literal -offset indent
190rfcomm-server:
191 set timeout 0
192 set lqrperiod 10
193 set ifaddr 10.0.0.1 10.0.0.2 255.255.255.0
194 enable lqr
195 accept lqr
196 # Do not use PPP authentication. Assume that
197 # Bluetooth connection was authenticated already
198 disable pap
199 deny pap
200 disable chap
201 deny chap
202.Ed
203.Ss RFCOMM Client
204The
205.Nm
206utility
207supports both LAN and DUN (Dial-Up Networking) access.
208The client's configuration for the LAN access is very similar to server's and
209might look like this.
210.Bd -literal -offset indent
211rfcomm-client:
212 enable lqr
213 accept lqr
214 set dial
215 set timeout 0
216 disable iface-alias
217 set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
218 # Do not use PPP authentication. Assume that
219 # Bluetooth connection was authenticated already
220 deny pap
221 disable pap
222 deny chap
223 disable chap
224.Ed
225.Pp
226The client's configuration for the DUN access is different.
227In this scenario, the client gets connected to the virtual serial port on the
228server.
229To open a PPP session, client must dial a number.
230Note that by default
231.Xr ppp 8
232will not execute any configured chat scripts.
233The
234.Ic force-scripts
235option can be used to override this behavior.
236The example of such configuration is shown below.
237.Bd -literal -offset indent
238rfcomm-dialup:
239 # This is IMPORTANT option
240 enable force-scripts
241
242 # You might want to change these
243 set authname
244 set authkey
245 set phone "*99***1#"
246
247 # You might want to adjust dial string as well
248 set dial "ABORT BUSY ABORT NO\\\\sCARRIER TIMEOUT 5 \\
249           \\"\\" AT OK-AT-OK ATE1Q0 OK \\\\dATD\\\\T TIMEOUT 40 CONNECT"
250 set login
251 set timeout 30
252 enable dns
253 resolv rewrite
254
255 set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
256 add default HISADDR
257.Ed
258.Pp
259Note that by adjusting the initialization string, one can make CSD (Circuit
260Switched Data), HSCSD (High Speed Circuit Switched Data) or GPRS (General
261Packet Radio Service) connection.
262The availability of the particular connection
263type depends on the phone model and service plan activated on the phone.
264.Sh EXAMPLES
265.Dl "rfcomm_pppd -s -a 00:01:02:03:04:05 -C 1 -l rfcomm-server"
266.Pp
267This command will start
268.Nm
269in the server mode.
270The RFCOMM server will listen on local address
271.Li 00:01:02:03:04:05
272and channel
273.Li 1 .
274Once the incomming connection has been accepted,
275.Nm
276will execute
277.Xr ppp 8
278in
279.Fl direct
280mode with
281.Dq Li rfcomm-server
282label.
283.Pp
284.Dl "rfcomm_pppd -c -a 00:01:02:03:04:05 -C 1 -l rfcomm-client"
285.Pp
286This command will start
287.Nm
288in the client mode.
289.Nm
290will try to connect to the RFCOMM server at
291.Li 00:01:02:03:04:05
292address and channel
293.Li 1 .
294Once connected, the
295.Nm
296will execute
297.Xr ppp 8
298in
299.Fl direct
300mode with
301.Dq Li rfcomm-client
302label.
303.Sh DIAGNOSTICS
304.Ex -std
305.Sh CAVEAT
306The
307.Nm
308utility in server mode will try to register Bluetooth LAN Access Over PPP
309service with local SPD daemon.
310If local SDP daemon is not running the
311.Nm
312utility will exit with error.
313.Sh SEE ALSO
314.Xr rfcomm_sppd 1 ,
315.Xr ng_btsocket 4 ,
316.Xr ppp 8 ,
317.Xr sdpcontrol 8 ,
318.Xr sdpd 8
319.Sh AUTHORS
320.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
321