Connecting your PalmPilot to the Internet
Using Linux, PPP, and IP Masquerading

Matt Welsh
Last updated 20 October 1998

This page is a tutorial on setting up your Palm Pilot to talk to the Internet, using Linux, PPP, and IP Masquerading. The idea here is that your Pilot is connected to a Linux box via a serial cable (such as the cradle), or perhaps through some other point-to-point serial connection. Moreover, the Pilot does not have an IP address of its own, so we use IP Masquerading, which allows the Pilot to use a "bogus" IP address, the packets for which are forwarded to the Internet by the Linux machine.

Here I use the ProxiWeb web browser as an example application --- this mechanism should work for any Pilot-based network application.

Pilot Setup:

  1. Download ProxiWeb from www.proxinet.com. Install the relevant files onto your Pilot.

  2. On the Pilot, go to Prefs->Modem. Select 'IBM WorkPad Modem'. Set speed to 38,400 bps. Ensure TouchTone is set.

  3. Go to Prefs->Network. Enter a bogus phone number in the 'Phone' field (I do this rather than use '00' which means 'no phone number'. This is to ensure that the PPP setup script used below works.)

  4. On Prefs->Network, select 'Details...'. Set connection type to PPP, timeout to power off. Deselect 'Query DNS' and enter the IP address 128.32.38.25 (barad-dur's IP address) as the Primary DNS server. For IP address, de-select 'Automatic' and enter your bogus IP address for the Pilot. I use 10.0.0.1 as an example here, many IP addresses can be used as long as they do not conflict with 'real' addresses on the Internet. Addresses in the range: can be safely used (from RFC 1597).

Linux machine setup:

  1. Recompile your kernel (I use 2.0.33) to include PPP support, firwalls, IP forwarding, IP firewalling, and IP masquerading. The relevant settings in your kernel .config file are:
      CONFIG_PPP=y
      CONFIG_FIREWALL=y
      CONFIG_IP_FORWARD=y
      CONFIG_IP_MULTICAST=y
      CONFIG_IP_FIREWALL=y
      CONFIG_IP_MASQUERADE=y
    
    Build and install the new kernel.

  2. Ensure that IP forwarding will be enabled on your machine by editing /etc/sysconfig/network and setting
      FORWARD_IPV4=yes
    
    This is the mechanism used under Red Hat 5.0. If you use another distribution you may simply need to execute, as root:
      $ echo 1 > /proc/sys/net/ipv4/ip_forward
    
    (This would be done once you have rebooted with the new kernel, of course.)

  3. Install ipfwadm which can be obtained as a prebuilt RPM package from here. Install it as root with
      $ rpm -ivh ipfwadm-2.3.0-6.i386.rpm
    

    This requires GNU libc so the binary should run on any machine with those libraries. If you don't use Red Hat you can obtain the binary (install it as /sbin/ipfwadm with permissions 0755) from here.

  4. As root, run the commands:
      $ ipfwadm -F -p deny
      $ ipfwadm -F -a accept -m -S 10.0.0.1
    
    This instructs the kernel to masquerade the IP address 10.0.0.1 over the network as your host's IP actual IP address.

  5. Ensure that the stty settings for the Pilot cradle (or modem, or whatever) are correct. I use:
      $ stty 38400 < /dev/cua0
      $ stty sane < /dev/cua0
    

    The output of stty -a < /dev/cua0 should be:

    speed 38400 baud; rows 0; columns 0; line = 0;
    intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ;
    eol2 = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
    lnext = ^V; flush = ^O; min = 1; time = 0;
    -parenb -parodd cs8 hupcl -cstopb cread clocal crtscts
    -ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
    -iuclc -ixany imaxbel
    opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
    isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
    echoctl echoke
    

    If you have problems later on it is VERY likely that your stty settings are at fault!

  6. Run this Perl script as root, with one argument -- the IP address of your Linux machine on the Ethernet. Edit the script first and modify the value of $remoteip to be the bogus IP address you have selected.

    For example, run the script as:

      $ ppup 128.32.44.56
    
    It looks like you need to re-run this script every time the PPP connection needs to be reestablished (for example, when the Pilot powers off). While browsing you might want to disable the power-off timeout of your Pilot.

  7. Now, on the Pilot, go ahead and start up ProxiWeb and try to open up a page (like www.yahoo.com). The Pilot should prompt you to open a connection to the proxy; go ahead and do this, keep your fingers crossed, and hope it works.

Some debugging tips:

Best of luck!


M. Welsh mdw at cs dot berkeley dot edu