# bluetooth tethering (t-mobile wing + blueman)

## darkseer

I did a quick forum and wiki search and I didn't see any info on this so I thought I'd post somthing:

I'm tethering from my laptop to a  t-mobile wing over bluetooth. I was fortunate, this is by no means a good howto since everything went right for me, but it at least can put some people on the right track. 

1. add blueman and bluez to your /etc/package.keywords as its not fully tested yet

2. emerge -av blueman

Now, if you have and comfy bluetooth setup using bluez-utils and bluez-libs this will cause an issue as we are replacing them with bluez. You will need to re emerge your bluetooth dependent apps and breakage is likely.

3. make your /etc/dbus-1/system.d/bluetooth.conf is correct:

```

<!-- This configuration file specifies the required security policies

     for Bluetooth core daemon to work. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"

 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">

<busconfig>

  <!-- ../system.conf have denied everything, so we just punch some holes -->

  <policy user="root">

    <allow own="org.bluez"/>

    <allow send_destination="org.bluez"/>

    <allow send_interface="org.bluez.Agent"/>

  </policy>

  <policy group="plugdev">

      <allow own="org.bluez"/>

      <allow send_destination="org.bluez"/>

      <allow send_interface="org.bluez.Agent"/>

  </policy>

  <policy group="plugdev">

      <allow send_destination="org.bluez"/>

   </policy>

  <policy at_console="true">

    <allow send_destination="org.bluez"/>

  </policy>

  <policy context="default">

    <deny send_destination="org.bluez"/>

  </policy>

</busconfig>

```

4. reboot

5. Make sure the bluetoothd daemon starts on boot and that your starting network device bluetooth in addition to eth0

6. login and get a console up

7. type ifconfig you should see a pan* network interface. 

8. execute blueman-applet

9. go to the t-mobile wing

10. open the comm manager

11. turn on bluetooth

12. click on settings 

13. select mobile tab

14. make the wing discoverable

15. go back to the computer and scan for devices

16. pair with the wing with your computer

17. disconnect from the wing

18. go back to the wing

19. go to internet connection sharing

20. share via bluetooh and t-moblie data network

21. go back the laptop and and select  the wing in the menu

22. right click and select network access -> network access point

23. go back to the console

24. log in as root

25. type ifconfig and you should see a bnep* interface

26. cd /etc/init.d

27. ln -s net.lo net.bnep*

28. edit /etc/conf.d/net add "dhcpd_bnep*=( "-t 30 " )

29. /etc/init.d/net.bnep* start

This will get an ip from your phone and you will on browsing on edge via bluetooth.

----------

## FNX

Hi, 

I could not ever get up a pan* interface with >=bluez-3 . I'm trying to connect two computers (a laptop and a fitpc) over a pan network. I used to (and still with old-daemons) connect them with pand daemon. In all the tutorials i see that pan* and bnep interfaces appear by default. Where may i be doing wrong ?

At the moment bluez-4.39 is installed with tuxonice-sources-2.6.30-r4.

----------

## darkseer

I'd need to know more, I've never done it that way. In this example blueman is taking care of connecting to the network. The destination device is running windows mobile with a dhcp server. So the order of events as far as I understand are as follows:

1. Blueman bonds my laptop to the t-mobile wing

(you should be checking to see if the basic bluetooth connection is happening between the fitpc and your computer)

2. blueman creates bnep0 and bonds it to the bluetooth device

(I have no idea how to do this manually)

3. Blueman runs a dhcp client on bnep0 while the destination device has a dhcp server running

