Posted: Sat Apr 06, 2024 12:46 Post subject: 2024 - Android USB tethering to DD-WRT router?
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
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
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.
_________________ "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
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.
Joined: 08 May 2018 Posts: 14242 Location: Texas, USA
Posted: Tue Apr 09, 2024 17:21 Post subject:
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-55-36 R7000P (build 55678) - Networking.png
Description:
Filesize:
264.29 KB
Viewed:
893 Time(s)
Screenshot 2024-04-09 at 11-54-19 R7000P (build 55678) - WAN Status.png
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.
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?
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.
Joined: 08 May 2018 Posts: 14242 Location: Texas, USA
Posted: Sat Apr 13, 2024 16:42 Post subject:
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:
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.
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
Joined: 08 May 2018 Posts: 14242 Location: Texas, USA
Posted: Mon Apr 15, 2024 16:08 Post subject:
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.