Page 1 of 1

Connect to internet using tethered android through usb

Posted: Mon Mar 29, 2021 8:31 pm
by wanthinker

So, i recently started to use my android device's (tablet) internet connection by using a special tethered setup (which I'll detail below), given my built-in antenna (in this computer) isn't the best, and i didn't want to:

- widen range on my modem (doesn't support that)
- buy an external one
- change provider
- use a different computer/have it "repaired" (i don't see it as being broken since it was always like this...)
etc

Now, to add a bit more difficulties, the reason I'm using the word "special" above is because, the rom I'm using for this tablet *does not* support normal tethering, or at least doesn't work too well with it...

Though i may know i could always ask on that forum or even switch rom, i prefer not to (for a lots of reasons)...
So i used the following working setup.
Only difference is i do it through usb, by using the following:

Code: Select all

sshd -dD -p 8081

on the android device through termux (or any other terminal application following the above linked setup)

and

Code: Select all

adb forward tcp:8081 tcp:8081
sshuttle --listen 0.0.0.0 -r user@localhost:8081 0/0

running on the main machine locally.

While everything work fine, i did notice that, i couldn't connect to it directly, and had to use wifi at the same time for it work...I think this is mainly because the setup above doesn't use a separate network device, but instead use the `lo` or loop device (which i can clearly see is the one being used when using `ifconfig` instead of wifi/ethernet device)

So I'm curious, how could i connect to it *directly*? Do i need to create a separate network device and use it with this setup? or is there a way/command to connect to the `lo` or loop network device directly?

Again, this works perfectly, minus the fact i can't connect to it directly, and it "silently" connect without it being assigned to a device (eg, like ethernet)...
PS: I'm on fossapup 9.5 (x64)


Re: Connect to internet using tethered android through usb

Posted: Mon Mar 29, 2021 9:13 pm
by ThruHammer

When tethered, "ip link" shows an interface, correct?


Re: Connect to internet using tethered android through usb

Posted: Mon Mar 29, 2021 10:44 pm
by wanthinker
ThruHammer wrote: Mon Mar 29, 2021 9:13 pm

When tethered, "ip link" shows an interface, correct?

Sadly it doesn't :/ Only the usual ones: lo (which is what my previously mentioned setup is actually using), wlan0 and eth0.

I'm guessing trying to route/bridge the traffic between an unused network device (maybe like eth0?) with lo might actually work but not sure how to do that.

Someone suggestion on one of the comment from the sshuttle project issue's pages seems like it could work, but really not sure how to do that in this case (though i do know how to create a network device, just not sure how to use it/how it apply in the above)

Aware i know i could ask on the github issues page but I'm too used waiting multiple weeks or even months there (sometimes with no answer at all, where i find the answer myself or somewhere else), so i prefer not to (for this reason and probably other ones)...


Re: Connect to internet using tethered android through usb

Posted: Mon Mar 29, 2021 10:48 pm
by wanthinker
ThruHammer wrote: Mon Mar 29, 2021 9:13 pm

When tethered, "ip link" shows an interface, correct?

Btw, i did try the link you posted, but this would *only* work if i was using "normal" tethering on android (which i can't, as i mentioned in my post, because of the rom I'm stuck with) where you usually just go into setting of the phone and enable it there.


Re: Connect to internet using tethered android through usb

Posted: Tue Mar 30, 2021 12:29 am
by ThruHammer

My reply was limited because I'm not familiar with this ROM setup you speak of.

Edit: Ah, you're using an Android ROM because your data plan doesn't allow tethering. I see.

Is "RNDIS" an option on this ROM? How about PdaNet+ from the PlayStore?

Are "developer options" enabled on your tablet? I'm guessing yes.

Just rambling here because I have no first hand experience with your described setup.

I am however curious as to which modules "lsmod" shows as loaded when you're connected.

You could then dump the output here and leave us a link.