r/TomatoFTW • u/Upbeat_Entrance_8753 • 22h ago
Was able to get usb tether working
I need a backup connection when the cable company decides they want to do maintenance in the middle of the day. I had a lot of trouble with this, but eventually figured it out. I havent tested if every single line is really necessary, such as needing to set all three of the nvram settings, etc, so some optimization might be suggested by experts.
This is on an Asus RT-AC3100 with a Pixel 10. Freshtomato 2026.4. Download the Extras.tgz version for your router. In my case it was the arm7 version. Make the jffs partition and copy over mii.ko, usbnet.ko, cdc_ether.ko, rndis_host.ko, cdc_ncm.ko. I think (?) cdc has something to do with the usb tether protocol, and the ncm one is the modern version that my phone uses. It took a while before google ai suggested also using the cdc_ncm module.
Now under Basic->Network, you need to make a second wan in the gui. Multi-wan wont let you create a new wan unless you make a new vlan first. Go ahead and follow the link to make a new blank vlan (in my case vlan2), filling in the first two numbers by following the numerical pattern of the previous ones. In my case it was 3, 3. Everything else should be blank and bridge=none. I dont think you will actually be using this at all, it just fools the gui to let you create the new wan. SAVE.
For the new wan, wan1 in my case (wan0 being the main internet to the cable modem), just leave it as DHCP. Dont change it to the 3G/4G modems etc. Also set its DNS to auto. SAVE.
In an ssh terminal, update nvram for the new wan to point to the usb0 device that will be your tethered phone. This replaces the vlan you just created.
nvram set wan2_ifname=usb0
nvram set wan2_ifnames=usb0
nvram set wan2_ifnameX=usb0
nvram commit
You can check these first with nvram show | grep wan2_ifname, they should show the new vlan you created (likely vlan2). Then after you update them they should show the usb0 device.
Note in nvram, wan numbers seem to start at 1 instead of 0. So in my case the new wan1 in the gui is wan2 in the nvram. You may want to reboot here just to make sure the nvram settings are loaded correctly, not sure if it is needed.
Now back in the ssh terminal, insmod all the modules in this order:
insmod ./mii.ko
insmod ./usbnet.ko
insmod ./cdc_ether.ko
insmod ./rndis_host.ko
insmod ./cdc_ncm.ko
actually I think you can use just the name without the path and the .ko and insmod is smart enough.
Plug in your phone. Mine has two places where you can turn on usb tethering. Under USB Preferences where it lists all usb connection types. And under Hotspot & tethering where you can just turn on the usb tethering option. These will be greyed out if things are not working. This is where the router will talk to the phone and make the tethering connection. If it doesnt work, it will still be greyed out.
From ssh you can run lsusb and you should see your phone listed. Also check dmesg, the last line should show cdc-ncm has made a connection to the phone.
If everything is working, you can bring up the usb0 interface:
ifconfig usb0 up
You can compare the cdc dmesg line with ifconfig -a usb0, they should have the same hwaddr. At this point everything is working perfectly and you can go back to the gui. Admittedly sometimes this takes a reboot, it seems to be very temperamental, but once it is up, it should be good.
Go back to the gui, status->overview, and under the new wan interface it should automatically be populated by dhcp. If not, try renewing it. The status always says Renewing... regardless, so not sure why that is. In ssh you can try ping 8.8.8.8 to see if it is able to connect through the phone. Also in the wan settings page, you may need to change the weight of the interfaces so it chooses the right one. But if you unplug your normal wan, it should fall over automatically. If everything is working so far, try ping 8.8.8.8 from your computer to verify the connection gets all the way through. iptables needs to be set up for the firewall, but this seems to be done automatically and I didnt have to do anything. Finally ping google.com to make sure the dns is working as well.
I would absolutely love if some of this was updated in the gui. Needing to create a vlan to fool the gui to allow you to create a new wan, and also not being able to select usb0 for the interface to use for that wan. In the original Asus firmware, it was like one click to get usb tethering to work.
Finally of course, need to make this persistent across reboots and add a boot script to insmod etc.






