Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

debian xfce network tethering a samsung galaxy s2

302 views
Skip to first unread message

Zenaan Harkness

unread,
Nov 26, 2013, 12:20:01 AM11/26/13
to
Setting up a laptop workstation for a friend, who uses internet via an
sgs2 (samsung galaxy sII). Never have I tethered before.

I've installed wheezy+xfce on a thinkpad r500.

Been searching a bit, eg "network tethering site:debian.org" and others.

apt-cache search tether gives
entangle - Tethered Camera Control & Capture
ipheth-utils - USB tethering driver support utilities for the iPhone
(I'm on sid)

Also apt-cache search'ed for samsung.

Have not yet attached the phone (via usb), just doing some research,
and seeking some feedback and/ or recommendations (eg "just install
network-manager" or some such).

TIA
Zenaan


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/CAOsGNSTWgsvep0Tid+AN9bkR...@mail.gmail.com

Marius Gavrilescu

unread,
Nov 26, 2013, 12:40:01 AM11/26/13
to
Zenaan Harkness <z...@freedbms.net> writes:

> Setting up a laptop workstation for a friend, who uses internet via an
> sgs2 (samsung galaxy sII). Never have I tethered before.
>
> I've installed wheezy+xfce on a thinkpad r500.
>
> Been searching a bit, eg "network tethering site:debian.org" and others.
>
> apt-cache search tether gives
> entangle - Tethered Camera Control & Capture
> ipheth-utils - USB tethering driver support utilities for the iPhone
> (I'm on sid)
>
> Also apt-cache search'ed for samsung.
>
> Have not yet attached the phone (via usb), just doing some research,
> and seeking some feedback and/ or recommendations (eg "just install
> network-manager" or some such).

I have a Galaxy Note II, and when I connect it to my laptop and tick the
USB tethering checkbox, I get a new interface named 'usb0'. Then I ifup
usb0 and I'm done.

It should work with network-manager/wicd too, though I haven't tested
this.
--
Marius Gavrilescu

Roland Mueller

unread,
Nov 27, 2013, 6:00:02 AM11/27/13
to
Hello,

2013/11/26 Zenaan Harkness <z...@freedbms.net>

Setting up a laptop workstation for a friend, who uses internet via an
sgs2 (samsung galaxy sII). Never have I tethered before.

I've installed wheezy+xfce on a thinkpad r500.

Been searching a bit, eg "network tethering site:debian.org" and others.

apt-cache search tether gives
entangle - Tethered Camera Control & Capture
ipheth-utils - USB tethering driver support utilities for the iPhone
(I'm on sid)

Also apt-cache search'ed for samsung.

Have not yet attached the phone (via usb), just doing some research,
and seeking some feedback and/ or recommendations (eg "just install
network-manager" or some such).


for tethering you shouln't need a package at all: on phone side you should be able setup USB debugging mode (permanently) and enable tethering after the phone has been connected to the Linux machine.

BR,
Roland

Ron Leach

unread,
Nov 28, 2013, 11:00:02 AM11/28/13
to
On 27/11/2013 10:58, Roland Mueller wrote:
> for tethering you shouln't need a package at all: on phone side you should
> be able setup USB debugging mode (permanently) and enable tethering after
> the phone has been connected to the Linux machine.
>

Having D7/XFCE and a Samsung Galaxy S2 (SGS2) I thought I'd try this,
but without success, so far.

Expected behaviour:
- Plug in SGS2 to laptop USB port, set USB tethering
- See a new interface listed in wicd
- Be able to choose to connect, disconnect, set IP settings, DNS, etc

Actual behaviour:
- Plug in SGS2 to laptop USB port, set USB tethering:
Done
- See a new interface listed in wicd:
SGS2 or usb connection not listed
- Be able to choose to connect, disconnect, set IP settings, DNS, etc:
Unable

Not much of an expert on network drivers etc in Linux, so would
welcome some guidance on exactly where to look for the problem, but
here are the relevant syslog entries. The first block is when
plugging in the SGS2, before the USB tethering was selected. The
second block is the Debian response once the SGS2 was in tethering
mode. [The syslog extracts have had date, time, and machine name
removed to make the lines shorter, and easier to post and read.]

Log of initial SGS2 to USB connection

> kernel: [ 98.648208] usb 7-5: new high-speed USB device number 4 using ehci_hcd
> kernel: [ 98.782415] usb 7-5: New USB device found, idVendor=04e8, idProduct=6860
> kernel: [ 98.782425] usb 7-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> kernel: [ 98.782432] usb 7-5: Product: SAMSUNG_Android
> kernel: [ 98.782438] usb 7-5: Manufacturer: SAMSUNG
> kernel: [ 98.782443] usb 7-5: SerialNumber: [nnnnnn]
> kernel: [ 98.845013] cdc_acm 7-5:1.0: This device cannot do calls on its own. It is not a modem.
> kernel: [ 98.845247] cdc_acm 7-5:1.0: ttyACM0: USB ACM device
> kernel: [ 98.845798] usbcore: registered new interface driver cdc_acm
> kernel: [ 98.845805] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
> kernel: [ 101.054841] usb 7-5: USB disconnect, device number 4
> kernel: [ 101.324179] usb 7-5: new high-speed USB device number 5 using ehci_hcd
> kernel: [ 101.458294] usb 7-5: New USB device found, idVendor=04e8, idProduct=6860
> kernel: [ 101.458304] usb 7-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> kernel: [ 101.458312] usb 7-5: Product: SAMSUNG_Android
> kernel: [ 101.458317] usb 7-5: Manufacturer: SAMSUNG
> kernel: [ 101.458323] usb 7-5: SerialNumber: [nnnnnn]
> kernel: [ 101.459986] cdc_acm 7-5:1.1: This device cannot do calls on its own. It is not a modem.
> kernel: [ 101.460218] cdc_acm 7-5:1.1: ttyACM0: USB ACM device
> kernel: [ 102.368337] usb 7-5: USB disconnect, device number 5

20 seconds later, after finding my way through the Android menus, USB
tethering was switched on the phone; here's the syslog following that:

> kernel: [ 121.728222] usb 7-5: new high-speed USB device number 6 using ehci_hcd
> kernel: [ 121.862377] usb 7-5: New USB device found, idVendor=04e8, idProduct=6863
> kernel: [ 121.862392] usb 7-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> kernel: [ 121.862400] usb 7-5: Product: SAMSUNG_Android
> kernel: [ 121.862405] usb 7-5: Manufacturer: SAMSUNG
> kernel: [ 121.862410] usb 7-5: SerialNumber: [nnnnnn]
>
> udevd[3360]: failed to execute '/lib/udev/mtp-probe' 'mtp-probe /sys/devices/pci0000:00/0000:00:1d.7/usb7/7-5 7 6': No such file or directory
>
> kernel: [ 121.940297] usbcore: registered new interface driver cdc_ether
> kernel: [ 121.944679] rndis_host 7-5:1.0: usb0: register 'rndis_host' at usb-0000:00:1d.7-5, RNDIS device, [xx:xx:MAC_of_SGS2:xx]
> kernel: [ 121.944806] usbcore: registered new interface driver rndis_host
> kernel: [ 121.957209] usbcore: registered new interface driver rndis_wlan

Notes:
(a) The udevd line is very long, so I've added a blank line above and
below it for readability on the list in cases where the reader will
wrap the text
(b) wicd does not list this usb interface, listing only its existing
wired ethernet adaptor, and the different wifi networks that its
built-in wifi device can receive.

Does the syslog extract show it working, or not? Perhaps there is
another log that would be useful - I checked dmesg but that contained
nothing since startup. /etc/network/interfaces only contained eth0
(the wired socket on the laptop). Should wicd be able to list the
SGS2/usb device or connection?

Not knowing much about the networking setup in the machine, I really
Would be very grateful for any suggestions; it would be worth getting
it to work.

regards, Ron


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/529767C6...@tesco.net

Ron Leach

unread,
Nov 29, 2013, 2:50:01 PM11/29/13
to
Apologies for responding to my own post, but here some more evidence
of USB tethering failure, On 28/11/2013 15:56, Ron Leach wrote:

> Expected behaviour:
> - Plug in SGS2 to laptop USB port, set USB tethering
> - See a new interface listed in wicd

After further testing, this would never be possible in wicd.

wicd only 'looks' at whatever 'two' interfaces (wicd is limited to 2)
are set in its 'preferences' tab. On most laptops - such as this I am
using - those settings are (and will likely always be) eth0 and wlan0.
wicd can never 'see' usb0 if eth0 and wlan0 are also present.

> Not knowing much about the networking setup in the machine,

I've done some more trials. After disconnecting the laptop from the
existing LAN, plugging in SGS2, setting USB tethering, and with the
SGS2 in coverage and sustaining a data connection to the mobile
network, I tried these commands:

# ifdown usb0
replies with
"usb0 not configured"

# ifup usb0
replies with
"Ignoring unknown interface usb0=usb0."

#ifconfig usb0
replies with
"usb0"
and a table of
"[Ethernet type, a MAC address, MTU 1500, and several lines of tx and
rx parameters, all zero.]"

In my experience, it would seem that USB tethering, at least for the
first time, is not possible just by plugging it in to Wheezy/XFCE, and
doing
ifup usb0

Something else perhaps must also be needed. Maybe something else
needs setting up.

As I mentioned, I know relatively little about the networking process
in Linux or Debian, and would be grateful for any suggestions. I
wondered about defining 'usb0' somewhere, maybe in
/etc/network/interfaces,
but I really have no idea what to set as a configuration. On the
other hand, Wheezy seems to think it has some kind of config, already,
as posted just above, so I am not at all sure.

regards, Ron


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/5298EEEE...@tesco.net

Reco

unread,
Nov 29, 2013, 3:20:01 PM11/29/13
to
Hi.

On Fri, 29 Nov 2013 19:45:50 +0000
Ron Leach <ronl...@tesco.net> wrote:

> After further testing, this would never be possible in wicd.

Why bother yourself with an inferior network configurator (wicd), then
you have superior one (ifupdown) already?


> # ifup usb0
> replies with
> "Ignoring unknown interface usb0=usb0."

That's only means that you lack usb0 definition
in /etc/network/interfaces.


> #ifconfig usb0
> replies with
> "usb0"
> and a table of
> "[Ethernet type, a MAC address, MTU 1500, and several lines of tx and
> rx parameters, all zero.]"

And that means you've done the easy part of configuration of tethering.
You plug the phone - kernel provides you an unconfigured network
interface.
The hard part is to setup an appropriate routing to the outside world on
your phone.


> In my experience, it would seem that USB tethering, at least for the
> first time, is not possible just by plugging it in to Wheezy/XFCE, and
> doing
> ifup usb0
>
> Something else perhaps must also be needed. Maybe something else
> needs setting up.

You need to configure /etc/network/interfaces. Something along the
lines of (assuming you've already setup DHCP server on your phone):

allow-hotplug usb0
iface usb0 inet dhcp

or something along the lines of (if you don't):

allow-hotplug usb0
iface usb0 inet static
address x.x.x.x
netmask x.x.x.x
gateway x.x.x.x
dns-nameservers x.x.x.x

or, if you're really need it (ipv6):

allow-hotplug usb0
iface usb0 inet6 static
address x:x:x:x:x:x:x:x
netmask x


'allow-hotplug' stanza should tell udev to configure usb0 interface
once you've plugged your phone, and deconfigure it once you'll unplug
it.

Reco


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20131130001035.e952...@gmail.com

Zenaan Harkness

unread,
Nov 30, 2013, 6:30:02 AM11/30/13
to
On 11/30/13, Ron Leach <ronl...@tesco.net> wrote:
> Apologies for responding to my own post, but here some more evidence
> of USB tethering failure, On 28/11/2013 15:56, Ron Leach wrote:
>
>> Expected behaviour:
>> - Plug in SGS2 to laptop USB port, set USB tethering
>> - See a new interface listed in wicd
>
> After further testing, this would never be possible in wicd.

I don't know that this is true (it may be, but doesn't sound right) -
I'm on sid.

Anyway, after various testing steps, I found tethering worked very
well when setting up laptop for friend with XFCE, two separate
successful cases:
a) using SGS2 as wifi hotspot tethering ("wifi tethering")
b) and separately, connecting by usb cable ("usb tethering").

This was wheezy. Also tested successfully wireless tethering on sid.

Here is my procedure for wifi testing/ config:

*) First:
Put Android phone into wireless tethering/ wifi hotspot mode.
apt-get install wireless-tools wicd
Add a launcher shortcut to toolbar for wicd.

*) Next, make sure firmware for your wireless chip is installed:
# probably have to add non-free packages to apt sources.list
# now find appropriate firmware package:
lspci|grep -i net
apt-cache search SOME-DEVICE-DATA
apt-get install APPROPRIATE-FIRMWARE-PACKAGE
reboot # probably needed here, but not sure..

1) turn on the wireless physical switch on laptop !

2) sudo ifconfig -a # find name of wireless interface device
Usually it's called wlan0 it seems.

# Steps 3 and 4 aren't strictly necessary (but useful for testing
purposes if you are having difficulty), you should know your SSID and
PASSWORD - they are configured on your Android phone.

3) sudo ifconfig wlan0 up # wlan0 is example interface device name
This is necessary for the following command to run...

4) sudo iwlist wlan0 scan | grep -i sid # find the network name/ SSID

5) add to /etc/network/interfaces, entry such as:
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid THE_SSID
wpa-psk THE_PASSWORD

6) sudo ifup wlan0
Or alternatively, run wicd command.

------
Now USB tethering was much simpler:
*) switch off wireless switch, or disable in wicd,
or disable with "sudo ifdown wlan0.

*) connect usb cable from phone to laptop

*) enable "usb tethering" on phone

*) ifconfig -a # should show usb0 network device

*) add following lines to /etc/network/interfaces:
allow-hotplug usb0
iface usb0 inet dhcp

*) sudo ifup usb0 # only do this if needed

Good luck
Zenaan


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/CAOsGNSQxou3ws5_3GM5-N99R...@mail.gmail.com

Ron Leach

unread,
Nov 30, 2013, 3:00:02 PM11/30/13
to
On 29/11/2013 20:10, Reco wrote:
>
> You need to configure /etc/network/interfaces. Something along the
> lines of (assuming you've already setup DHCP server on your phone):
>
> allow-hotplug usb0
> iface usb0 inet dhcp
>

Tried this, and Debian responded well each time I plugged and
unplugged the phone.

#ifconfig usb0

gave more details, including an IPv4 address (and another IPv6), but
no gateway was listed, nor DNS servers. (Maybe they are not normally
listed, even on active interfaces.)

#ifup usb0
replied with
ifup: interface usb0 already configured
so that command was not necessary in this case - the automatic up/down
seems to be working correctly.

# ping www.google.com
failed, but worked when typed into a terminal app on the phone.

# route
revealed that the laptop was still using the gateway setting, and DNS
settings, that are used whenever eth0 is up. Debian had not changed
its gateway and dns settings when the phone was plugged in. So the
laptop was not routing its offnet IP traffic out to the phone.

wicd showed eth0 disconnected, but I issued
#ifdown eth0
to be sure. Nevertheless,

# route
still showed that the normal gateway and DNS settings used on our LAN
were still set.

Thinking that the DHCP system on the Samsung Galaxy may not be working
correctly, I tried your static alternative. I knew the IP address
that the phone issued to this Debian laptop, and
# arp
revealed the IP address on the other end of the USB cable, which I
presumed has to be some kind of NAT gateway within the SGS2 and so
decided to use its IP address as the default gateway in a static setup:

>
> allow-hotplug usb0
> iface usb0 inet static
> address 192.168.55.230 # manually set the address given
> netmask 255.255.255.0 # as reported by ifconfig
> gateway 192.168.55.1 # other end of USB as reported by ARP
network 192.168.55.0 # added because eth0 had this
broadcast 192.168.55.255 # added because eth0 had this
> dns-nameservers 8.8.4.4 # google DNS server
>

Plugging in the SGS2 brought this interface up but, again,
# ping www.google.com
failed.

# route
revealed that the default route was now set to
192.168.55.1

I think Debian is working correctly - at least, all the settings look
correct. At this stage, I conclude that the SGS2 is not functioning
completely, in particular:

(a) SGS2 DHCP does not issue a gateway or dns server address, and
(b) its NAT function does not forward from tethered devices, onto its
own upstream connection.

Both these issues could be to do with the Android revision level -
SGS2 is a 2 year old phone and runs Android version 2.3.3 .

Unless anyone thinks there is more I could do in Wheezy to make this
work, I'll concentrate on confirming the functionality of tethering
and NAT in Android on SGS2; there may be an app which plugs these gaps.

Reco, thank you for your clear advice, which was helpful. Zenaan, you
also contributed in the thread and seemed to report success; were you
able to test that devices tethered to the Samsung Galaxy S2 could not
only be attached and 'see' a usb connection, but could also reach
external internet through it? If so, could you say what Android
version the phone you tested with is using?

regards, Ron


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/529A4185...@tesco.net

Zenaan Harkness

unread,
Nov 30, 2013, 6:30:01 PM11/30/13
to
On 12/1/13, Ron Leach <ronl...@tesco.net> wrote:
> On 29/11/2013 20:10, Reco wrote:
>> You need to configure /etc/network/interfaces. Something along the
>> lines of (assuming you've already setup DHCP server on your phone):
>>
>> allow-hotplug usb0
>> iface usb0 inet dhcp
>
> Tried this, and Debian responded well each time I plugged and
> unplugged the phone.

What do you mean "responded well"?
Do you mean the internet worked for you?

> #ifconfig usb0
>
> gave more details, including an IPv4 address (and another IPv6), but
> no gateway was listed, nor DNS servers. (Maybe they are not normally
> listed, even on active interfaces.)

They are not. Run the following commands to find out about these things:
man route # eg run route -n
man resolv.conf # eg run cat /etc/resolv.conf

> #ifup usb0
> replied with
> ifup: interface usb0 already configured
> so that command was not necessary in this case - the automatic up/down
> seems to be working correctly.

Yes, that's what I hinted at. The line "allow-hotplug usb0" makes it
automatic (unless something goes wrong).

> # ping www.google.com
> failed, but worked when typed into a terminal app on the phone.

OK, so internet did not work.

> # route
> revealed that the laptop was still using the gateway setting, and DNS
> settings, that are used whenever eth0 is up.

Are you able to attach your /etc/network/interfaces file?

Are you able to configure eth0 using allow-hotplug option?

Are you trying to access internet through BOTH eth0 and usb0, at the
same time, eg doing channel bonding?

Is eth0 a static or dynamic configuration?

Why do you still have eth0 enabled, when you are trying to connect to
internet through phone with usb0?

> wicd showed eth0 disconnected, but I issued
> #ifdown eth0
> to be sure. Nevertheless,

May be do that before plugging phone in.

> # route
> still showed that the normal gateway and DNS settings used on our LAN
> were still set.

after re-plugging (or disable/enable usb tethering) on the phone?

>> allow-hotplug usb0
>> iface usb0 inet static
>> address 192.168.55.230 # manually set the address given
>> netmask 255.255.255.0 # as reported by ifconfig
>> gateway 192.168.55.1 # other end of USB as reported by ARP
> network 192.168.55.0 # added because eth0 had this
> broadcast 192.168.55.255 # added because eth0 had this
>> dns-nameservers 8.8.4.4 # google DNS server

If the above is a new attempt by you to configure things (eg using
static instead of dynamic/dhcp), then you should remove the ">"
characters at front of every line, otherwise it looks like you are
simply replying to someone else, and we don't see that you are
provided some new test data re your problem.

> I think Debian is working correctly - at least, all the settings look
> correct. At this stage, I conclude that the SGS2 is not functioning
> completely, in particular:
>
> (a) SGS2 DHCP does not issue a gateway or dns server address, and
> (b) its NAT function does not forward from tethered devices, onto its
> own upstream connection.

What menu option sequence are you using to
enable USB _tethering_ on your SGS2?
Please list your steps in detail.

> Unless anyone thinks there is more I could do in Wheezy to make this
> work, I'll concentrate on confirming the functionality of tethering
> and NAT in Android on SGS2; there may be an app which plugs these gaps.

As above, how are you enabling tethering on the phone?

> Reco, thank you for your clear advice, which was helpful. Zenaan, you
> also contributed in the thread and seemed to report success; were you
> able to test that devices tethered to the Samsung Galaxy S2 could not
> only be attached and 'see' a usb connection, but could also reach
> external internet through it?

Yes. My apologies if my statements were unclear on this fact. Wireless
tethering worked for me from SGS2 to a wheezy laptop, and a sid
laptop; USB tethering worked for me from SGS2 to the same wheezy
laptop (didn't test the sid laptop).

> If so, could you say what Android
> version the phone you tested with is using?

Possibly can let you know in time...

However, there are two areas for configuration of wireless on the SGS2
that I was setting up in this case (one to use wireless, one to
provide wireless tethering - ie to establish the phone as a wireless
hotspot for other devices). And it is on this tethering option screen,
that there were 3 tethering options:
a) wireless, which can be enabled at will,
b) USB tethering which could NOT be enabled until AFTER the usb cable
had been connected to the laptop, and
c) bluetooth tethering, which I assume is similar to wireless
tethering, but I didn't try, since the phone-owner's preference was to
use USB tethering anyway, to avoid the microwave radiation from the
wireless option (but the wireless was a backup I wanted to test).

Good luck,
Zenaan


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/CAOsGNSRw1BCs7Lr-_zEq8FQO...@mail.gmail.com
0 new messages