maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC) (https://talk.maemo.org/showthread.php?t=58570)

9000 2010-07-16 08:24

[HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
1 Attachment(s)
1 Background

Tethering is the use of a mobile device such as a mobile phone to supply Internet access for another device. The following is to show you how to make N900 to supply Internet access to a PC via Bluetooth-PAN (Personal Area Network). This is the reverse idea of Bluetooth PAN: Tethering N900 from another phone.

There're already three commonly used tethering methods around: USB tethering (Nokia PC-Suite), WiFi hotspot (Mobile Hotspot, Joikuspot) and Bluetooth DUN (Dial-Up Network, bluetooth-dun). The advantages and disadvantages to use Bluetooth-PAN are as listed in next section.

2 Advantages and Disadvantages

2.1 The advantage of Bluetooth-PAN tethering:

2.1.1 Bluetooth-PAN doesn't require cable as in USB tethering
2.1.2 Bluetooth-PAN consumes much less battery power than WiFi hotspot, even when setting WiFi power to 10mW (Most important factor in my opinion)
2.1.3 Bluetooth-PAN is supposed to be faster than Bluetooth-DUN
2.1.4 The tethering method of Bluetooth-DUN might not work with some mobile carriers

2.2 The disadvantage of Bluetooth-PAN tethering:

2.2.1 Not all mobile devices supports Bluetooth-PAN, though PC and Mac are usually supported
2.2.2 The effective distance of use is shorter than Wifi
2.2.3 No security implementation (but WiFi's WEP is next to nothing anyway, see aircrack-ng)
2.2.4 Peer-to-Peer connection (verse one-to-many connection in Wifi Hotspot)

3 Prerequisites

3.1 Install rootsh
3.2 Install Kernel Power (or any other kernel that support iptables)
3.3 Install iptables
3.4 Install pc-connectivity-manager - Tablet PC-Connectivity Manager
3.5 Install bluezwitch (Optional)
3.6 Turn off WiFi, unless you're very familiar with IP routing

4 Detail Instructions

4.1 Pairing PC and N900 as Bluetooth-PAN

Pairing Bluetooth-PAN is as easy as pairing a bluetooth headphone.

4.1.1 (On N900) Switch on Bluetooth in N900 and make it search-able
4.1.2 (On PC) Discover the Bluetooth device, define a password and then pair up
4.1.3 (On PC) Join the Personal Area Network. The joining method depends on your Bluetooth device, e.g. EagleTec Bluetooth USB will has an icon on the taskbar on which PAN can be found by right clicking it. You mileage may vary.
4.1.4 (On PC) You might require to choose among PANU, GN or NAP under PAN. You should choose NAP, but it actually makes no difference for our purpose.

4.2 Setup IP network for client (PC or Mac)

After pairing up, and the PAN between your PC and N900 is established, then you should setup an IP network on top of it.

4.2.1 A Bluetooth Network Connection should appear in the Connection Setting of your PC (or Mac). Setup the network with the following information: Choose to acquire IP and DNS automatically from the server. (Thanks to mauron85's suggestion)


Code:

IP: 192.168.3.2
Netmask: 255.255.255.0
Gateway: 192.168.3.1
DNS: 192.168.3.1



4.3 Setup IP network for server (N900)

4.3.1 Create a script under /home/user/ and save it as bluetooth-pan-tethering.sh

Code:

#!/bin/sh

# by 9000 @ talk.maemo.org

# Prompt you to select the Internet connection. You may choose gprs or wifi
run-standalone.sh dbus-send --system --type=method_call --dest=com.nokia.icd_ui /com/nokia/icd_ui com.nokia.icd_u

# Selecting and establishing connection takes time
sleep 10

# Verbose mode. You can remove it when you're using widget to activate this script

set -x

IP_ADDR="192.168.3.1"
NETMASK="255.255.255.0"
DHCP_RANGE="192.168.3.100,192.168.3.127"
RUNFILE="/var/run/btpan_tethering.pid"
DNSMASQ="/usr/sbin/dnsmasq"

# Load modules
modprobe ipt_MASQUERADE

# flush old rules
iptables -F
iptables -t nat -F

iptables -t nat -A POSTROUTING -o gprs0 -j MASQUERADE

# forward IPs
echo 1 > /proc/sys/net/ipv4/ip_forward

# Setup bnep0
ifconfig bnep0 down
ifconfig bnep0 up
ifconfig bnep0 $IP_ADDR netmask $NETMASK up

# Setup DNS and DHCP
start-stop-daemon -S -p $RUNFILE -m -b -x $DNSMASQ -- -k -I lo -z -a $IP_ADDR -F $DHCP_RANGE -b

run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:'Bluetooth PAN Activated'

Note that if your N900 is connecting to Internet via WiFi(wlan0) instead of GPRS(gprs0), you must change the "iptables" command above accordingly.

(Note to users in talk.maem.org: you may also download the tarball attached and extract it under /home/user/ in xterminal)

4.3.2 Make the script executable

Code:

chmod u+x /home/user/bluetooth-pan.sh
4.3.3 Run the script with root privilege

Code:

echo "/home/user/bluetooth-pan.sh" | sudo gainroot
The script will first ask you to establish the Internet connection. Choose your Internet service provider or WiFi.

Wait 10 second until you see "Bluetooth PAN Tethering Activated". Now you PC can access the Internet via your N900's Internet Connection.


5 Troubleshooting

5.1 DNS - in Step 4.2.1 points the DNS to 192.168.3.1, expecting the N900 answers to your DNS queries. However, if that doesn't work for you:
5.1.1 Add an DNS entries into the /etc/resolv.conf, the following is an example of the resolv.conf using Google Public DNS, you may enter the DNS of your Internet service provider:

Code:

nameserver 127.0.0.1
nameserver 8.8.8.8
nameserver 8.8.4.4

5.1.2 OR you may enter the DNS server address provided by your Internet Service Provider directly into the client.

5.2 After pairing up the PC and N900 in Step 4.1, a bnep0 device should appear in N900. There's a chance that bnep0 device was not created automatically. You may use the following command under Xterminal of N900 to verify:

Code:

sudo ifconfig bnep0
If bnep0 did not appear after pairing up, you may try reconnecting PAN with different profiles like PANU or GN in Step 4.1.4 instead of NAP, until bnep0 appears.

Reinstall libicd2 if you still couldn't find your bnep0 (JadeH)
Code:

apt-get install libicd2 --reinstall
5.3 The module ipt_MASQUERADE isn't loaded after upgrading to kernel-power v47

The module works fine in v46. Downgrade your kernel-power. (at your own risk)

6 References
6.1 Bluetooth PAN: Tethering N900 from another phone: http://talk.maemo.org/showthread.php?t=37710
6.2 HOWTO : Bluetooth Tethering with Nokia N900 (by DUN): http://syntacticsugar.nl/2009/12/03/...th-nokia-n900/
6.3 HowTo set up common PAN scenarios with BlueZ's integrated PAN support: http://bluez.sourceforge.net/contrib/HOWTO-PAN


7 Feedback
Please send me feedback or suggestion so that I can improve the steps.

EDIT: Inserted 3.3. It seems that pc-connectivity-manager is essential for PAN to work for most configuration.
EDIT: Attached the tarball of the script in 4.3.1
EDIT: Added procedures to setup sudoers added under 4.3.3
EDIT: Inserted 3.3 for iptables installation. It is now a standalone package that need to be installed explicitly.
EDIT: Added 3.6 such that WiFi will not get in the way of PAN routing
EDIT: Removed the method to setup sudoers in section 4.3.3, and directly run as root, to make the procedures simpler
EDIT: Added iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
(commented) in the script 4.3.1 for internet via WiFi instead of GPRS.
EDIT: Thanks to mauron85's suggestion in setting up DHCP and DNS. Main script in 4.3.1 modified.
EDIT: Troubleshooting updated (JadeH)
EDIT: dnsmasq will not run as daemon. Script edited. Use network 192.168.3 instead of 192.168.1 as the latter is used by WiFi
EDIT: ipt_MASQUERADE isn't loaded after upgrading to kernel-power v47

Megaltariak 2010-07-16 09:58

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Thanks, for me, USB native tethering, bluetooth DUN and mobilehotspot stop working after 20 minutes, maybe that I will have more luck with that one :)

9000 2010-07-16 10:43

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by Megaltariak (Post 753710)
Thanks, for me, USB native tethering, bluetooth DUN and mobilehotspot stop working after 20 minutes, maybe that I will have more luck with that one :)

Actually that's what drove me to get bluetooth-pan working.

I've encountered the same disconnection problems with some old WiFi routers and CISCO WiFi USB dongle, etc. Other newer WiFi routers or PCI WiFi card works fine with N900, though.

After investigating the logs I found out it has something to do with the power-saving. However, turning off the power-saving mode of WiFi in N900 doesn't seem to completely solve the problem. I managed to resolve some of them by updating those old WiFi routers with latest firmware, but without luck with some obsolete devices.

I tried Bluetooth-DUN (as in the references), but cannot connect to my ISP through it.

I hope Bluetooth-PAN would help. Please feedback if you had tried. Thanks.

Megaltariak 2010-07-16 21:07

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Ok, so I tried:
On Ubuntu: It seem that there is no native Bluetotooth PAN support, it is surely a solution but I have not the head for that ATM.
On XP with WIDCOMM Bluetooth Software: It seem that it support PAN but it is not listed on N900 supported services when I scan it so I can't use PAN with N900.

DaSilva 2010-07-16 21:23

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Thanks for that!
Would it possible for you to package that script with an icon and upload it to extras-devel?

9000 2010-07-17 06:51

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by Megaltariak (Post 754314)
Ok, so I tried:
On Ubuntu: It seem that there is no native Bluetotooth PAN support, it is surely a solution but I have not the head for that ATM.
On XP with WIDCOMM Bluetooth Software: It seem that it support PAN but it is not listed on N900 supported services when I scan it so I can't use PAN with N900.

You need pand in Ubuntu, I hope this help: http://ubuntuforums.org/showthread.php?p=8995803

WIDCOMM deliberately removed PAN profile from its driver for Vista, but driver for XP definitely works. You might have used a version of the driver that has PAN removed. For example, the following instructions is to build PAN with WIDCOMM: http://www.whizoo.com/bt_setup/

I don't know why WIDCOMM decided to remove PAN profile from driver for Vista, even WM has PAN setup, so I guess PAN is not an obsolete thing.

9000 2010-07-17 06:53

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by DaSilva (Post 754337)
Thanks for that!
Would it possible for you to package that script with an icon and upload it to extras-devel?

When I finish my book I'll spare time to do that. Thanks. ^^

jonchew 2010-07-19 01:24

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Hi! just a quick question..can a pc share internet connection to n900 (via bluetooth)?

9000 2010-07-19 01:36

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by jonchew (Post 756272)
Hi! just a quick question..can a pc share internet connection to n900 (via bluetooth)?

Yes of course. If you're using Windows 7 it's supported by default, just create a wifi profile with sharing. If you're using XP you can install Connectivity. The concept of PAN is as simple as join a LAN. If your LAN allow Internet connect via a gateway, you can always point to that gateway in N900 to access to the Internet.

It requires a bit of setup effort but you can find the detail in previous discussion in talk.maemo.org. Hope this help.

chrisp7 2010-08-14 22:45

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Im trying to set this up for my ipad. I find the wifi hotspot programmes really unreliable.

Im having a couple of issues with the installation. I have skipped steps 4.1 to 4.3 as Im assuming the DUP application on the ipad covers this?? However the issue is - I have created the script "bluetooth-pan.sh" ie saved the scriped in notepad and renamed it to bluetooth-pan.sh.
Copied it into the correct folder over SSH. Then in terminal at step 4.3.2 have typed in the code but nothing seems to happen, the same for 4.3.3. I have tried both in root and both not.
Do you have any idea what I could be doing wrong?

PS I have the latest power-kernel installed and bluetooth 'on'.

9000 2010-08-15 05:54

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by chrisp7 (Post 786606)
Im trying to set this up for my ipad. I find the wifi hotspot programmes really unreliable.

Im having a couple of issues with the installation. I have skipped steps 4.1 to 4.3 as Im assuming the DUP application on the ipad covers this?? However the issue is - I have created the script "bluetooth-pan.sh" ie saved the scriped in notepad and renamed it to bluetooth-pan.sh.
Copied it into the correct folder over SSH. Then in terminal at step 4.3.2 have typed in the code but nothing seems to happen, the same for 4.3.3. I have tried both in root and both not.
Do you have any idea what I could be doing wrong?

PS I have the latest power-kernel installed and bluetooth 'on'.

Your valuable suggestion pointed out what was missing from the procedures:

1) Install pc-connectivity-manager
2) The script cannot be created under notepad, it should be done directly under xterminal
3) Setup sudoers

For 1) I've installed pc-connectivity-manager long time ago, I didn't realize it may be essential to the bluetooth PAN. I added it back in procedure.

For 2) notepad would introduce some ^M characters in the transfer.

It doesn't matter. I've attached a tarball which contain the script bluetooth-pan.sh. You can download the tarball, put it under /home/user/, run the following command to extract it:

Code:

tar xvf bluetooth-pan.tar
then cat /home/user/bluetooth-pan.sh, you should see the content.

For 3) I found that sudoers might not by default having all the privilege granted to user. That's good, as it's more secure. Therefore, you might need to add the following files bluetooth-pan.sudoers under the /etc/sudoers/ (as root)

Code:

user ALL = NOPASSWD: /home/user/bluetooth-pan.sh
and then update the sudoers as root:
Code:

update-sudoers
I've also attached this file in the tarball.

The above has been updated in the procedures.

Thank you for your suggestion. Please let me know when you've further query.

DaSilva 2010-08-15 10:55

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by 9000 (Post 754636)
When I finish my book I'll spare time to do that. Thanks. ^^

So what is the progress with your book? ;)

9000 2010-08-15 14:52

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by DaSilva (Post 786885)
So what is the progress with your book? ;)

I might need to go deep down the forth layer of my dream where I might be able to find enough time to finish it XD

