Tethering


#1

May be I didn’t put my question as needed. So I try once more: Can anybody explain how tethering works? I though: I enable it and use it. This means: Tethering gives access to my network so that devices connected with my raspberry with OSMC can enter it and use the internet connection this seems to be wrong. I activated tethering and got nothing. Because I don’t know which direction is the one I want to have, I activated »WiFi Ethernet«, after this »Ethernet to WiFi«. I found a possibility to connect to the WiFi but no connection to the internet. I can’t find any hint in the Wiki how tethering works. Is there anybody who knows?


RPi 3 - osmc - wifi range extender
#2

This may sound strange, but the short answer is no! It’s a term used by the connman network manager and they don’t actually explain what it means in their documentation. In my experience, if you activate Ethernet to WiFi you lose the ethernet connection. If you have got yours so both are working, well done! Now I suppose the Pi will be acting as a DHCP for your connected devices and you should be able to connect them using the default password. IIRC it tells you what that is when you activate tethering.

Then the key to getting internet access is to specify the right gateway IP and the right DNS. If you have to set these manually on a device you are connecting through the Pi, the gateway should be the IP address of the Pi WiFi adapter. The easiest DNS to use is the public Google one 8.8.8.8.


#3

Ethernet->Wifi tethering works like a hotspot; it creates a wifi network.
If you have your Pi connected via cable ( you should) that wifi networks has internet access

If on the other hand you use Wifi -> Ethernet tethering, you can use the Pi as a wireless wifi dongle for your PC


#4

Thanks. This is, what I thought. My Pi 3 B is connected via cable, but there is no internet access for the devices which connect to the Pi. It simply doesn’t work. That’s all.


#5

Here, it works with my Pi 3B as expected. I configured it via SSH access and user osmc, password osmc:

How my /etc/connman.conf looks like:

osmc@osmc-pi3:~$ cat /etc/connman.conf
[General] 
PreferredTechnologies=ethernet,wifi
SingleConnectedTechnology=false
AllowHostnameUpdates=false
TetheringTechnologies=ethernet,wifi
PersistentTetheringMode=true
NetworkInterfaceBlacklist=vmnet,vboxnet,virbr,ifb,docker,veth

Content of /var/lib/connman, only one ethernet (cable) service known and active

osmc@osmc-pi3:~$ ls /var/lib/connman
ethernet_b827ebc87f99_cable  settings

What is in /var/lib/connman/settings?

osmc@osmc-pi3:~$ sudo cat /var/lib/connman/settings
[global]
OfflineMode=false

[WiFi]
Enable=false
Tethering=false

[Wired]
Enable=true
Tethering=false

[Bluetooth]
Enable=false
Tethering=false

[P2P]
Enable=false
Tethering=false

Enter connmanctl:

osmc@osmc-pi3:~$ sudo connmanctl
connmanctl>

Enable WiFi:

connmanctl> enable wifi
Enabled WiFi

Start tethering, here with SSID NeuLummerland and password MichaelEnde

connmanctl> tether wifi on NeuLummerland MichaelEnde
Wifi SSID set
Wifi passphrase set
Enabled tethering for WiFi
connmanctl> exit

Check ip addresses and network devices, look at eth0, wlan0 and tether, just an (my) example:

osmc@osmc-pi3:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:c8:7f:99 brd ff:ff:ff:ff:ff:ff
    inet 192.168.178.46/24 brd 192.168.178.255 scope global eth0
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master tether state UP group default qlen 1000
    link/ether b8:27:eb:9d:2a:cc brd ff:ff:ff:ff:ff:ff
    inet6 fe80::ba27:ebff:fe9d:2acc/64 scope link
       valid_lft forever preferred_lft forever
4: tether: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether b8:27:eb:9d:2a:cc brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.1/24 brd 192.168.0.255 scope global tether
       valid_lft forever preferred_lft forever
    inet6 fe80::1428:c0ff:fed1:e308/64 scope link
       valid_lft forever preferred_lft forever

Is routing ok?

osmc@osmc-pi3:~$ ip route show
default via 192.168.178.1 dev eth0
192.168.0.0/24 dev tether proto kernel scope link src 192.168.0.1
192.168.178.0/24 dev eth0 proto kernel scope link src 192.168.178.46
192.168.178.1 dev eth0 scope link

That’s it.

Haven’t tried the GUI method but as far as I know there are no more issues with that.


#6

Ok, tried it now with the GUI method and think to know what your problem could be:

  • So, go to MyOSMC -> Networks

  • Wired: Adapter should be enable and you should see IP address, subnet mask, gateway and nameserver form your router

  • Wireless: Adapter should be enabled BUT YOU SHOULD NOT SEE ANY IP ADDRESS AND ‘STATUS CONNECTED’. If so, you have to disconnect this Wifi connection by going to the right list, click on your SSID you’re connected to and choose ‘Disconnect and Forget’.

  • Tethering: Set your SSID and password. I’m not sure whether a minimum password length of 8 or 10 characters is required. Choose ‘ethernet to wifi’ and enable this function.

With that it works like a charm, here.


#7

This should be a HowTo …


#9

I am using the latest osmc version of April 2018.04-2 on raspberry pi 3+, but facing same issue as @Auerhahn. The ethernet to wifi tethering is not working.

I used the GUI to setup the tethering, and I followed the commands from @JimKnopf to confirm that the setup is as per his settings.
the Wifi is enabled, but not connected to any network.

with my wifi device, I am able to connect to the osmc wifi, I get IP address (192.168.0.2) but the connected device cannot resolve any URL, as if DNS requests are blocked.
the osmc box however can access the internet and resolve.

I tried configuring the wired adapter using both dhcp, then static. In both situations the result is the same, cannot resolve.

example of configuration when dhcp enabled on the ethernet:

osmc@osmc:~$ cat /etc/connman.conf
[General]
PreferredTechnologies=ethernet,wifi
SingleConnectedTechnology=false
AllowHostnameUpdates=false
TetheringTechnologies=ethernet,wifi
PersistentTetheringMode=true
NetworkInterfaceBlacklist=vmnet,vboxnet,virbr,ifb,docker,veth

osmc@osmc:~$ ls /var/lib/connman
ethernet_b827ebbxxxxx_cable  settings

osmc@osmc:~$ sudo cat /var/lib/connman/settings
[global]
OfflineMode=false

[WiFi]
Enable=true
Tethering=true
Tethering.Identifier=mywifi
Tethering.Passphrase=somepassword

[Bluetooth]
Enable=false
Tethering=false

[Wired]
Enable=true
Tethering=false

[P2P]
Enable=false
Tethering=false

osmc@osmc:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:bx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.220.162/24 brd 192.168.220.255 scope global eth0
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master tether state UP group default qlen 1000
    link/ether b8:27:eb:ex:xx:xx brd ff:ff:ff:ff:ff:ff
    inet6 fe80::ba27:ebff:feed:236b/64 scope link
       valid_lft forever preferred_lft forever
5: tether: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether b8:27:eb:ex:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.1/24 brd 192.168.0.255 scope global tether
       valid_lft forever preferred_lft forever
    inet6 fe80::9c3b:1aff:fed0:f9b6/64 scope link
       valid_lft forever preferred_lft forever

osmc@osmc:~$ ip route show
default via 192.168.220.1 dev eth0
192.168.0.0/24 dev tether proto kernel scope link src 192.168.0.1
192.168.220.0/24 dev eth0 proto kernel scope link src 192.168.220.162
192.168.220.1 dev eth0 scope link

I even tried to set static IP on ethernet adapter, with the gateway being a VM that is configured for PIA VPN (set to forward the requests to the tunnel) - but i get same result…

