Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
mvniekerk
Old
#1  
Senior Member - OP
Thanks Meter 380
Posts: 123
Join Date: Feb 2010
Location: Johannesburg

 
DONATE TO ME
Lightbulb HOWTO: Ubuntu USB reverse tethering

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 . 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...
The Following 2 Users Say Thank You to mvniekerk For This Useful Post: [ Click to Expand ]
 
adityaaserkar
Old
#2  
Junior Member
Thanks Meter 0
Posts: 1
Join Date: Sep 2012
Unhappy 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....
 
ravilov
Old
#3  
ravilov's Avatar
Senior Member
Thanks Meter 957
Posts: 1,680
Join Date: Jan 2010

 
DONATE TO ME
How is Chromium even related to DHCP and/or firewall settings?
 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...