Linux Stall
  • Home
  • Android
  • How to
  • Perl
  • Tips
  • Tutorials
No Result
View All Result
Linux Stall
No Result
View All Result
Home Android

Android Tethering: Using Android to access internet on your Linux machine

Chankey Pathak by Chankey Pathak
February 8, 2012
in Android
47 1
12
Android tethering Linux
16
SHARES
799
VIEWS
Share on FacebookShare on Twitter

What is Android Tethering?

Android Tethering is a way to access internet on your computer with the help of your Android smartphone. USB and Wi-Fi access point tethering is natively supported from Android Froyo 2.2.

Android tethering Linux

USB tethering

For USB tethering you must have root access to the phone and a USB cable to connect your phone to computer.

Step 1: First of all you will have to enable USB debugging on your Android. Go to Settings -> Applications -> Development -> USB debugging and enable it. After enabling just reboot your phone.

Step 2: Connect your phone to computer using USB cable.

Step 3: Now enable tethering option from your phone. For this go to Settings -> Wireless & Networks -> Internet tethering and enable it.

Step 4: Open up terminal on your computer and run the command given below

 ifconfig -a

The output will be like:

eth0      Link encap:Ethernet  HWaddr 40:61:86:B1:E9:33
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:480 (480.0 b)  TX bytes:480 (480.0 b)

usb0      Link encap:Ethernet  HWaddr C2:5A:11:8D:43:F5
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

usb0 is denoting your Android device. If you don’t see it then you will have to load the usbnet module and you can do that using modprobe command as:

 modprobe usbnet

Step 5: Now to configure new network device via DHCP use the command given below:

 ifconfig usb0 up && dhcpcd usb0

For configuring the new network device using iproute toolkit the command is:

 ip link set usb0 up && dhcpcd usb0

For stopping the network sharing the command is:

 dhcpcd -x usb0

Netcfg

You can use Netcfg to configure USB tethering, for that just add a static ethernet configuration like:

/etc/network.d/usb-tether

CONNECTION='ethernet'
DESCRIPTION='A basic dhcp ethernet connection using iproute'
INTERFACE='usb0'
IP='dhcp'

Also see: Android Tethering via USB/Wi-Fi/Bluetooth

Tags: Androidhow toTethering
Previous Post

Unity keyboard Shortcuts

Next Post

Reference in Perl

Chankey Pathak

Chankey Pathak

Data Scientist at Morgan Stanley. I've been using Linux since past 12 years. I plan to share what I know about Linux in this blog.

Related Posts

ubuntu on android
Android

Ubuntu for Android

February 22, 2012
Android-icecream-sandwich
Android

Here’s why you can’t update to Ice Cream Sandwich right away

February 15, 2012
Next Post
Reference in Perl

Reference in Perl

Comments 12

  1. Jamespcole says:
    9 years ago

    You don’t need to do any of this or need root access, i’ve had 3 android phones (hero, desire, galaxy SII) and I’ve never had to do any of this. Just plug it in and select USB tethering and it is recognised by ubuntu as an ethernet adapter.

    Reply
    • Chankey Pathak says:
      9 years ago

      You will need root access to the phone (for old Android versions, Froyo (Android 2.2) and beyond can do it natively). I agree that most Linux distros will recognize it automatically as soon as you enable USB tethering but there are some distros which will not do the same, in that case you will have to follow the steps given above.

      Reply
    • asda says:
      9 years ago

      ubuntu is not a real distro, just some toy that rarely works right and can’t be updated without destroying the system. just try do apt-get upgrade on a minimally customized system. it’s windows ME all over again.

      Reply
  2. jamespcole says:
    9 years ago

    Fair enough, did you add the bit to the start of the article about 2.2 or do I just suck at reading and comprehension(in which case apologies)

    Reply
    • Chankey Pathak says:
      9 years ago

      LOL! I didn’t add anything sir. I guess you missed that by mistake :)

      Reply
  3. jamespcole says:
    9 years ago

    My bad, sorry, looks like i need to work on my reading skills. BTW cheers for the guide on the cinamon install trying it right now, pretty slick

    Reply
    • Chankey Pathak says:
      9 years ago

      Thank you :) If you like our posts then you can subscribe via email to get updates in your email-box. Have a good day!

      Reply
  4. jamespcole says:
    9 years ago

    BTW the HTC Hero supported tethering since Android 1.5, hence why i was confused. I didn’t realise it was vendor specific before 2.2 because it seems all factory unlocked HTC’s(and some carrier locked ones) have supported tethering since 1.5 without rooting.

    http://insidesprintnow.files.wordpress.com/2009/09/hero_gsg.pdf

    Lol, had to look it up for my own piece of mind, i was sure i could remember tethering on my old Hero back in the day.

    Reply
  5. MoFro says:
    7 years ago

    I keep getting : “The program ‘dhcpcd’ can be found in the following packages:
    *dhcpcd
    *dhcpcd5

    Try: sudo apt-get install

    When I try sudo apt-get install dhcpcd i grt:
    Package dhcpcd is not available, but is referred by another package, or is only available from another source
    E: Package ‘dhcpcd’ has no installation canidate.
    And install dhcpcd5 is.
    E: Unable to locate package dhcpcd5

    Reply
  6. Graham says:
    2 years ago

    use dhclient not dhcpcd:

    dhclient -v usb0

    Reply
  7. Ahmed says:
    8 months ago

    Hellio all
    We are here 2020
    I still have a problem tethering my Samsung note8 to kali linux 4.0.0-kalil-686-pae Debian i686
    When I do ifconfig -a
    I don’t see usb0

    Also if I do
    ifconfig usb0 up && dhcpcd usb0
    Usb0: error while getting interface flag: no such device

    Reply
  8. Ahmed says:
    8 months ago

    lsusb
    Device 007: ID 04e8:6863 Samsung electronics co ( network tethering)

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Terms and Conditions
  • Contact Us
  • About Us

© 2012 - 2020 Linux Stall - A place for all your Linux needs.

No Result
View All Result
  • Home
  • Android
  • How to
  • Perl
  • Tips
  • Tutorials

© 2012 - 2020 Linux Stall - A place for all your Linux needs.

Welcome Back!

Login to your account below

Forgotten Password?

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In