(if its the same two devices you can usually get by without dhcp, just statically assign an address to both pan interfaces. 

4. dhcpcd adjusts the routing rules accordingly.  

My guess is that your devices either aren't bonded or that if they are the pan interfaces are not set up correctly. I'd need more precise information to troubleshoot more.  

So my first question is what are you using to bond the two bluetooth interfaces?

Second, what are the pan interface network settings on both devices "/sbin/ifconfig pan*" replace * with the pan interface number.

----------

## dmpogo

 *FNX wrote:*   

> Hi, 
> 
> I could not ever get up a pan* interface with >=bluez-3 . I'm trying to connect two computers (a laptop and a fitpc) over a pan network. I used to (and still with old-daemons) connect them with pand daemon. In all the tutorials i see that pan* and bnep interfaces appear by default. Where may i be doing wrong ?
> 
> At the moment bluez-4.39 is installed with tuxonice-sources-2.6.30-r4.

 

To get pan interface you must have bridge support compiled in the kernel (or as a module, the module 'bridge' will be loaded when you start bluetoothd and pan0 interface will appear). Pan interface is really a bridge between different bnep devices if several will be created.  You better have bridge-utils package installed then.  If you need pan1, you should do it manually   

```

brctl addbr pan1

```

bnep0 interface appears automatically when the connection between two  devices is establиshed.  I.e, you have to get through pairing, service discovery, connect, before.

It is a virtual device, you will not see it before you get connection.   

Best guide about bluez-4.x networking I found is

http://wiki.openmoko.org/wiki/Manually_using_Bluetooth#Information_about_bluez4_networking

----------

## dmpogo

darkseer

are you saying your phone acts as dhcp server ?

----------

## darkseer

Normally that is how windows internet connection sharing works. The t-mobile wing is running windows mobile.  The box/device that is bridging runs a DHCP server on an internal 10.* or 192.* internal non-routable network and sets up masquerading/routing between the internal and external networks. Then any dhcp client on the internal network can use that windows machine as a gateway. 

I'm very sure it is a dhcp server because someone at work turned on connection sharing by accident. Since their XP machine was physically closer than the domain controllers it started allocating ip addresses to the IT department. It was messy, and a pain in the a** to figure out. 

I can run a wireshark trace on between the laptop and the wing to verify for certain if you would like, but I'm fairly certain given my past experience and how things are observed to behave now.

----------

## dmpogo

Thanks, I am approaching the state of being ready to connect to the phone - got figured out pairing, bnep0 etc, but thought I would need to configure  dhcpd server on laptop side.

Did not risk playing with the phone in danger of running 3G bills before knowing for sure what I am doing  :Smile: 

----------

## darkseer

I have a similar set up on a t-mobile G1. Its running a derivative of linux, and the dhcp server is on the phone too run by the tethering app.

----------

## muttley79

Can you please share the configuration needed in order to get internet-by-bluetooth on the G1 device?

(That is get internet FROM the laptop to the device by BT)

Thanks

----------

## darkseer

 *muttley79 wrote:*   

> Can you please share the configuration needed in order to get internet-by-bluetooth on the G1 device?
> 
> (That is get internet FROM the laptop to the device by BT)
> 
> Thanks

 

There is more involved on the G1 end. Everything in the howto pertaining to the gentoo portion is the same. The G1 out of the box cannot be tethered. In order to tether you need to root the G1 which is very much against what t-mobile wants you to do. Before you attempt this backup your phone and know that if you do something wrong, there is a real possibility that you will brick it. This that mind set prepare your G1 with this guide:

http://forum.xda-developers.com/showthread.php?t=442480

and this guide/rom:

http://forum.xda-developers.com/showthread.php?t=537204

Then install the app located here manually:

http://code.google.com/p/android-wifi-tether/

It will allow you to tether through bluetooth or wifi. I haven't gotten the wifi tether to work with gentoo, but I have with windows. The bluetooth tether works on both. 

Read them first. Then do. It took me 2 hours since I was being careful. However, now I'm out in the middle of no where responding to this post, so to me the risk was worth it.

----------

## muttley79

Hi mate, thanks for your reply

my G1 is already rooted and has CyanogenMod installed  :Smile: 

My Q is , will this program allow me to use the laptop's already existing Internet connection to work with my no-internet G1

All I read about is using the laptop as the client where the G1 gets cell internet. I need the opposite. 

Does this work this way for you?

----------

## dmpogo

 *muttley79 wrote:*   

> Hi mate, thanks for your reply
> 
> my G1 is already rooted and has CyanogenMod installed 
> 
> My Q is , will this program allow me to use the laptop's already existing Internet connection to work with my no-internet G1
> ...

 

I actually found more guides to do opposide  :Smile:     This one, for example

http://sourceforge.net/apps/mediawiki/noko/index.php?title=Gentoo_bluetooth_network_gateway_with_bluez-utils_3.*

----------

## muttley79

Hi, thanks for your reply

I have read this manual, and again, it seems that the phone is the SERVER.

i need the phone to be the CLIENT (no Internet at all on the phone and the connection is received from a bridged network or ICS).

Maybe, I miss understood the guide, but I clinged to terms I understood  :Smile: 

Network Access Point (NAP) and NAP Service – A Bluetooth device that supports the NAP service is a Bluetooth device that provides some of the features of an Ethernet bridge to support network services.

Group Ad-hoc Network (GN) and GN Service – A Bluetooth device that supports the GN service is able to forward Ethernet packets to each of the connected Bluetooth devices, the PAN users, as needed. 

And, of course, it says that the phone is serving dhcp and dns...

----------

## dmpogo

 *muttley79 wrote:*   

> Hi, thanks for your reply
> 
> I have read this manual, and again, it seems that the phone is the SERVER.
> 
> i need the phone to be the CLIENT (no Internet at all on the phone and the connection is received from a bridged network or ICS).
> ...

 

I'm not sure what you are referring to,  in my link the phone is client and is going to get internet through PC. 

Or to be exact the guide is about how to set PC as the gateway and not much about how to use the phone as client

To cite

 *Quote:*   

> 
> 
>  Done!
> 
> Your system should now act as a GN/NAP bt gateway 
> ...

 

----------

## muttley79

Hmmm...

I think I got your point now   :Rolling Eyes: 

Thanks a bunch

----------

