USB networking

From UbuntuPhone
Jump to navigation Jump to search

USB networking: tethering

For networking the bq supports tethering via an USB device. Connect the phone with your Linux, FreeBSD, ... whatever workstation and run the following in the terminal app:

android-gadget-service enable rndis

that will switch the USB port in the phone from MTP to tethering and create a 'rndis0' network device whith the IP addr 10.42.0.1 (seems to be static or configured); at the same time it offers to the connected computer an IP via DHCP (somehow it takes sometime);

And SSH is fine too as:

ssh phablet@10.42.0.1
Welcome to Ubuntu Utopic Unicorn (development branch) (GNU/Linux 3.4.67 armv7l) >

The routing to Internet works as well fine and all is NAT'ed behind the best interface to use (wlan0 if Wifi is up too):

netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.2.1     0.0.0.0         UG        0 0          0 wlan0
10.42.0.0       0.0.0.0         255.255.255.0   U         0 0          0 rndis0
172.28.23.131   0.0.0.0         255.255.255.255 UH        0 0          0 ccmni0
192.168.2.0     0.0.0.0         255.255.255.0   U         0 0          0 wlan0

How can I set it as default to rndis enabled?

Oliver Grawert: you cant, it is hardcoded on boot to always have working mtp (until here is a UI option to turn it on or off, we want regular users to lways be able to exchange files), but you can override it in a user pstart job that runs at a later point ...

create /home/phablet/.config/upstart/rndis.conf with the following content:

start on started indicator-network

task

script
    android-gadget-service enable rndis
end script

when the interface rndis0 is enabled, somehow HTTPS access to the Ubuntu's app store is no longer possible; investigating further ...