HOWTO: Ubuntu USB reverse tethering

Search This thread

mvniekerk

Senior Member
Feb 11, 2010
127
384
Johannesburg
def:"Reverse tethering" : sharing your PC's internet connection with your Android phone.

This is suppose to work with any rooted Android device with the latest of Busybox. I own an Atrix and I use Ubuntu, and it works. If you own X and use Y, I don't care :p . It is also suppose to work with any USB tether-able Android device (like in proper, not the kind where you need to download an app for your PC to set up a SOCKS proxy of some kind).

I also use the Gingerbread ROM leaked for AT&T. This was done on Ubuntu 11.04 Natty, but the principles stay the same.

Let's get on with, shall we:
INSTRUCTIONS
  1. Install Firestarter and DHCP server
    sudo apt-get install firestarter dhcp3-server
  2. Connect to the internet
    Like you normally would. If you connected via WiFi, your connected device would probably be wlan0, if via ethernet - eth0, if via dialup - ppp0. If you are unsure, click on the Network Manager icon and click on Connection information. Otherwise, run ifconfig to see which device has got what IP address (to give you a hint as to what network device your PC is using).
  3. Start USB tethering on your Atrix
    Plug in the USB cable in your Atrix.
    Under Settings -> Wireless -> Tethering & Mobile Hotspot -> USB Tethering checked.
    Your Network Manager will try to get an IP address (and will probably succeed). Click on the Network Manager icon (probably the icon has changed to an ethernet port to signify that you are connected via USB) and click on "Edit Connections".
    Under the "Wired" tab double-click on USB0 to edit it
    Under the "IPV4" settings click on the "Routes" button
    Check the "Use this connection only for resources on its network"
    OK, Save
    You'll see the Network Manager icon will change back to its previous icon.
  4. Configure Firestarter
    Run firestarter
    If it is your first time to start firestarter, it will prompt you with the First Run Wizard. Otherwise, click on Firewall -> Run Wizard
    Click Forward to get past the intro screen.
    In the drop down box, select the device you are connected to the internet with.
    Click forward
    Check the "Enable internet sharing" option
    On the checkbox, select the "Unknown Device (usb0)" as your Local Area Network device
    Check the "Enable DHCP for local network" option
    On the DHCP server details, select the "Create new DHCP configuration:" option
    Click forward
    Uncheck the "Start Firewall now"
    Click save.

    Great, so Firestarter is set up. But, it saves the dhcpd.conf file (Natty specific? I don't know) in the wrong directory (/etc/dhcpd.conf instead of /etc/dhcp/dchpd.conf).
    sudo mv /etc/dhcpd.conf /etc/dhcp/dhcpd.conf
    Start the Firestarter firewall (in Firestarter, press CTRL-S)
  5. Configure the Atrix
    2 Options:
    1) While the device is connected via USB (and Applications -> Development -> USB debugging is enabled)
    sudo adb shell
    su bash
    netcfg usb1 dhcp
    2) Run in your terminal on your phone:
    su bash
    netcfg usb1 dhcp

If nothing failed, then everything worked. The principle is this : IP Chains between USB0 and <internet connecting device> (set up by Firestarter) with DHCP server running. This may not be the most über geek way of doing things but is sure point-and-clicky-easy-ish.

Et voilà, sweet reverse tethered nettubes...
 
  • Like
Reactions: SharkXI and panmoto

adityaaserkar

New member
Sep 6, 2012
1
0
No Enable DHCP checkbox

while i try everything .... i m stuck at the part where the 'Enable DHCP for local network' checkbox is inactive due to 'Chromium cannot be run as root'....
i dont know why this error kindly help me with this....
 

mogop

Member
Dec 2, 2012
10
0
failed

Code:
action 'dhcp' failed (Bad file number)
I'm using LightJB 1.2 Rom with CoCore-CWM 6.2
 
Last edited:

John-VEG

Member
Dec 14, 2015
14
0
Unfortunately my Network Manager hasn't succeed when I turned USB Tethering checked on Android since I've upgrade ubuntu from 14.04 to 16.04.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    def:"Reverse tethering" : sharing your PC's internet connection with your Android phone.

    This is suppose to work with any rooted Android device with the latest of Busybox. I own an Atrix and I use Ubuntu, and it works. If you own X and use Y, I don't care :p . It is also suppose to work with any USB tether-able Android device (like in proper, not the kind where you need to download an app for your PC to set up a SOCKS proxy of some kind).

    I also use the Gingerbread ROM leaked for AT&T. This was done on Ubuntu 11.04 Natty, but the principles stay the same.

    Let's get on with, shall we:
    INSTRUCTIONS
    1. Install Firestarter and DHCP server
      sudo apt-get install firestarter dhcp3-server
    2. Connect to the internet
      Like you normally would. If you connected via WiFi, your connected device would probably be wlan0, if via ethernet - eth0, if via dialup - ppp0. If you are unsure, click on the Network Manager icon and click on Connection information. Otherwise, run ifconfig to see which device has got what IP address (to give you a hint as to what network device your PC is using).
    3. Start USB tethering on your Atrix
      Plug in the USB cable in your Atrix.
      Under Settings -> Wireless -> Tethering & Mobile Hotspot -> USB Tethering checked.
      Your Network Manager will try to get an IP address (and will probably succeed). Click on the Network Manager icon (probably the icon has changed to an ethernet port to signify that you are connected via USB) and click on "Edit Connections".
      Under the "Wired" tab double-click on USB0 to edit it
      Under the "IPV4" settings click on the "Routes" button
      Check the "Use this connection only for resources on its network"
      OK, Save
      You'll see the Network Manager icon will change back to its previous icon.
    4. Configure Firestarter
      Run firestarter
      If it is your first time to start firestarter, it will prompt you with the First Run Wizard. Otherwise, click on Firewall -> Run Wizard
      Click Forward to get past the intro screen.
      In the drop down box, select the device you are connected to the internet with.
      Click forward
      Check the "Enable internet sharing" option
      On the checkbox, select the "Unknown Device (usb0)" as your Local Area Network device
      Check the "Enable DHCP for local network" option
      On the DHCP server details, select the "Create new DHCP configuration:" option
      Click forward
      Uncheck the "Start Firewall now"
      Click save.

      Great, so Firestarter is set up. But, it saves the dhcpd.conf file (Natty specific? I don't know) in the wrong directory (/etc/dhcpd.conf instead of /etc/dhcp/dchpd.conf).
      sudo mv /etc/dhcpd.conf /etc/dhcp/dhcpd.conf
      Start the Firestarter firewall (in Firestarter, press CTRL-S)
    5. Configure the Atrix
      2 Options:
      1) While the device is connected via USB (and Applications -> Development -> USB debugging is enabled)
      sudo adb shell
      su bash
      netcfg usb1 dhcp
      2) Run in your terminal on your phone:
      su bash
      netcfg usb1 dhcp

    If nothing failed, then everything worked. The principle is this : IP Chains between USB0 and <internet connecting device> (set up by Firestarter) with DHCP server running. This may not be the most über geek way of doing things but is sure point-and-clicky-easy-ish.

    Et voilà, sweet reverse tethered nettubes...