
Nov 03, '02 09:22:12AM • Contributed by: kf6gpe
This work builds on this hint, which enables internet sharing at startup. Now we'll show how to configure a Mac OS X 10.2 system to act as a Bluetooth Internet access point for Palm Powered handhelds (and, presumably, other devices) that can use the Bluetooth Serial Profile to establish a PPP connection.
[Editor's note: This is a somewhat long and involved hint, and I have not tested it (as I don't have any Bluetooth devices). If you try it, please post a comment with your experiences and any corrections to what are probably my editing errors!]
Configuration
In developing this procedure, I used the following hardware:
- Power Macintosh G4 running Mac OS X 10.2
- Macintosh OS X compatible Bluetooth adapter
- Palm Powered handheld (Clie NR 70V/U)
- Palm compatible Bluetooth card (Sony PEGA-MSB1)
I've tested these instructions on a Power Macintosh G4 desktop with a dedicated ethernet connection and a Macintosh PowerBook G4 with an Airport connection. In both configurations the system operated as described.
Theory of Operation
Mac OS X provides Internet Routing functionality that lets Mac OS X route network packets between any two interfaces, such as the Ethernet and an Airport card. Fortunately, Mac OS X also includes pppd, a PPP server that can provide an Internet connection over a serial link.
Bluetooth, on the other hand, defines a series of connection types called profiles. One profile, the Serial Device Profile, is a mode that emulates a serial cable between two Bluetooth-enabled devices.
By using Mac OS X's Internet Routing with a PPP server over Bluetooth, a Mac OS X host can share its Internet connection with a Bluetooth-enabled device. The trick is to configure Mac OS X to use PPP over Bluetooth to listen for an incoming connection from the Bluetooth enabled device, and then use Bluetooth on the device to connect to the PPP server running on the Mac OS X box.
Basic Installation
Before you begin, you should ensure that your Palm Powered handheld can communicate with your Macintosh via Bluetooth. To do this:
- Install the Bluetooth drivers that come with your Palm Powered handheld's Bluetooth adapter according to the instructions that came with the adapter
- Install your Mac OS X Bluetooth adapter in accordance with the instructions that came with the adapter.
- Pair your Palm Powered handheld and Macintosh. On the Palm, select Preferences -> Bluetooth, touch Trusted Devices, touch Add Device, and select your Macintosh. Enter a PIN in the Palm, and enter the same pin on the dialog that appears on your Macintosh.
To configure your Macintosh, do the following:
- Install your Bluetooth adapter.
- Launch the Terminal.
- Edit /etc/hostconfig with your favorite text editor. You will need to use the sudo command to edit this file. Add an entry at the bottom looking like this:
ISHARING=-YES-
- Create a new startup items directory that will contain the commands to activate Internet Sharing and the PPP daemon on the Bluetooth interface on boot.
% cd /Library/StartupItems/
% sudo mkdir ISharing
% cd ISharing - Using your favorite editor and sudo, create the file ISharing with the following contents:
#!/bin/sh
Replace the address 10.0.1.201 with the address you allocated for your Palm Powered handheld.
. /etc/rc.common
##
# Start up Internet Sharing
##
if [ "${ISHARING:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Starting Internet Sharing"
/usr/libexec/InternetSharing
ConsoleMessage "Starting PPP/Bluetooth"
/usr/sbin/pppd /dev/tty.Bluetooth-PDA-Sync 115200
noauth local passive proxyarp asyncmap 0 silent persist
:10.0.1.201 &
fi
- Using sudo and your favorite text editor, create the file StartupParameters.plist with the following contents:
{
Description = "Internet Sharing";
Provides = ("ISharing");
Requires = ("Network", "NetworkExtensions", "Resolver");
OrderPreference = "Late";
Messages =
{
start = "Starting Internet Sharing";
stop = "Stopping Internet Sharing";
};
} - To ensure that the files you've created have the correct permissions and ownership, perform the following commands:
% sudo chmod 755 ISharing
% sudo chown root:wheel ISharing
% sudo chown root:admin StartupParameters.plist - Reboot your Macintosh.
% ps -ax | grep pppd | grep -v grepYou should see a line corresponding to the PPP server process.
Palm Powered Handheld Installation
Configuring your Palm Powered Handheld is fairly straightforward.
- Launch the Prefs application on your Palm Powered handheld.
- Select the Connection panel.
- Touch the New... button.
- Give the new connection a descriptive name such as Bluetooth to Macintosh.
- Set Connect to to PC.
- Set Via to Bluetooth.
- Touch the box labeled Tap to Find and select your Macintosh.
- Touch Details....
- Set Speed to 115,200 bps.
- Set Flow Ctl to Automatic.
- Touch OK twice to return to the Connection panel.
- Select the Network panel.
- Choose the UUNet service. Rename it something descriptive, such as Bluetooth to Macintosh.
- Set Connection to the connection you just created previously in this section.
- Leave the User Name and Password entries blank.
- Touch Details... and ensure that Conection type is set to PPP and IP Address is checked. Uncheck Query DNS and enter the addresses of local Primary and Secondary DNS servers for your network.
- Set the Idle timeout to however long you'd like the connection to remain active before timing out.
- Touch Script... and make sure that the only entry in the script is End.
- Touch OK twice.
Food for Thought
- This technique should also work for sharing serial PPP connections via either a modem or a serial port such as a PC Card or USB serial adapter.
Simply replace the entry /dev/tty.Bluetooth-PDA-Sync on the line invoking pppd in ISharing.
- Because the PPP server listens for connections on /dev/tty.Bluetooth-PDA-Sync, you cannot HotSync your Palm via Bluetooth while the PPP server is running.
- Bluetooth and 802.11b wireless networks appear to coexist quite well, despite concerns expressed by many to the contrary. I am using a Power Macintosh G4 in our office as a Bluetooth access point for my Clie, while most of our office's computers use 802.11 from an Airport sitting directly above the Power Macintosh G4. I've seen little difference in either 802.11 or Bluetooth range with only one or the other of the wireless networks running in comparison when both networks are operational.
I offer the following information to you free of charge with the understanding that I do not make any warranty, express or implied, regarding this procedure, including fitness for a particular purpose.