Thursday, 13 April 2006

Share internet between Mac and Newton via Bluetooth

Earlier today I was checking out the new me ages in my NewtonTalk mailing list when I came acro a very cool how-to pe ed by Panic's own Steven Frank. ecifically, he described the method he has used to get his Mac (ru ing OS 10.4) to share its internet co ection with his Newton me age pad over Bluetooth (Newton Bluetooth drivers and ecifics here). So, whenever the Newt is within 30 feet or so of the Mac, it's surfing the web, checking email, streaming internet radio, all wirele ly over Bluetooth. Awesome.

With his permi ion, we're able to reprint the tutorial here. Please note, as Steven states, that the tutorial a umes you have several things already in place (like a functioning Bluetooth setup), as getting it to work i 't for the faint-hearted, and if your Newton and/or Mac explode after trying this, well, neither Steven nor TUAW is re o ible. That said, on to the goods after the jump.

Thanks again, Steven!
It is a umed that you already have worked out the kinks in your
Newton Bluetooth setup. You should be paired with the Mac, and have
done a service discovery. Make sure you select the Mac's Serial Port
service in the Newton's Bluetooth Setup (there was only one in my
case).

Next, you'll need to go to Terminal on the Mac, and carefully enter
these commands.

sudo /usr/ in/sysctl -w net.inet.ip.forwarding=1

sudo /usr/ in/natd -interface en1 -use_sockets -same_ports -dynamic -
clamp_m

(Note the "en1" here. If your Mac is co ected to the internet using
AirPort, use en1. If it's co ected using Ethernet, use en0 here
i tead.)

sudo / in/ipfw add divert natd ip from any to any via en1

(Same deal with the "en1" here.)

sudo named

sudo named

(I'm not sure this has to be done twice. One site I was reading
suggested it.)

sudo /usr/ in/ d /dev/tty.Bluetooth-PDA-Sync 230400 noauth local
pa ive proxyarp asyncmap 0 silent persist :10.0.1.111

This starts a server on the Bluetooth-PDA-Sync serial port. Note
the IP addre here. I've used 10.0.1.111. This will be the addre
a igned to your Newton.

This can be anything you like, but it should be a valid IP addre
for your LAN. If you use, for example, 192.168 addre ing, you
should use a 192.168.0.x addre i tead. Make sure it's not an
addre that's in use by something else!

Now, you need to set up an internet co ection on the Newton side!
Whew!

Create a new Internet Setup called whatever you like.

Protocol:
Configuration: Manual
User ID: %26lt one>
When closing, disco ect:
Local IP Addre : (whatever IP addre you used in the d command
above!)
Gateway/Router Addre : (the IP addre of the machine that's sharing
its co ection -- in my case, the Mac. NOT the addre of your
actual router!)
Primary D : seem to cut it.)
Secondary D :
Domain Name: %26lt one>

Now, cro your fingers, and initiate a network co ection from the
Newton. With a little luck, it should co ect to the server
ru ing on your Mac, and get online.

When you are all done, and you want to turn off the internet sharing
on the Mac, try the following commands:

sudo killall d
sudo killall named
sudo / in/ipfw -f flush
sudo killall natd
sudo /usr/ in/sysctl -w net.inet.ip.forwarding=0

A few notes:
1. I've only tried this on Mac OS X 10.4 Tiger

2. At one point I went into the Bluetooth system preferences pane,
Sharing tab, and changed the Bluetooth-PDA-Sync serial port from
"Modem" to "RS-232". I'm not sure if this is required, but it's
something to try if it doe 't work for you.

3. Because this ru a server on the Bluetooth-PDA-Sync port, it
will conflict with anything else that tries to use that port, such as
Palm HotSync.

No comments:

Post a Comment