2

I want to tether my mobile internet from my smartphone (OnePlus One, Android) to my Laptop (Debian 8). I want achieve this without using external tools. At the arch wiki page (https://wiki.archlinux.org/index.php/android_tethering#Tethering_via_Bluetooth) i found this command:

$ dbus-send --system --type=method_call --dest=org.bluez /org/bluez/hci0/dev_AA_BB_CC_DD_EE_FF org.bluez.Network1.Connect string:'nap'

Executing this command results in an icon on my smartphone, showing me that "Bluetooth Tethering" is active. If i do ifconfig after removing my ethernet cable on my laptop i get:

root@testnotebook02:/home/install# ifconfig    
bnep0     Link encap:Ethernet  Hardware Adresse 74:e5:43:4e:0f:57  
          inet6-Adresse: fe80::76e5:43ff:fe4e:f57/64 Gültigkeitsbereich:Verbindung
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metrik:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:1000 
          RX bytes:20 (20.0 B)  TX bytes:212 (212.0 B)

eth0      Link encap:Ethernet  Hardware Adresse d4:be:d9:4f:65:79  
          UP BROADCAST MULTICAST  MTU:1500  Metrik:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:18 

lo        Link encap:Lokale Schleife  
          inet Adresse:127.0.0.1  Maske:255.0.0.0
          inet6-Adresse: ::1/128 Gültigkeitsbereich:Maschine
          UP LOOPBACK RUNNING  MTU:65536  Metrik:1
          RX packets:32 errors:0 dropped:0 overruns:0 frame:0
          TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:0 
          RX bytes:1960 (1.9 KiB)  TX bytes:1960 (1.9 KiB)

There is only an ipv6 address, but no ipv4 address. After searching i found out that this ipv6 address is generated from the bluetooth MAC address from my laptop. If i ping 8.8.8.8 or ping www.google.com i get connect: Network is unreachable.

To get this working i have to set an ipv4 address manually and add the matching routing entry in the route table. I also have to add a nameserver entry to /etc/resolv.conf. But this not really practicable, as i have to know the IP of my smartphone (i only know it because it is rooted).

Executing route -n shows just an empty table. My /etc/network/interfaces looks like:

root@testnotebook02:/home/install# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

My /etc/resolv.conf looks like:

root@testnotebook02:/home/install# cat /etc/resolv.conf 
# Generated by NetworkManager

Executing the dbus-send command mentioned above on my pi, everything works correct without need to change something. So how can i achieve this on my laptop too? I already compared the files.

Note: On the pi there is also a GUI bluetooth manager working. May it do some configuration?

Thank you

  • I solve it using the BlueZ D-Bus API. There I Use the Netwotk1.Connect method and pass "nap" as argument. Then i run UDHCP. With this method i get a working IPv4 address. – SteffenH Jan 9 '17 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.