chrisp7 2010-08-15 20:57

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by 9000 (Post 786755)
Your valuable suggestion pointed out what was missing from the procedures:

1) Install pc-connectivity-manager
2) The script cannot be created under notepad, it should be done directly under xterminal
3) Setup sudoers

For 1) I've installed pc-connectivity-manager long time ago, I didn't realize it may be essential to the bluetooth PAN. I added it back in procedure.

For 2) notepad would introduce some ^M characters in the transfer.

It doesn't matter. I've attached a tarball which contain the script bluetooth-pan.sh. You can download the tarball, put it under /home/user/, run the following command to extract it:

Code:

tar xvf bluetooth-pan.tar
then cat /home/user/bluetooth-pan.sh, you should see the content.

For 3) I found that sudoers might not by default having all the privilege granted to user. That's good, as it's more secure. Therefore, you might need to add the following files bluetooth-pan.sudoers under the /etc/sudoers/ (as root)

Code:

user ALL = NOPASSWD: /home/user/bluetooth-pan.sh
and then update the sudoers as root:
Code:

update-sudoers
I've also attached this file in the tarball.

The above has been updated in the procedures.

Thank you for your suggestion. Please let me know when you've further query.

Thats great, thanks v v much for the help.

So I have installed the pc-connectivity manager, put the tar in /home/user and extracted it in terminal as you instructed.

I then try this command: chmod u+x /home/user/bluetooth-pan.sh

but it doesnt seem to 'do' anything. I tried it as root and not as root.

Also when I try the next command (as root):

user ALL = NOPASSWD: /home/user/bluetooth-pan.sh

it says /bin/sh: user: not found

Does that mean anything to you!?

9000 2010-08-15 23:28

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
The second script is the content of the file /etc/sudoers.d/bluetooth-pan.sh you should create and you should run update-sudoers for it to take effect such that sudo bluetooth-pan.sh work.

It is strange that the script doesnt work under root, probably wrong path. You may want to check the correct path of the file, i.e.

Code:

root
sudo /home/user/bluetooth-pan.sh

You may refer to latest version of the script for detail procedures. Tell me again what I missed.

WorldKaoss 2010-08-16 01:43

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
it doesn't work for me :( when I run the sudo /home/user/bluetooth-pan.sh nothing happens.

the first time I created the files in notepad, uploaded them in the right folders, chmoded them, updated the sudoers and it was the same... after that I used the files in the tar and made the same things .. restarted the device, still the same.

I must say from now that in settings, PC-Connectivity Manager is set on "None", should the "default" be enabled? what settings should I put in?

9000 2010-08-16 01:47

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by WorldKaoss (Post 787531)
it doesn't work for me :( when I run the sudo /home/user/bluetooth-pan.sh nothing happens.

the first time I created the files in notepad, uploaded them in the right folders, chmoded them, updated the sudoers and it was the same... after that I used the files in the tar and made the same things .. restarted the device, still the same.

I must say from now that in settings, PC-Connectivity Manager is set on "None", should the "default" be enabled? what settings should I put in?

The setup of sudoer is only for your convenient, if this doesn't work for you, try enter root and run the script directly.

Code:

root
sh /home/user/bluetooth-pan.sh


WorldKaoss 2010-08-16 02:43

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
now this is what I get -> http://img823.imageshack.us/img823/1412/69583474.png

however I have installed the extended kernel (setting) and (general) and I rebooted the device .. and as I know iptables is in that kernel. Also I tried to search in the App Manager for iptables and it isn't listed, what should I use to install it? apt-get install iptables?

9000 2010-08-16 02:50

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
I see...the iptables is missing. May be it's not installed by default.

In this case I think you should install iptables.

Code:

root
apt-get install iptables

I'll add that part back in the prereq. of the procedures, thanks for your feedback.

Besides, I notice that the script run fine, so you should see a menu for choosing internet connection at the beginning. Did you see that?

WorldKaoss 2010-08-16 03:13

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
it's weird because it doesn't pop up to select a connection (I tried connected to wifi and disconnected, to see) but I get the notification in that yellow field with "Bluetooth PAN Activated".

Also, I've tried connecting to the internet after pairing the pc with phone (and I've set up the IP manually on the PC) and it still doesn't work.

If you find the bug that isn't showing the connection choser let me know, I'm really interested in this and I would like to help you fix it by providing feedback.

thanks for the help

9000 2010-08-16 03:20

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
If you can pair them up then you're 80% success.

Did you join PAN on client side? It must be done after pairing up. You may see bluetooth has lots of function, it doesn't activate all functions by default, you need to trigger it manually on client side.

Also, depends on some client platform, you need to activate the script *after* client pairing up and join PAN.

In your case, please follow:

1) Pair up Bluetooth
2) Join Bluetooth PAN on client side
3) Choose Internal connection manually on N900
4) Activate the script on N900
5) Setup DNS on client (as shown the the procedure)
6) ping yahoo.com, or browse the web directly on the client side to see it works

Hope this help.

WorldKaoss 2010-08-16 03:31

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
I am using Windows 7 with no software for my bluetooth (it came without) so I have the bluetooth device in Devices and Printers.

There I have the pairing with my N900 and I press Connect -> Direct Connection.

After it says "successful" in Network Connections the Bluetooth PAN shows "Connected to WorldKaoss", IP is set-up manually packets are sent but none recieved.

PC Connectivity in my settings (on the phone) by default was set on "None" so all the settings (Internet, Wlan, Bluetooth,etc) are disabled. Should I use the "Default" profile for the PC Connectivity Manager?

9000 2010-08-16 03:36

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by WorldKaoss (Post 787593)
I am using Windows 7 with no software for my bluetooth (it came without) so I have the bluetooth device in Devices and Printers.

There I have the pairing with my N900 and I press Connect -> Direct Connection.

After it says "successful" in Network Connections the Bluetooth PAN shows "Connected to WorldKaoss", IP is set-up manually packets are sent but none recieved.

PC Connectivity in my settings (on the phone) by default was set on "None" so all the settings (Internet, Wlan, Bluetooth,etc) are disabled. Should I use the "Default" profile for the PC Connectivity Manager?

You should select None in PC connectivity. I just make use of its PAN support only. No configuration on it is needed.

Make sure you don't have firewall (blah blah) blocking your way. Please show me the following outputs for investigation:

On client side:
Code:

ipconfig /all
route print

On N900 (after script is activated)
Code:

root
ifconfig bnep0
route
iptables -L -t nat
cat /proc/sys/net/ipv4/ip_forward


WorldKaoss 2010-08-16 03:52

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
ipconfig /all
Quote:

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\WorldKaoss>ipconfig /all

Windows IP Configuration

Host Name . . . . . . . . . . . . : WorldKaoss-PC
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection 2:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : TAP-Win32 Adapter V9
Physical Address. . . . . . . . . : 00-FF-22-5A-16-DA
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes

Ethernet adapter Bluetooth Network Connection:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Bluetooth Device (Personal Area Network)
Physical Address. . . . . . . . . : 11-11-11-11-11-11
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::4407:c5ba:5ccb:9aa%14(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.1.2(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
DHCPv6 IAID . . . . . . . . . . . : 252776721
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-13-D8-31-DF-00-1E-33-D9-9E-DA

DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
NetBIOS over Tcpip. . . . . . . . : Enabled

Wireless LAN adapter Wireless Network Connection:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Atheros AR5007EG Wireless Network Adapter

Physical Address. . . . . . . . . : 00-24-D2-D3-4A-24
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::d1bb:499b:9f3a:cd30%13(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.0.10(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : Sunday, August 15, 2010 3:27:15 PM
Lease Expires . . . . . . . . . . : Monday, August 16, 2010 7:41:09 AM
Default Gateway . . . . . . . . . : 192.168.0.1
DHCP Server . . . . . . . . . . . : 192.168.0.1
DHCPv6 IAID . . . . . . . . . . . : 234890450
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-13-D8-31-DF-00-1E-33-D9-9E-DA

DNS Servers . . . . . . . . . . . : 208.67.222.222
208.67.220.220
NetBIOS over Tcpip. . . . . . . . : Enabled

Ethernet adapter Local Area Connection:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Realtek RTL8102E/RTL8103E Family PCI-E Fa
st Ethernet NIC (NDIS 6.20)
Physical Address. . . . . . . . . : 00-1E-33-D9-9E-DA
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes

Ethernet adapter VirtualBox Host-Only Network:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VirtualBox Host-Only Ethernet Adapter
Physical Address. . . . . . . . . : 08-00-27-00-48-BD
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::287a:8e64:bf3c:55f3%30(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.56.1(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DHCPv6 IAID . . . . . . . . . . . : 738721831
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-13-D8-31-DF-00-1E-33-D9-9E-DA

DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
NetBIOS over Tcpip. . . . . . . . : Enabled

Tunnel adapter isatap.{449A6FED-3483-4A81-8FD3-67E8317D2482}:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes

Tunnel adapter Local Area Connection* 11:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Teredo Tunneling Adapter
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.{225A16DA-B328-4E81-A21F-90D764B89B54}:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.{187D96D0-31A0-49BA-AE91-CFCAD5BB9F76}:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.{9621A8B4-AD2F-4337-B427-8469910DBDBC}:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #5
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.{8A4EB57C-D2FB-4C61-9FE8-5EEE6015CE62}:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #6
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes

C:\Users\WorldKaoss>
route print:
Quote:

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\WorldKaoss>route print
================================================== =========================
Interface List
23...00 ff 22 5a 16 da ......TAP-Win32 Adapter V9
14...11 11 11 11 11 11 ......Bluetooth Device (Personal Area Network)
13...00 24 d2 d3 4a 24 ......Atheros AR5007EG Wireless Network Adapter
12...00 1e 33 d9 9e da ......Realtek RTL8102E/RTL8103E Family PCI-E Fast Ethern
et NIC (NDIS 6.20)
30...08 00 27 00 48 bd ......VirtualBox Host-Only Ethernet Adapter
1...........................Software Loopback Interface 1
21...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
11...00 00 00 00 00 00 00 e0 Microsoft Teredo Tunneling Adapter
17...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
22...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #3
24...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #5
34...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #6
================================================== =========================

IPv4 Route Table
================================================== =========================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.10 25
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.2 296
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
192.168.0.0 255.255.255.0 On-link 192.168.0.10 281
192.168.0.10 255.255.255.255 On-link 192.168.0.10 281
192.168.0.255 255.255.255.255 On-link 192.168.0.10 281
192.168.1.0 255.255.255.0 On-link 192.168.1.2 296
192.168.1.2 255.255.255.255 On-link 192.168.1.2 296
192.168.1.255 255.255.255.255 On-link 192.168.1.2 296
192.168.56.0 255.255.255.0 On-link 192.168.56.1 276
192.168.56.1 255.255.255.255 On-link 192.168.56.1 276
192.168.56.255 255.255.255.255 On-link 192.168.56.1 276
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.56.1 276
224.0.0.0 240.0.0.0 On-link 192.168.0.10 281
224.0.0.0 240.0.0.0 On-link 192.168.1.2 296
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.56.1 276
255.255.255.255 255.255.255.255 On-link 192.168.0.10 281
255.255.255.255 255.255.255.255 On-link 192.168.1.2 296
================================================== =========================
Persistent Routes:
Network Address Netmask Gateway Address Metric
0.0.0.0 0.0.0.0 192.168.1.1 Default
================================================== =========================

IPv6 Route Table
================================================== =========================
Active Routes:
If Metric Network Destination Gateway
1 306 ::1/128 On-link
30 276 fe80::/64 On-link
13 281 fe80::/64 On-link
14 296 fe80::/64 On-link
30 276 fe80::287a:8e64:bf3c:55f3/128
On-link
14 296 fe80::4407:c5ba:5ccb:9aa/128
On-link
13 281 fe80::d1bb:499b:9f3a:cd30/128
On-link
1 306 ff00::/8 On-link
30 276 ff00::/8 On-link
13 281 ff00::/8 On-link
14 296 ff00::/8 On-link
================================================== =========================
Persistent Routes:
None

C:\Users\WorldKaoss>
cat /.../... (blah blah) returns "1"

the rest from the n900 is here:
http://img191.imageshack.us/g/47073285.png/

9000 2010-08-16 04:01

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Man you've quite a lot of networks in one system you know that. ^^

First thing I saw is that the WiFi get in the way in the default routing:
Code:

0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.10 25
Such that the PAN (0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.2 296) is never reached.

To make the case more complicated, you've wifi routing activated in your N900, such that you've two default routes in your N900: (http://img190.imageshack.us/i/87881079.png/)

If you're not that familiar with tcp/ip routing, you should really turn off everything else before connecting to another network you've never got it worked.

Try again and let me know the result.

WorldKaoss 2010-08-16 04:11

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
I disabled every connection and tried again but it's still the same.

One thing I noticed is that in "Status" for the Bluetooth PAN (on my PC) it says:
IPv4: No Internet Connectivity
IPv6: No Network Connectivity

I will try again when I wake up as I haven't slept at all and it's 7:11 AM.

I will post the progress :D thanks

9000 2010-08-16 04:18

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Also I found that you have not set the IP of the client right:
Code:

0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.2 296
Shouldn't you set the client as 192.168.1.2 instead?

Good night. Have a nice dream and don't fall into Limbo.

WorldKaoss 2010-08-16 04:21

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
I've set the client IP 192.168.1.2 and the Gateway 192.168.1.1 (the settings are still the same now).

I will check more on this when I wake up.

9000 2010-08-16 04:29

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by WorldKaoss (Post 787633)
I've set the client IP 192.168.1.2 and the Gateway 192.168.1.1 (the settings are still the same now).

I will check more on this when I wake up.

I see. I'd probable asleep with you awake. Just few thing to note:

1) Make sure not other default route (0.0.0.0 0.0.0.0) on top of your PAN in route print
2) After paring up and join PAN, activate the script on N900 again

Have a nice dream.

9000 2010-08-16 09:36

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Although setting sudoers is better, but it seems to confuse a lot of people. I've made change to the procedure section 4.3.3 to run the script directly with root privilege:

Code:

echo "/home/user/bluetooth-pan.sh" | sudo gainroot

WorldKaoss 2010-08-16 18:50

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
seems like I won't be able to make it work unless I cut my veins with paper

I will try other things and if one of them is successfull I'll post what made it work.

9000 2010-08-16 23:21

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
1 Attachment(s)
I figured that your default routing in N900 is pointing to WiFi. That means the N900 is connecting to Internet via WiFi instead of GPRS.

Since the script is made for routing traffic via gprs0, the PAN could not enable your client to access to Internet via N900.

Therefore, in this case the script must be modified from:
Code:

iptables -t nat -A POSTROUTING -o gprs0 -j MASQUERADE
To:
Code:

iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
WorldKaoss, though you've already given up on further investigation, I hope someone else who wants to setup Bluetooth-PAN would be benefited from our conversations and discoveries.

WorldKaoss 2010-08-17 16:19

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
as soon as I get home I will try to modify that in the .sh file and post the results.

WorldKaoss 2010-08-17 18:13

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
now this is something ... new :|

http://img340.imageshack.us/img340/2815/43797267.png

9000 2010-08-17 23:31

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
1 Attachment(s)
cat bluetooth-pan.sh to see if there some strange character in the script.

Anyway i modified the scipt for you and attached with this reply.

WorldKaoss 2010-08-18 04:09

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
It fixed those errors however it's still the same.

I took the liberty to ping the bluetooth IP of the phone while in PAN:

Quote:

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\WorldKaoss>ping 192.168.1.1

Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.2: Destination host unreachable.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 192.168.1.1:
Packets: Sent = 4, Received = 1, Lost = 3 (75% loss),

C:\Users\WorldKaoss>
also, if I ping from the phone the IP of the pc's bluetooth it says:
Quote:

PING 192.168.1.2 (PING 192.168.1.2): 56 data bytes
and it remains that way.. no errors, no lost packets .. nothing.

I just woke up and I saw your message, if I don't fall asleep I'm going to reboot the device and try then, else I'll do this when I wake up for a long period of time (maybe in 3 hours)

9000 2010-08-18 04:33

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Show me the ipconfig, route print, ifconfig and route just like you did before would help me in the investigation.

Also, you must run the script after pairing up and joining PAN. No reboot is necessary as far as I concern. The bluetooth chip in N900 is quite stable, the PAN could stop and restart multiple times fine without reboot.

WorldKaoss 2010-08-18 04:34

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
it's still the same :(

let's say I pop in a Ubuntu CD (just using the Live CD)

what should I do there to setup bluetooth for tethering.
it may be a windows problem, so if it works in Ubuntu then I will have to reinstall the windows.

9000 2010-08-18 04:37

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by WorldKaoss (Post 790002)
it's still the same :(

Show me the ipconfig, route print, ifconfig and route just like you did before. If you've paired them up and joint PAN, the only thing left is the networking.

9000 2010-08-18 04:38

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by WorldKaoss (Post 790002)
it's still the same :(

let's say I pop in a Ubuntu CD (just using the Live CD)

what should I do there to setup bluetooth for tethering.
it may be a windows problem, so if it works in Ubuntu then I will have to reinstall the windows.

Could be Windows problem, but I really want to help you figure out the root of the problem before trying other platform. Like I said before, I suspected it's just networking issue.


All times are GMT. The time now is 09:47.

vBulletin® Version 3.8.8