Talk is cheap, show me the code
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
This section gives me most headache. But experience told me that this blog mostly contains personal ramblings related to daily life, open source, and web 2.0. Recently, it turns out to be an idea-box where you can found ideas you can execute in your new startup ;). My ideas and opinions are not bullet proof and never intended to be one way stream. Kindly participate to improve your and my perspective regarding any particular post. Welcome aboard and enjoy your stay
Leave a reply