What else should I try to understand more of the issue?
thanks,
-s


#10

@sancho_mic Difficult, what are the contents of

/etc/resolv.conf
and
/etc/connman.prefs

when tethering is enabled but no internet access for a connected client?


#11

For tethering to work, you need to enable DNS Proxying. This is disabled by default because it causes issues with some nameserver resolution.

It can be enabled by setting dnsproxy=yes in /etc/connman.prefs.

We were looking for a way to fix this a while ago, but it got forgotten about due to a lack of reports.

Sam


#12

@JimKnopf: Thank you! This works.
But now I have another problem: is is very slow. May be the internal Wifi-Module is not the best. If I take an external one, is it easy to enable it so that the raspberry uses it? And has somebody a hint which one is the best for this purpose?


#13

@Auerhahn Look in the OSMC shop, there is one you can expect best support with OSMC.

Two questions regarding your setup:

  • Did you change the dnsproxy in /etc/connman.prefs to yes?
  • If not, did you try any other client to login to the tether OSMC device except Android?

#14

I didn’t change anything in this file. I logged in with my Android Smartphone and with my Mac. For both it worked but was very slow. May be it’s better when I use an external adapter. (If not, I waste my money. It’s not much, but anyway… That’s why I hesitate…)


#15

hi & thank you for the inputs:

@JimKnopf

osmc@osmc:~$ cat /etc/resolv.conf
# Generated by Connection Manager
nameserver 1.1.1.1
nameserver 8.8.8.8
osmc@osmc:~$ cat /etc/connman.prefs
dnsproxy=no

@sam_nazarko
indeed after changing to yes the dnsproxy in connman.prefs, i restarted and it worked

I tried with 2 options the speed via speedtest app in android (my regular isp speed is 50/3 Mbps):

  1. dhcp on for the ethernet, gateway is using the regular ISP:
    25Mbps download
    3Mpbs upload
    9ms ping, 50ms jitter, no loss

  2. static with gateway as the VM configured for PIA VPN (iptables, fowrward) with endpoint in US
    8.9Mbps doanload
    1.5Mbps upload
    270 ms ping
    37 ms jitter
    no loss

i connected to this wifi my chromecast and my android, netflix works very good.

thanks for the inputs.
-s


#17

@Auerhahn I’ve a 10/150 Mbit/s internet connection.
Being connected to the Pi3B via tether, a Windows system gets 9/30 bandwidth with 11 milliseconds ping. (speedtest.net)
I’m using the internal Pi’s WLAN, same room, 3 meters distance.

Not sure what you mean by slow.


#18

9/30 is slow, I guess. Anyway: I mean by slow for example that a page loads considerably longer as with my normal WiFi connection. This is the case. And if it’s the same with the dongle (so I understand your posting), it’s useless for me.


#19

Well, give it a try and install the app speedtest.net (Ookla) on your Android Smartphone. It gives you ping latency, upload and download bandwidth to the nearest test server.

Just to be sure to understand whether there’s something which looks unusual.

On the OSMC device you could do

sudo apt-get install speedtest-cli
and simply run
speedtest-cli

and compare the values with the one on your Smartphone. If they are both nearly the same, the issue is behind the Pi. If the Pi is much faster/better than the Smartphone then it’s obviously the Wifi connection which throttles things.


#20

My phone says for the download 24, the raspberry 49. OK. Now it costs too much time. It was a nice idea to have one device, not two, but I can let the Airport Express in my living room. It works quite well, and I can use my time for really important things.

Thank you for your help.


#21

Have fun with OSMC and the Airport Express. Think about future security for this solution.


#23

At first I think about a solution for my network, after this about the future. But anyway OSMC and AirportExpress habe nothing to do with each other. The solution works quite well, it’s just that I don’t like it. I don’t believe that APE is an unsafe solution. I have it since some years and it works quite well and gives the full speed. I think this is better as the half.