Geek Building The Bridge Part 2 / 804 posts / 1,947 comments / feed / comments feed

Bluetooth PAN

I’ve been desperately trying to enable PAN (Personal Area Network) for several days. There’s one time I made it and the other were screwy days.

I found the secret recipe today. Or I suppose so. To be able to make Windows (XP) connect to Linux Bluetooth PAN/NAP, make sure you’ve chosen “Allow to make private network connection” and not the “Allow to connect to LAN/Internet” on your Bluetooth Configuration Dialog. This configuration finally allows me pair Windows box with my Linux box, and happily ping it. Removing that configuration apparently will prevent Network Access Point connection from Windows box.

Basically we need to start PAN daemon, there are many ways you can found via google. I choose setting up PAND_OPTIONS via /etc/default/bluetooth, ie: PAND_OPTIONS=”–listen –role NAP –master –devup /etc/bluetooth/pan/dev-up”

And then putting these lines in /etc/bluetooth/pan/dev-up

#!/bin/sh
echo 1 > /proc/sys/net/ipv4/ip_forward
ifup bnep0
sleep 2 # this is still problematic as dhcp3-server may have been started before bnep0 is ready
/etc/init.d/dhcp3-server restart

Also (trying) to autoconfigure iptables via /etc/network/interfaces. Related to above dev-up script, these configuration doesn’t seem to be loaded as bnep0 always up with no ip. Thus I need to ifdown bnep0 and the ifup bnep0, and finally restarting dhcp3-server (plus refreshing Windows bnep IP address — via Repair button)

#bluetooh icsiface bnep0 inet static          address 10.0.0.1          netmask 255.255.255.0

post-up iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -j MASQUERADEpost-up iptables -A FORWARD -i bnep0 -o eth0 -j ACCEPTpost-up iptables -A FORWARD -o bnep0 -i eth0 -j ACCEPTpre-down /etc/init.d/dhcp3-server stop

The traffic log via wireshark illustrates no problem are happening between Windows box and Linux box, but my Linux box seem to be unable to forward the traffic from my PAN my LAN. DNS request are recorded to my local router but there’re no replies. Checking from cmd on Windows box, there’s no ping reply from my LAN router.

I’m pretty much n00b with networking, further more iptables :p

Powered by ScribeFire.

Sphere: Related Content

No comments

Leave a comment

« Back to text comment