2024 - Android USB tethering to DD-WRT router?

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page 1, 2  Next
Author Message
baboeska
DD-WRT User


Joined: 22 Jun 2011
Posts: 64

PostPosted: Sat Apr 06, 2024 12:46    Post subject: 2024 - Android USB tethering to DD-WRT router? Reply with quote
Does anyone has a solution to the problem of usb tethering from android phone mobile data as wan device for dd-wrt routers?
And a set of commands that are useful for?

The old guides, which use a variety of these commands, don't appear to work on builds from the last couple of years.
udhcpc -i usb0 gets a response, so the internet is out there, but what next?

insmod mii.ko
insmod usbnet.ko
insmod rndis_host.ko
ifconfig usb0 up
udhcpc -i usb0
iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE
iptables -A FORWARD -i br0 -j ACCEPT
iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
route add default gw usb0
nvram set wan_iface=usb0
nvram set wan_ifname=usb0
nvram set wan_ifname2=usb0
nvram set wan_ifnames=usb0
Sponsor
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1952

PostPosted: Sat Apr 06, 2024 13:19    Post subject: Reply with quote
Do you have the required kernel modules compiled and stored in an accessible location (JFFS, 2nd USB port on thumb drive)?
_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
baboeska
DD-WRT User


Joined: 22 Jun 2011
Posts: 64

PostPosted: Sat Apr 06, 2024 14:12    Post subject: Reply with quote
dale_gribble39 wrote:
Do you have the required kernel modules compiled and stored in an accessible location (JFFS, 2nd USB port on thumb drive)?

Yes.
On a lot of routers with over 20mb flash they are built into the firmware nowadays.
That's not the issue. Cellphone internet via usb cable to router then shared last worked for me at I think r51140.
As I said, "udhcpc -i usb0" does lead to an ip address being assigned from the mobile providers network, but I can't ping anything.
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1952

PostPosted: Sat Apr 06, 2024 18:15    Post subject: Reply with quote
Was this the guide you followed? If so, your insmods were incomplete or completely wrong.

Cellular Phone/USB Modem As WAN Connection | DD-WRT Wiki

Cellular Phone/USB Modem As WAN Connection | DD-WRT Wiki wrote:
Code:
insmod usbnet.ko
insmod cdc_ether.ko
insmod rndis_host.ko
ifconfig usb0 up
udhcpc -i usb0

_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
baboeska
DD-WRT User


Joined: 22 Jun 2011
Posts: 64

PostPosted: Sun Apr 07, 2024 9:21    Post subject: Reply with quote
dale_gribble39 wrote:
Was this the guide you followed? If so, your insmods were incomplete or completely wrong.

Cellular Phone/USB Modem As WAN Connection | DD-WRT Wiki

Cellular Phone/USB Modem As WAN Connection | DD-WRT Wiki wrote:
Code:
insmod usbnet.ko
insmod cdc_ether.ko
insmod rndis_host.ko
ifconfig usb0 up
udhcpc -i usb0


Hi Dale,
The last time I tested, the exact following was in my startup.

"
insmod usbnet.ko
insmod cdc_ether.ko
insmod rndis_host.ko
ifconfig usb0 up
udhcpc -i usb0
"
And that didn't do the job. I followed the standard guide, thanks for asking, it doesn't work and hasn't worked since r51140.
Would be good to see it working.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14242
Location: Texas, USA

PostPosted: Tue Apr 09, 2024 17:21    Post subject: Reply with quote
I flashed the current release (55678) to my R7000P to test both the method in the Wiki and discussion here as well as r/DDWRT | Guide: Android USB tether as WAN and was also quite unsuccessful. That being said, I have inquired with the developer as there have been many changes to DD-WRT since the Wiki and reddit guide were written that possibly could affect this. Hoping to convince BrainSlayer (and @egc) to come up with a working solution for this that is native for routers that support the kernel modules required by default. I had to wait to enable USB tethering on my phone, but even waiting 10 minutes, still no WAN IP given. Didn't attempt to issue a second udhcpc -i usb0 to see if it would cooperate, but if you attempt what I tried and do that and have some success, please report. Attaching screenshots and logs. Note that usb0 is not a choice to set the WAN port assignment, and it shows as disabled in WAN Status.

Edit: fixed reddit link label



Screenshot 2024-04-09 at 11-56-38 R7000P (build 55678) - Diagnostics and Commands.png
 Description:
 Filesize:  162.52 KB
 Viewed:  893 Time(s)

Screenshot 2024-04-09 at 11-56-38 R7000P (build 55678) - Diagnostics and Commands.png



Screenshot 2024-04-09 at 11-55-36 R7000P (build 55678) - Networking.png
 Description:
 Filesize:  264.29 KB
 Viewed:  893 Time(s)

Screenshot 2024-04-09 at 11-55-36 R7000P (build 55678) - Networking.png



Screenshot 2024-04-09 at 11-54-19 R7000P (build 55678) - WAN Status.png
 Description:
 Filesize:  112.57 KB
 Viewed:  893 Time(s)

Screenshot 2024-04-09 at 11-54-19 R7000P (build 55678) - WAN Status.png



_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net


Last edited by kernel-panic69 on Thu Apr 11, 2024 19:13; edited 1 time in total
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14242
Location: Texas, USA

PostPosted: Tue Apr 09, 2024 17:23    Post subject: Reply with quote
PuTTY logs for reference.


R7000P_Android_Tether.log.txt
 Description:

Download
 Filename:  R7000P_Android_Tether.log.txt
 Filesize:  83.84 KB
 Downloaded:  15 Time(s)


_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
baboeska
DD-WRT User


Joined: 22 Jun 2011
Posts: 64

PostPosted: Thu Apr 11, 2024 9:40    Post subject: Reply with quote
This could be far less than ideal for using the vast majority of DD-WRT's other features, but maybe having the router in bridged mode along with udhcpc -i usb0 & etc in startup might do it.
But then you'd be locked out of config.

kernel-panic69 wrote:
I flashed the current release (55678) to my R7000P to test both the method in the Wiki and discussion here as well as Guide: r/DDWRT | Android USB tether as WAN and was also quite unsuccessful. That being said, I have inquired with the developer as there have been many changes to DD-WRT since the Wiki and reddit guide were written that possibly could affect this. Hoping to convince BrainSlayer (and @egc) to come up with a working solution for this that is native for routers that support the kernel modules required by default. I had to wait to enable USB tethering on my phone, but even waiting 10 minutes, still no WAN IP given. Didn't attempt to issue a second udhcpc -i usb0 to see if it would cooperate, but if you attempt what I tried and do that and have some success, please report. Attaching screenshots and logs. Note that usb0 is not a choice to set the WAN port assignment, and it shows as disabled in WAN Status.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14242
Location: Texas, USA

PostPosted: Thu Apr 11, 2024 13:29    Post subject: Reply with quote
Yeah, well, because of your inquiry, I again prodded about adding support for Android Tethering and:

Android Tethering Added

Add ncm support

Android Tethering fixes

Should be in the next public release to test. CoolWink



Screenshot 2024-04-11 at 09-15-36 R7000P (build 55776) - Setup.png
 Description:
 Filesize:  225.4 KB
 Viewed:  753 Time(s)

Screenshot 2024-04-11 at 09-15-36 R7000P (build 55776) - Setup.png



_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
zoinbergs
DD-WRT Novice


Joined: 20 Apr 2022
Posts: 1

PostPosted: Fri Apr 12, 2024 8:19    Post subject: Reply with quote
Hey guys! I just wanted to personally THANK ALL OF YOU for implementing this new permanent "Android Tethering" mode in DD-WRT. I was just about to setup some shoddy USB-To-Ethernet adapter with my Franklin T10, of which you just COMPLETELY eliminated the need to do!

PLUS, as I just discovered, this new fix you implemented solved my DOUBLE NATTING issue that I was trying to figure out how to resolve with the T10. But now I don't even need to worry about that! IT ALL JUST WORKS!

Seriously, I don't think you guys get enough praise for all the hard work that you do.

THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU ! ! ! ! ! !

Edit: I did have one quick question: Do I still need to set my MTU to 1428, or can I leave it at 1500 now?
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1075
Location: WV, USA

PostPosted: Fri Apr 12, 2024 16:51    Post subject: Reply with quote
zoinbergs wrote:
Edit: I did have one quick question: Do I still need to set my MTU to 1428, or can I leave it at 1500 now?

You can check the MTU from the command line with "ip a | grep mtu". It may be automatically and blindly set to 1428. This command will tell you for sure.

_________________
Linksys EA8500 (Internet Gateway, AP/VAP) - DD-WRT r53562
Features in use: WDS-AP, Multiple VLANs, Samba, WireGuard, Entware: mqtt, mlocate
Wireless 5ghz only

Netgear R7800 (WDS-AP, WAP, VAP) - DD-WRT r55779
Features in use: multiple VLANs over single trunk port

Linksys EA8500 WDS Station x2 - DD-WRT r55799

Netgear R6400v2 WAP, VAP 2.4ghz only w/VLANs over single trunk port. DD-WRT r55779

OSes: Fedora 38, 9 RPis (2,3,4,5), 20 ESP8266s: Straight from Amiga to Linux in '94, never having owned a Windows PC.

Forum member #248
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14242
Location: Texas, USA

PostPosted: Sat Apr 13, 2024 16:42    Post subject: Reply with quote
Just for the sake of clarity in case folks with lower-end devices with USB ports wonder why they do not have the option (or the option of iPhone Tethering) in current releases:

kernel-panic69 wrote:
I believe all Linux 4.x and up supported devices are the only ones with the option. A report I got via email for TL-WR1043ND v1 is a no, and I have not checked my TL-WR1043NDv2 or my WZR-HP-G300NH. Most all devices with USB port *could* support it, but it would probably require trimming fat elsewhere. As noted elsewhere before, one quick-ish and easy way to make space is swap ProFTPD for vsftpd, but once we have gone with a smaller footprint ssl package to replace OpenSSL, that would also free up some space.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
baboeska
DD-WRT User


Joined: 22 Jun 2011
Posts: 64

PostPosted: Mon Apr 15, 2024 12:11    Post subject: Reply with quote
lexridge wrote:
zoinbergs wrote:
Edit: I did have one quick question: Do I still need to set my MTU to 1428, or can I leave it at 1500 now?

You can check the MTU from the command line with "ip a | grep mtu". It may be automatically and blindly set to 1428. This command will tell you for sure.


Thanks, with android tethering enabled, came back as 1500 by default.
Should I change it to 1280 or 1428?

With some routers, enabling Core USB will be required to see android tethering in the menu.
I note CTF but no CTF+FA?
Very nice, works now from latest release, thank you devs.

~# ip a | grep mtu
1: lo: <LOOPBACK,MULTICAST,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
2: teql0: <NOARP> mtu 1500 qdisc noop state DOWN qlen 100
3: ctf0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
5: vlan1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UP qlen 1000
7: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UNKNOWN qlen 1000
8: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
9: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
10: wl0.1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
11: wl0.2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
12: wl0.3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
13: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
17: tun1: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN qlen 1
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14242
Location: Texas, USA

PostPosted: Mon Apr 15, 2024 16:08    Post subject: Reply with quote
baboeska wrote:
With some routers, enabling Core USB will be required to see android tethering in the menu.

With *all* routers, Core USB support is required to enable Mobile Broadband, iPhone Tethering, or Android Tethering if included in the firmware. Not all USB-equipped routers have iPhone or Android Tethering, though.
baboeska wrote:
I note CTF but no CTF+FA?

Unrelated to the topic, but I thought you had to select CTF, click save, then CTF+FA would show on EA6900. Sir @egc can verify that.

IRT the MTU, I don't think there is a need to adjust since clamp TCPMSS to PMTU is default behavior in the firewall.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14242
Location: Texas, USA

PostPosted: Tue Apr 16, 2024 23:44    Post subject: Reply with quote
Not 100% if related, but will know soon enough as this may open up / fix (iPhone and) Android Tethering on older kernel devices:

For older kernels

Will be checking / testing as soon as I can get firmware images off the alpha server for specific devices in inventory.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum