[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: debian xfce network tethering an SGS2



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


Reply to: