[GUIDE] Reverse USB tethering from Debian GNU Linux to Transformer Prime - Asus Eee Pad Transformer Prime

This is used when you wish to share a wired ethernet connection from a laptop/desktop to the Transformer Prime via the USB cable.
Ethernet -> Laptop -> USB -> Transformer Prime
All shell commands are issued from your Debian system.
This assume that your ethernet interface is eth1. You can find out this way:
Code:
/sbin/ifconfig -a
On the Transformer Prime activate USB Tethering
Settings > Wireless & Networks > More > Tethering & portable hotspot > USB tethering
On your Debian GNU Linux system:
Code:
su
ifconfig eth1 0.0.0.0
ifconfig usb0 0.0.0.0
brctl addbr br0
brctl addif br0 eth1
brctl addif br0 usb0
ifconfig br0 up
dhclient br0
adb shell netcfg rndis0 dhcp
adb shell netcfg|grep rndis0
The final command should show your rndis0 interface with an IP address. Your Debian system will no longer have an IP for eth1, intead it will use br0
At this pont you should be able to browse the web from the Transformer Prime.
To shut down the bridge:
Code:
su
ifconfig eth1 down
ifconfig usb0 down
ifconfig br0 down
brctl delbr br0
ifconfig eth1 up
dhclient eth1
ifconfig eth1
You may now disable tethering on the Transformer Prime.
Script it
To make this easier you can simply put these commands in a bash script and execute the script.
Code:
# more tetheron
Code:
#!/bin/bash
# Enable reverse USB tethering
ifconfig eth1 0.0.0.0
ifconfig usb0 0.0.0.0
brctl addbr br0
brctl addif br0 eth1
brctl addif br0 usb0
ifconfig br0 up
dhclient br0
adb shell netcfg rndis0 dhcp
adb shell netcfg
Code:
# more tetheroff
Code:
#!/bin/bash
# Disable reverse USB tethering
ifconfig eth1 down
ifconfig usb0 down
ifconfig br0 down
brctl delbr br0
ifconfig eth1 up
dhclient eth1
Know issues:
network-manager in GNOME wants to control the ethernet interface. I found it easiest to disable it.
Code:
service network-manager stop
Note - All of this knowledge is freely available via google although I did not find a specific reference to the Transformer Prime and the rndis0 interface.

Fantastic!
You seem like a great candidate for my question lol
Is there any way we could do this same thing but from another Android device?
I would love nothing more than to be able to use my phone to USB tether to my Prime so that I can avoid using up all my battery broadcasting WiFi.

Related

[REQ] Need App to Bluetooth DUN Tether to Feature Phone

I need Bluetooth DUN tethering support to connect to my generic DUN capable feature phone.
If you don't have that, I'd be happy if someone could just tell me how to install "pppd, rfcomm, and sdptool" so I can access them in Terminal.
Try from terminal if u have root:
su
pand --connect <remote BT device hex address>
ifconfig bnep0 down
dhcpcd bnep0
setprop net.dns1 8.8.8.8
I have my phone paired... This tutorial looks like it might be for PAN, and I think I only have DUN.
This is what i get...
$ su
# pand --connect a0:78:ba:24:cd:aa
# ifconfig bnep0 down
error: SIOCGIFFLAGS (No such device)

[Q] MAC Changing in GT-S5302

I want to change the wifi mac address of my GT-S5302. I have tried many apps like Wireless Mac Address Changer but all failed.
Also tried:
Code:
busybox ifconfig //determine device usually eth0
busybox ifconfig eth0 down //shuts down eth0
busybox ifconfig eth0 hw ether 00:00:00:00:00:00 //sets eth0's mac to 00...
busybox ifconfig eth0 up //turn eth0 back on
busybox ifconfig //check to see if eth0 is set to new mac
After changing MAC when i execute "busybox ifconfig" the new mac is reflected but it is not letting me connect to my existing network. I have to restart wifi to get connected but it resets the mac address to the original one.
And also tried editing the ".nvmac.info" , "nvram.txt" ,"nvram_mfg.txt" but all in vain.
Can any one suggest me a working method to change WIFI MAC address for GT-S5302 ?
Thanx in advance :good:
Can anyone please tell me that why I'm disconnected from my existing network after executing these commands?
Code:
busybox ifconfig //determine device usually eth0
busybox ifconfig eth0 down //shuts down eth0
busybox ifconfig eth0 hw ether 00:00:00:00:00:00 //sets eth0's mac to 00...
busybox ifconfig eth0 up //turn eth0 back on
busybox ifconfig //check to see if eth0 is set to new mac

[Q] Networking question

Hi All,
I have a stupid Juniper VPN device at work which does not support 64 bit linux clients using netconnect. I have found ways around this previously, but now we are setting up 2 factor auth which throws a lot of javascript into the mix, making the scripts I used pretty much obsolete. The Junos pulse client works well for android, so I am thinking I want to use an android device as a router. Connecting to the VPN and using wifi tethering does not work, same with USB tethering does not work, and those are not exactly what I want anyway.
So basically I want to be able to connect my android device to my wifi here at home, connect to the VPN on it, run a script to do my setup on the Android device, lastly add a route on my client pc to tunnel through the android device. here is what I tried so far on the device:
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
iptables -P FORWARD ACCEPT
iptables -t nat -I POSTROUTING -s 192.168.0.0/16 -d 10.0.0.0/8 -j MASQUERADE
ip rule add from all to 10.0.0.0/8 fwmark 0x3c lookup 60
and on the client PC:
Code:
route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.1.29
where 192.168.1.29 is the IP of my android device, and 10.0.0.0/8(I know its lazy) is the IP range I want to go through tun0 on the device. This is however not working.
The only thing I need to do on a standard linux box to do this would be:
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -I POSTROUTING -s 192.168.0.0/16 -d 10.0.0.0/8 -j MASQUERADE
And setup the same route command on the client but point it at the linux box instead. This currently works, but when we decide to flip the switch and use the 2 factor auth only I will not be able to make it work on a standard linux box, but 2 factor does work on android via the Junos app.
I fear I am missing something simple in Android land, please help...

[Q]How to Change Mac address

i used kindle fire HDX 7 with Nexus 2.0.1
other Android device can change MAC address by
using ADB shell with busybox
# ifconfig eth0 |grep HWaddr
# ifconfig wlan0 down
# ifconfig wlan0 hw ether 00:10:11:AB:CD:EF (Which i want to change MAC)
# ifconfig wlan0 up
but i doesn't work. with' SIOCSIFHWADDR : Operation net supported'
and there are no way to change Mac address?

reverse tethering - offline for some applications

I try to get internet on my phone from my computer without installing any tools.
In short when I try a ping to youtube.com it work but the youtube application on the phone
tells me I have no connection.
My configuration looks like :
Code:
mybox -----(Ethernet)------[my computer]------(USB)-----[the phone]
and my phone is in airplane mode to prevent wifi or mobile connections.
I enabled usb tethering so I have two interface on my computer : eth0 and usb0.
Then I have done on the computer:
Code:
sudo ifconfig eth0 0.0.0.0
sudo ifconfig usb0 0.0.0.0
sudo brctl addbr br0
sudo brctl addif br0 eth0
sudo brctl addif br0 usb0
sudo ifconfig br0 up
sudo dhclient br0
and on the phone :
Code:
su
netcfg rndis0 dhcp
After that i have the following configuration :
Code:
IP of rndis0 on the phone : 192.168.1.35/24
IP of br0(eth0 + usb0) on my computer : 192.168.1.17/24
IP of the box : 192.168.1.1/24
If i try to ping the ip adress 8.8.8.8 or any other adresse, it works.
But if I try with a domain it doesn't work :
Code:
[email protected]:/ # ping google.com
ping: unknown host google.com
It look like a DNS problem but i don't understand why because rndis0 give its address from dhcp which also give dns server address.
getprop | grep dns give me
Code:
[dhcp.wlan0.dns1]: [192.168.1.1]
[dhcp.wlan0.dns2]: []
[dhcp.wlan0.dns3]: []
[dhcp.wlan0.dns4]: []
[net.change]: [net.rndis0.dns2]
[net.dns1]: [fe80::8ef8:13ff:fe02:50ea]
[net.dns2]: [192.168.1.1]
[net.rndis0.dns1]: [192.168.1.1]
[net.rndis0.dns2]: []
I know these variables are ignored.
Then I try :
Code:
ndc resolver flushnet rndis0
ndc resolver clearnetdns rndis0
ndc resolver setnetdns rndis0 "" 8.8.8.8 8.8.4.4
and ping google.com now work. I don't understand why the dhcp doens't work...if you can explain.
If I try to connect to any website from google chrome application on my smartphone, it works !
But now when I try to use Youtube application on my smartphone it tell me "No connection".
Do you know why ?

Categories

Resources