View Single Post
Wasmachinemann-NL's Avatar
Posts: 386 | Thanked: 1,094 times | Joined on Aug 2011 @ Netherlands
#11
Originally Posted by biketool View Post
are you using kernel power or CSSU-thumb?
Bluetooth PAN should have been packaged into a .deb and put onto the repos or just part of CSSU upgrades six years ago, but what in this would interrupt booting?
Do you have backupmenu installed where reinstall is easy over USB? You could also use backupmenu to access the filesystem over USB and remove or fix the script files.
anyways when you are back installed follow the link
https://wiki.maemo.org/Bluetooth_PAN
and start after it mentions Genwall which you do not really need, the scripts and iptables do it all.

Sharing your connection over bluetooth [n900]


Using udev to automatically setup internet connection sharing over bluetooth comes now.


A kernel with iptables support is needed,

Kernel Power is the recommended way to achieve this. see Kernel Power for installation details.

The default kernel with CSSU-thumb is also suitable.


Install the iptables package:

Code:
apt-get install iptables
create the following 2 files:

/etc/udev/rules.d/98-bnep0.rules:

Code:
ACTION=="add", SUBSYSTEM=="net",  KERNEL=="bnep0", RUN+="/etc/udev/bluenet.sh"
ACTION=="remove", SUBSYSTEM=="net",  KERNEL=="bnep0", RUN+="/etc/udev/bluenet.sh"
/etc/udev/bluenet.sh:

Code:
#! /bin/sh
if [ $ACTION = "add" ]; then 
	echo 1 > /proc/sys/net/ipv4/ip_forward
	iptables -t nat -A POSTROUTING ! -o lo -j MASQUERADE
	ifconfig bnep0 192.168.3.1
	ifconfig bnep0 up
	/usr/sbin/dnsmasq -I lo -z -a 192.168.3.1 -F 192.168.3.64,192.168.3.127 -x /var/run/dnsmasq.pid.bnep0
else
	iptables -t nat -D POSTROUTING ! -o lo -j MASQUERADE
	if [ -f /var/run/dnsmasq.pid.bnep0 ]; then
		DNSMASQ_PID=`cat /var/run/dnsmasq.pid.bnep0`
		rm -f /var/run/dnsmasq.pid.bnep0
		kill $DNSMASQ_PID
       fi
fi
then set /etc/udev/bluenet.sh as executible:

Code:
chmod +x /etc/udev/bluenet.sh
now whenever an authorised remote device makes a bluetooth pan (nap) connection iptables and dnsmasq are setup to allow that device access to the phones network. TODO: when no internet connection is active ask to set it up
I got bored tonight and thanks to this I managed to setup Bluetooth PAN, thank you biketool!
 

The Following 2 Users Say Thank You to Wasmachinemann-NL For This Useful Post: