xref: /freebsd/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.8 (revision 1985a3a39d71ccefe7241ea2d678dcb48ef529fb)
11a63eb31SJulian Elischer.\" Copyright (c) 2001-2003 Maksim Yevmenkin <m_evmenkin@yahoo.com>
21a63eb31SJulian Elischer.\" All rights reserved.
31a63eb31SJulian Elischer.\"
41a63eb31SJulian Elischer.\" Redistribution and use in source and binary forms, with or without
51a63eb31SJulian Elischer.\" modification, are permitted provided that the following conditions
61a63eb31SJulian Elischer.\" are met:
71a63eb31SJulian Elischer.\" 1. Redistributions of source code must retain the above copyright
81a63eb31SJulian Elischer.\"    notice, this list of conditions and the following disclaimer.
91a63eb31SJulian Elischer.\" 2. Redistributions in binary form must reproduce the above copyright
101a63eb31SJulian Elischer.\"    notice, this list of conditions and the following disclaimer in the
111a63eb31SJulian Elischer.\"    documentation and/or other materials provided with the distribution.
121a63eb31SJulian Elischer.\"
131a63eb31SJulian Elischer.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
141a63eb31SJulian Elischer.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
151a63eb31SJulian Elischer.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
161a63eb31SJulian Elischer.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
171a63eb31SJulian Elischer.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
181a63eb31SJulian Elischer.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
191a63eb31SJulian Elischer.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
201a63eb31SJulian Elischer.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
211a63eb31SJulian Elischer.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
221a63eb31SJulian Elischer.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
231a63eb31SJulian Elischer.\" SUCH DAMAGE.
241a63eb31SJulian Elischer.\"
250986ab12SMaksim Yevmenkin.\" $Id: rfcomm_pppd.8,v 1.7 2003/09/07 18:32:11 max Exp $
261a63eb31SJulian Elischer.\" $FreeBSD$
2772f00208SRuslan Ermilov.\"
281a63eb31SJulian Elischer.Dd February 4, 2003
291a63eb31SJulian Elischer.Dt RFCOMM_PPPD 8
301a63eb31SJulian Elischer.Os
311a63eb31SJulian Elischer.Sh NAME
321a63eb31SJulian Elischer.Nm rfcomm_pppd
331a63eb31SJulian Elischer.Nd RFCOMM PPP daemon
341a63eb31SJulian Elischer.Sh SYNOPSIS
351a63eb31SJulian Elischer.Nm
3672f00208SRuslan Ermilov.Fl c
3772f00208SRuslan Ermilov.Op Fl dh
3872f00208SRuslan Ermilov.Fl a Ar BD_ADDR
3972f00208SRuslan Ermilov.Fl C Ar channel
4072f00208SRuslan Ermilov.Fl l Ar label
4113706e45SMaksim Yevmenkin.Fl u Ar N
4272f00208SRuslan Ermilov.Nm
4372f00208SRuslan Ermilov.Fl s
441985a3a3SMaksim Yevmenkin.Op Fl dhS
451a63eb31SJulian Elischer.Op Fl a Ar BD_ADDR
4672f00208SRuslan Ermilov.Fl C Ar channel
4772f00208SRuslan Ermilov.Fl l Ar label
481a63eb31SJulian Elischer.Sh DESCRIPTION
491a63eb31SJulian ElischerThe
501a63eb31SJulian Elischer.Nm
511a63eb31SJulian Elischerdaemon is a simple wrapper daemon that allows to use standard
5272f00208SRuslan Ermilov.Xr ppp 8
5372f00208SRuslan Ermilovon RFCOMM connection.
5472f00208SRuslan ErmilovIt can operate in two modes: client and server.
551a63eb31SJulian Elischer.Pp
5672f00208SRuslan ErmilovIn the client mode,
571a63eb31SJulian Elischer.Nm
589b90f236SRuslan Ermilovopens an RFCOMM connection to the specified server's
5972f00208SRuslan Ermilov.Ar BD_ADRR
6072f00208SRuslan Ermilovand
6172f00208SRuslan Ermilov.Ar channel .
6272f00208SRuslan ErmilovOnce RFCOMM connection is established,
631a63eb31SJulian Elischer.Nm
641a63eb31SJulian Elischerexecutes
6572f00208SRuslan Ermilov.Xr ppp 8
661a63eb31SJulian Elischerin
6772f00208SRuslan Ermilov.Fl direct
6872f00208SRuslan Ermilovmode with the specified
6972f00208SRuslan Ermilov.Ar label .
7072f00208SRuslan ErmilovThe
7172f00208SRuslan Ermilov.Xr ppp 8
721a63eb31SJulian Elischerin its turn operates over the RFCOMM connection just like it would operate
731a63eb31SJulian Elischerover the standard serial port thus allowing user to
7472f00208SRuslan Ermilov.Dq "dial out"
751a63eb31SJulian Elischerand connect to the Internet.
761a63eb31SJulian Elischer.Pp
7772f00208SRuslan ErmilovIn the server mode,
781a63eb31SJulian Elischer.Nm
799b90f236SRuslan Ermilovopens an RFCOMM socket and listens for incomming connections from remote clients.
8072f00208SRuslan ErmilovOnce the new incomming connection is accepted,
811a63eb31SJulian Elischer.Nm
821a63eb31SJulian Elischerforks and executes
8372f00208SRuslan Ermilov.Xr ppp 8
841a63eb31SJulian Elischerin
8572f00208SRuslan Ermilov.Fl direct
8672f00208SRuslan Ermilovmode with the specified
8772f00208SRuslan Ermilov.Ar label .
8872f00208SRuslan ErmilovThe
8972f00208SRuslan Ermilov.Xr ppp 8
901a63eb31SJulian Elischerin its turn operates over the RFCOMM connection just like it would operate over
911a63eb31SJulian Elischerthe standard serial port thus providing network connectivity to remote clients.
921a63eb31SJulian Elischer.Pp
931a63eb31SJulian ElischerThe options are as follows:
941a63eb31SJulian Elischer.Bl -tag -width indent
951a63eb31SJulian Elischer.It Fl a Ar BD_ADDR
969b90f236SRuslan ErmilovIn the client mode, this required option specifies the remote BD_ADDR of the
9772f00208SRuslan ErmilovRFCOMM server.
9872f00208SRuslan ErmilovIn the server mode, this option can be used to specify the local
9972f00208SRuslan ErmilovBD_ADDR to listen on.
10072f00208SRuslan ErmilovBy default, server will listen on
1011a63eb31SJulian Elischer.Dv ANY
1021a63eb31SJulian Elischeraddress.
1031a63eb31SJulian Elischer.It Fl C Ar channel
1049b90f236SRuslan ErmilovIn both client and server modes, this required option specifies RFCOMM channel
1051a63eb31SJulian Elischerto connect to or listen on.
1069b90f236SRuslan ErmilovIn the server mode, RFCOMM channel should be a number between 1 and 30.
1079b90f236SRuslan ErmilovIn the client mode, RFCOMM channel could either be a number between 1 and 30
1089b90f236SRuslan Ermilovor a service name.
1099b90f236SRuslan ErmilovSupported service names are:
1100986ab12SMaksim Yevmenkin.Cm DUN
1119b90f236SRuslan Ermilov(for DialUp Networking service) and
1120986ab12SMaksim Yevmenkin.Cm LAN
1139b90f236SRuslan Ermilov(for LAN Access Using PPP service).
1140986ab12SMaksim YevmenkinIf service name was specified instead of numeric RFCOMM channel then
1150986ab12SMaksim Yevmenkin.Nm
1160986ab12SMaksim Yevmenkinutility will try to obtain RFCOMM channel for the service via Service
1170986ab12SMaksim YevmenkinDiscovery Protocol.
11872f00208SRuslan Ermilov.It Fl c
1199b90f236SRuslan ErmilovAct as an RFCOMM client.
12072f00208SRuslan ErmilovThis is the default mode.
1211a63eb31SJulian Elischer.It Fl d
12272f00208SRuslan ErmilovDo not detach from the controlling terminal, i.e., run in foreground.
1231a63eb31SJulian Elischer.It Fl h
1241a63eb31SJulian ElischerDisplay usage message and exit.
1251a63eb31SJulian Elischer.It Fl l Ar label
1269b90f236SRuslan ErmilovIn both client and server modes, this required option specifies which
12772f00208SRuslan Ermilov.Xr ppp 8
12872f00208SRuslan Ermilovlabel will be used.
1291985a3a3SMaksim Yevmenkin.It Fl S
1301985a3a3SMaksim YevmenkinIn the server mode register the Serial Port (SP) service in addition to the
1311985a3a3SMaksim YevmenkinLAN Access Using PPP (LAN) service.
1321985a3a3SMaksim YevmenkinIt appears that some cell phones are using so called
1331985a3a3SMaksim Yevmenkin.Dq callback mechanism .
1341985a3a3SMaksim YevmenkinIn this scenario the user is trying to connect his cell phone to the Internet,
1351985a3a3SMaksim Yevmenkinand, user's host computer is acting as the gateway server.
1361985a3a3SMaksim YevmenkinIt seems that it is not possible to tell the phone to just connect and start
1371985a3a3SMaksim Yevmenkinusing the LAN service.
1381985a3a3SMaksim YevmenkinInstead the user's host computer must
1391985a3a3SMaksim Yevmenkin.Dq jump start
1401985a3a3SMaksim Yevmenkinthe phone by connecting to the phone's SP service.
1411985a3a3SMaksim YevmenkinWhat happens next is the phone kills the existing connection and opens another
1421985a3a3SMaksim Yevmenkinconnection back to the user's host computer.
1431985a3a3SMaksim YevmenkinThe phone really wants to use LAN service, but for whatever reason it looks
1441985a3a3SMaksim Yevmenkinfor the SP service on the user's host computer.
1451985a3a3SMaksim YevmenkinThis brain damaged behavior was reported for Nokia 6600 and Sony/Ericsson P900.
1461a63eb31SJulian Elischer.It Fl s
1479b90f236SRuslan ErmilovAct as an RFCOMM server.
14813706e45SMaksim Yevmenkin.It Fl u Ar N
14913706e45SMaksim YevmenkinThis option maps directly onto
15013706e45SMaksim Yevmenkin.Fl unit
15113706e45SMaksim Yevmenkin.Xr ppp 8
15213706e45SMaksim Yevmenkincommand line option and tells
15313706e45SMaksim Yevmenkin.Nm
15413706e45SMaksim Yevmenkinto instruct
15513706e45SMaksim Yevmenkin.Xr ppp 8
15613706e45SMaksim Yevmenkinto only attempt to open
15713706e45SMaksim Yevmenkin.Pa /dev/tun Ns Ar N .
15813706e45SMaksim YevmenkinThis option only works in the client mode.
1591a63eb31SJulian Elischer.El
1601a63eb31SJulian Elischer.Sh PPP CONFIGURATION
16172f00208SRuslan Ermilov.Ss Important Notes on PPP Configuration
1621a63eb31SJulian ElischerSpecial attention is required when adding new RFCOMM configurations to the
16372f00208SRuslan Ermilovexisting PPP configuration.
16472f00208SRuslan ErmilovPlease keep in mind that PPP will
1651a63eb31SJulian Elischer.Em always
1661a63eb31SJulian Elischerexecute commands in the
16772f00208SRuslan Ermilov.Dq Li default
1681a63eb31SJulian Elischerlabel of your
1691a63eb31SJulian Elischer.Pa /etc/ppp/ppp.conf
17072f00208SRuslan Ermilovfile.
17172f00208SRuslan ErmilovPlease make sure that the
17272f00208SRuslan Ermilov.Dq Li default
1731a63eb31SJulian Elischerlabel
1741a63eb31SJulian Elischer.Em only
1751a63eb31SJulian Elischercontains commands that apply to
1761a63eb31SJulian Elischer.Em every
17772f00208SRuslan Ermilovother label.
17872f00208SRuslan ErmilovIf you need to use PPP for both dialing out and accepting incoming
1791a63eb31SJulian ElischerRFCOMM connections, please make sure you have moved all commands related to
1801a63eb31SJulian Elischerdialing out from the
18172f00208SRuslan Ermilov.Dq Li default
18272f00208SRuslan Ermilovsection into an appropriate outgoing label.
18372f00208SRuslan Ermilov.Ss RFCOMM Server
18472f00208SRuslan ErmilovOne of the typical examples is the LAN access.
18572f00208SRuslan ErmilovIn this example, RFCOMM connection
18672f00208SRuslan Ermilovis used as a null-modem connection between client and server.
18772f00208SRuslan ErmilovBoth client
1881a63eb31SJulian Elischerand server will start talking PPP right after RFCOMM connection was established.
1891a63eb31SJulian Elischer.Bd -literal -offset indent
1901a63eb31SJulian Elischerrfcomm-server:
1911a63eb31SJulian Elischer set timeout 0
1921a63eb31SJulian Elischer set lqrperiod 10
1931a63eb31SJulian Elischer set ifaddr 10.0.0.1 10.0.0.2 255.255.255.0
1941a63eb31SJulian Elischer enable lqr
1951a63eb31SJulian Elischer accept lqr
1961a63eb31SJulian Elischer # Do not use PPP authentication. Assume that
1971a63eb31SJulian Elischer # Bluetooth connection was authenticated already
1981a63eb31SJulian Elischer disable pap
1991a63eb31SJulian Elischer deny pap
2001a63eb31SJulian Elischer disable chap
2011a63eb31SJulian Elischer deny chap
2021a63eb31SJulian Elischer.Ed
20372f00208SRuslan Ermilov.Ss RFCOMM Client
20472f00208SRuslan ErmilovThe
2051a63eb31SJulian Elischer.Nm
20672f00208SRuslan Ermilovutility
20772f00208SRuslan Ermilovsupports both LAN and DUN (Dial-Up Networking) access.
20872f00208SRuslan ErmilovThe client's configuration for the LAN access is very similar to server's and
20972f00208SRuslan Ermilovmight look like this.
2101a63eb31SJulian Elischer.Bd -literal -offset indent
2111a63eb31SJulian Elischerrfcomm-client:
2121a63eb31SJulian Elischer enable lqr
2131a63eb31SJulian Elischer accept lqr
2141a63eb31SJulian Elischer set dial
2151a63eb31SJulian Elischer set timeout 0
2161a63eb31SJulian Elischer disable iface-alias
2171a63eb31SJulian Elischer set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
2181a63eb31SJulian Elischer # Do not use PPP authentication. Assume that
2191a63eb31SJulian Elischer # Bluetooth connection was authenticated already
2201a63eb31SJulian Elischer deny pap
2211a63eb31SJulian Elischer disable pap
2221a63eb31SJulian Elischer deny chap
2231a63eb31SJulian Elischer disable chap
2241a63eb31SJulian Elischer.Ed
2251a63eb31SJulian Elischer.Pp
22672f00208SRuslan ErmilovThe client's configuration for the DUN access is different.
22772f00208SRuslan ErmilovIn this scenario, the client gets connected to the virtual serial port on the
22872f00208SRuslan Ermilovserver.
22972f00208SRuslan ErmilovTo open a PPP session, client must dial a number.
23072f00208SRuslan ErmilovNote that by default
23172f00208SRuslan Ermilov.Xr ppp 8
23272f00208SRuslan Ermilovwill not execute any configured chat scripts.
23372f00208SRuslan ErmilovThe
23472f00208SRuslan Ermilov.Ic force-scripts
23572f00208SRuslan Ermilovoption can be used to override this behavior.
23672f00208SRuslan ErmilovThe example of such configuration is shown below.
2371a63eb31SJulian Elischer.Bd -literal -offset indent
2381a63eb31SJulian Elischerrfcomm-dialup:
2391a63eb31SJulian Elischer # This is IMPORTANT option
2401a63eb31SJulian Elischer enable force-scripts
2411a63eb31SJulian Elischer
2421a63eb31SJulian Elischer # You might want to change these
2431a63eb31SJulian Elischer set authname
2441a63eb31SJulian Elischer set authkey
2451a63eb31SJulian Elischer set phone "*99***1#"
2461a63eb31SJulian Elischer
2471a63eb31SJulian Elischer # You might want to adjust dial string as well
24872f00208SRuslan Ermilov set dial "ABORT BUSY ABORT NO\\\\sCARRIER TIMEOUT 5 \\
2491a63eb31SJulian Elischer           \\"\\" AT OK-AT-OK ATE1Q0 OK \\\\dATD\\\\T TIMEOUT 40 CONNECT"
2501a63eb31SJulian Elischer set login
2511a63eb31SJulian Elischer set timeout 30
2521a63eb31SJulian Elischer enable dns
2531a63eb31SJulian Elischer resolv rewrite
2541a63eb31SJulian Elischer
2551a63eb31SJulian Elischer set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
2561a63eb31SJulian Elischer add default HISADDR
2571a63eb31SJulian Elischer.Ed
2581a63eb31SJulian Elischer.Pp
25972f00208SRuslan ErmilovNote that by adjusting the initialization string, one can make CSD (Circuit
2601a63eb31SJulian ElischerSwitched Data), HSCSD (High Speed Circuit Switched Data) or GPRS (General
26172f00208SRuslan ErmilovPacket Radio Service) connection.
26272f00208SRuslan ErmilovThe availability of the particular connection
2631a63eb31SJulian Elischertype depends on the phone model and service plan activated on the phone.
2641a63eb31SJulian Elischer.Sh EXAMPLES
26572f00208SRuslan Ermilov.Dl "rfcomm_pppd -s -a 00:01:02:03:04:05 -C 1 -l rfcomm-server"
2661a63eb31SJulian Elischer.Pp
26772f00208SRuslan ErmilovThis command will start
2681a63eb31SJulian Elischer.Nm
26972f00208SRuslan Ermilovin the server mode.
27072f00208SRuslan ErmilovThe RFCOMM server will listen on local address
27172f00208SRuslan Ermilov.Li 00:01:02:03:04:05
2721a63eb31SJulian Elischerand channel
27372f00208SRuslan Ermilov.Li 1 .
27472f00208SRuslan ErmilovOnce the incomming connection has been accepted,
2751a63eb31SJulian Elischer.Nm
2761a63eb31SJulian Elischerwill execute
27772f00208SRuslan Ermilov.Xr ppp 8
2781a63eb31SJulian Elischerin
27972f00208SRuslan Ermilov.Fl direct
2801a63eb31SJulian Elischermode with
28172f00208SRuslan Ermilov.Dq Li rfcomm-server
2821a63eb31SJulian Elischerlabel.
2831a63eb31SJulian Elischer.Pp
28472f00208SRuslan Ermilov.Dl "rfcomm_pppd -c -a 00:01:02:03:04:05 -C 1 -l rfcomm-client"
28572f00208SRuslan Ermilov.Pp
28672f00208SRuslan ErmilovThis command will start
2871a63eb31SJulian Elischer.Nm
2881a63eb31SJulian Elischerin the client mode.
2891a63eb31SJulian Elischer.Nm
2901a63eb31SJulian Elischerwill try to connect to the RFCOMM server at
29172f00208SRuslan Ermilov.Li 00:01:02:03:04:05
2921a63eb31SJulian Elischeraddress and channel
29372f00208SRuslan Ermilov.Li 1 .
29472f00208SRuslan ErmilovOnce connected, the
2951a63eb31SJulian Elischer.Nm
2961a63eb31SJulian Elischerwill execute
29772f00208SRuslan Ermilov.Xr ppp 8
2981a63eb31SJulian Elischerin
29972f00208SRuslan Ermilov.Fl direct
3001a63eb31SJulian Elischermode with
30172f00208SRuslan Ermilov.Dq Li rfcomm-client
3021a63eb31SJulian Elischerlabel.
3031a63eb31SJulian Elischer.Sh DIAGNOSTICS
3041a63eb31SJulian Elischer.Ex -std
30513706e45SMaksim Yevmenkin.Sh CAVEAT
30672f00208SRuslan ErmilovThe
3071a63eb31SJulian Elischer.Nm
30813706e45SMaksim Yevmenkinutility in server mode will try to register Bluetooth LAN Access Over PPP
3099b90f236SRuslan Ermilovservice with local SPD daemon.
3109b90f236SRuslan ErmilovIf local SDP daemon is not running the
31113706e45SMaksim Yevmenkin.Nm
31213706e45SMaksim Yevmenkinutility will exit with error.
3131a63eb31SJulian Elischer.Sh SEE ALSO
31472f00208SRuslan Ermilov.Xr rfcomm_sppd 1 ,
3151a63eb31SJulian Elischer.Xr ng_btsocket 4 ,
31613706e45SMaksim Yevmenkin.Xr ppp 8 ,
31713706e45SMaksim Yevmenkin.Xr sdpcontrol 8 ,
31813706e45SMaksim Yevmenkin.Xr sdpd 8
3191a63eb31SJulian Elischer.Sh AUTHORS
3201a63eb31SJulian Elischer.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
321