< Day Day Up > |
If you want to accept PPP connections from other IrDA-enabled devices, start pppd listening on the ircomm device that corresponds to your IrDA adapter (these devices are numbered ircomm N , where N is a number from 0 to one less than the number of IrDA adapters on your system). See Chapter 7. In most cases, you'll want more than just a PPP connection. If you want to connect to the Internet from the other device, you'll need your Linux box to act as a NAT router, and you'll also need to tell the PPP client device where it can find its name server. We've found that the following script works well (you may need to customize $LOCAL , $REMOTE , $DNS , $INTERFACE , and $IRDEV ): #!/bin/sh LOCAL=192.168.2.1 # IP address for the server running pppd REMOTE=192.168.2.2 # IP address for the device DNS=192.168.254.1 # A DNS server INTERFACE=wlan0 # Interface that connects to the network IRDEV=/dev/ircomm0 # Infrared device # Set up forwarding. # echo 1 > /proc/sys/net/ipv4/ip_forward /usr/sbin/iptables -t nat --flush /usr/sbin/iptables -t nat -A POSTROUTING -o "$INTERFACE" -j MASQUERADE # Start the PPP link. # /usr/sbin/pppd $IRDEV 115200 local \ $LOCAL:$REMOTE ms-dns $DNS \ silent noauth persist nodetach \ 8.4.1 Connecting from LinuxTo connect from another IrDA-enabled Linux device, align the infrared ports and then issue the following command: # pppd /dev/ircomm0 115200 usepeerdns local nodetach defaultroute You may need to bring down any existing network interfaces, because the defaultroute option generally does not override existing default routes. Some versions of Linux ship with a modified pppd that lets you use the replacedefaultroute option to replace any existing default route. 8.4.2 Connecting from Palm OSTo set up the connection to the Linux system:
Figure 8-5. Opening Network Preferences on the PalmFigure 8-6. Setting up a new network connection on the PalmTo connect, align the infrared ports of your Linux system and the Palm. Return to Network preferences, select the service you created in Step 3, and click Connect. When you are done with the network connection, return to the Network preferences and click Disconnect. To test out your connection, ping a remote host. To do this, stay in the Network preferences after the connection is made and select Menu Options View Log. Scroll to the bottom of the log, use Graffiti to write ping hostname and then use the Graffiti stroke for a carriage return (a diagonal stroke in the ABC region from upper right to lower left). If you've made the network connection successfully, you'll be able to ping a remote host, as shown in Figure 8-7. (Be sure that the remote host accepts pings and that your network does not block them). Figure 8-7. Pinging a remote host from the Palm8.4.3 Connecting from Pocket PCMaking a simple PPP connection is more complicated under the Pocket PC than under Palm OS. To set up the connection to the Linux system with Windows Mobile 2003.
Figure 8-8. Connection settings on the Pocket PC
Figure 8-9. Specifying general settings on the Pocket PC
Figure 8-10. Specifying port settings on the Pocket PCTo connect to the Linux system, align your infrared ports, and then:
Figure 8-11. Making the connection on the Pocket PC
Figure 8-12. The Manual Dial Terminal on the Pocket PCFigure 8-13. Confirming the connection on the Pocket PCYou can hide this notification and make it reappear by clicking its icon at the top of the screen. Use the Disconnect button to disconnect when you are finished. Test your connection by visiting a web site with Pocket Internet Explorer. |
< Day Day Up > |