Enabling NAT (make a gateway)
Syncing your Palm
Connect your Palm to
internet via Bluetooth with Fedora Core 3 (deprecated)
Enabling NAT
In order to let other devices (PC, handheld) to connect to internet
through a linux box, you need to turn it into a gateway.
Pasting the
following into a script and running it will do the job:
OUTETH=eth0
OUTIP=1.2.3.4
iptables -t nat
-F; iptables -t mangle -F
iptables -t
nat -A POSTROUTING -o $OUTETH -j SNAT --to $OUTIP
echo 1 >
/proc/sys/net/ipv4/ip_forward
#Basic security options not to trust
iptables -A
INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A
INPUT -m state --state NEW -i ! $OUTETH -j ACCEPT
iptables -P
INPUT DROP
iptables -A
FORWARD -i $OUTETH -o $OUTETH -j REJECT
Remeber to replace the OUTETH value with your internet interface (eth0,
ppp1), and the OUTIP address you have been assigned.
This was taken from the Masquerading-Simple-HOWTO
form The Linux Documentation Project (TLDP).
Then configure the other PCs to use the gateway as gateway ;-)
WARNING: this pitables configuration is quiet basic, don't trust it.
Read iptables manual for more and have a look at TLDP's network section.
Syncing your Palm
The main problem is to get the USB Palms to Sync. That's because the
/dev/ttyUSB0 and /dev/ttyUSB1 devices created and available only after
HotSync button has bee pressed, and dissapear as soon as the operation
ends or fails. This devices are mannaged by the
udev
system.
To make it quick:
- Find the line where pilot device is in the /dev/idev/permissions.d/50-udev.permissions
and set permissions to 0666 so it ends up like
this: pilot:root:uucp:0666. If you don't have
Fedora Core 3, you may find this line in another file. If you don't,
just write it wherever you want, even a new file, in this directory.
This will set the permissions every time the devices comes in.
- Now in the /etc/udev/rules.d/
directory create a file (I used 60-pilot.rules)
with the following line: KERNEL="ttyUSB0",
SYMLINK="pilot".
If you wan't to know how this works have a look at udev manpage (
just type man
udev).
After that you can sinchronize by pressing the button on the cradle
and:
- The first time you should backup everything with pilot-xfer -b
target_dir
- Running pilot-xfer
-s target_dir (where target dir is where
everithig goes to)
OR
- Runnig jpilot and Sinchronize
See pilot-xfer man page.
Connect your Palm
to internet via Bluetooth with Linux (deprecated)
DEPRECATION NOTE: it is quiet easy to do this, at least with Fedora (6
and up, at least).
NOTE FOR NON FEDORA USERS: If you don't have Fedora Core, you may still
follow this instructions but you may have to download some software,
and find files that may be in diferent locations than stated here.
This is quick instrucion sequence to get your Bluetooth enabled Palm
(actually only TT has been proved) to internet using a bluetooth
adapter (I have a Belkin F8T001 USB BT adapter).
You will need to have the following packages installed:
You will also need the rfcomm module, that already comes with the
kernel, so if you have not rebuild your kernel you should already have
it. If you don't know what I'm talking about, nevermind you are ready.
You need to be root to do this.
Let's get it working
First you need a working BT adapter, working on your PC.
To find out if it is working run the following command:
hciconfig -a
you will see something like this
hci0: Type: USB
BD Address: 00:0A:3A:58:BB:B5 ACL MTU: 192:8 SCO MTU: 64:8
DOWN
RX bytes:62806 acl:1278 sco:0 events:1916 errors:0
TX bytes:277634 acl:2326 sco:0 commands:23 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
that means you have a
working HCI device
Next you need a few services running:
- hcid: controls the HCI interfaces, including security and device
name.
- sdpd: allows Bluetooth devices to advertise services.
- dund: simulates a dialup connection via BT, and launches pppd.
- pppd: makes the connection.
If you have a look at Fedora's /det/init.d/bluetooth file, you'll see
some more programs getting executed, but those are not necesary here.
The first two daemons can be launched just by tiping the names, they
need no arguments here. To change the PIN edit :
/etc/bluetooth/pin
pppd will need some arguments, you can write them on the console, or
save the to file (recomnded):
debug
115200
# IP address of PC : IP address to
be assigned to Palm
192.168.2.1:192.168.2.2
ktune
noauth
local
nodefaultroute
noipx
Just copy these and paste into a file, e.g
/etc/ppp/peers/dun
you could change the IP addresses but
the not mandatory.
Then do this:
hcid
sdpd
dund -s call dun
where the last
parameter, dun, is the name of the
file you saved under the peers directory.
At this point
your computer is ready to recieve BT connections. To let the Palm go
through the PC to the internet you need NAT enabled.
You need an apropriate BT connection.
Go to Preferences->Bluetooth