I am setting up one of these with some friends who need a simple set up. They are tethering an Android phone to the router using a USB cable. Now, to get everything to work, they need to set the tethering option on the phone to ‘On’. Then they need to go into the router interface to tell the router to ‘Connect’. I know that they will need to turn on tethering when they connect the phone, but would like the router to automatically connect when this happens. Is there a way to set the router to automatically connect to the tethered phone when it is connected?
What I had also been asking in this thread already started
I see you are asking about priorities. That is not my issue and you don’t mention auto connecting to a tethered phone. Since this is the only internet source, priorities is not the issue. The real issue is when tethering is engaged on the phone, the router auto connects to that source rather than requiring the use to go to the internet connection page on the router and clicking the ‘Connect’ button.
The clicking of the ‘Connect’ button is what I am asking about automating, not priority.
Normally, ‘CONNECT’ on the router interface only needs to be set once.The Settings on your phone depend on your phone model.
What we are both trying to achieve, regardless of priorities, is this:
mrschwarz - without WAN cable connected the mobile will be set to Tethering On, then when mobile is connected to the router via USB the router will be set as “Connect to USB Tethering” automatically.
exitguyaus - as above. Also, if WAN cable is connected and internet working then when mobile is connected via USB it should override WAN cable until disconnected, at which time it will revert back to WAN cable if connected to active internet.
Now in the firmware, you have to click “connect” for at least the first time. Later it will auto connect when you connect your phone.
If you do not want to click “connect” even for the first time, then it may involve some R&D work to modify the firmware. Although it is not very complicated but we prefer not to do that. By asking click at least one time, the users know what he want to achieve and we will not mess up by automatic setting up tethering.
exitguyaus - Thanks for clarifying.
alzhao - I don’t mind clicking it for the first time. I have had to do it in the past for more than the first time. As a test, I just connected it now without having to click connect. I’ll keep testing it to see if it always auto-connects, which is my goal.
Thanks for the responses!
OK - just did some tests to see what happens
 WAN cable to active Internet, Plug in mobile via USB & set to Tethering On, Logged into router GUI
Internet shows Cable active (Green dot), also shows Tethering available so hit Connect, Internet now shows both Cable & Tethering active (Green dot on both)
Ran Speedtests which show current speed available is via WAN cable internet connection, Tethering not used even though it shows as also active
- conclusion, plugging in mobile with tethering does not deactivate the WAN cable if connected to an active internet, WAN cable will continue to be used as the internet connection
 WAN cable disconnected, Plug in mobile via USB & set to Tethering On, Logged into router GUI
Internet shows Cable inactive (Grey dot), shows Tethering available so hit Connect, Internet now shows Tethering active (Green dot)
Ran Speedtests which show current speed available is via mobile Tethering internet connection
- conclusion, plugging in mobile with tethering needs to have the WAN cable disconnected or no WAN internet connection for it to become the active internet connection
This is exactly what it supposed to work.
WAN will always be the priority when it is connected.
If you want to achieve that when tethering is connect, the traffic goes to tethering, pls just change the priority of wan/tethering connection. In order to do this, pls ssh to the router and change “metric” in /etc/config/network
Now wan metric is 10, tethering metric is 30. A lower number means higher priority. Just change the number as you like. It can be just an integer.
Thanks for that info, got it now - will play around with the config as you suggested and see how it goes.
ATM very happy with the unit, so far it’s been flawless - learning more about it & OpenWRT every day.
alzhao, thank you for your helpful answers in this thread.
I have a similar issue and thought it would be appropriate to include it here.
I’m using tethering and have both an iPhone and an Android. I notice that the first time either phone is connected I need to go into router settings > internet tab and click ‘Connect.’
For the Android, the tethering device ‘USB0’ becomes available–and Active, once ‘Connect’ is clicked the first time.
For the iPhone, the tethering device ‘ETH2’ becomes available–and Active, once ‘Connect’ is clicked the first time.
The problem is that once ‘ETH2’ has been activated by clicking ‘Connect’, the router forgets that I have already clicked ‘Connect’ for ‘USB0’, and I have to go back into the router settings and click ‘Connect’ again for that device, and vice-versa. In other words you can’t switch tethering between your Android and your iPhone without clicking ‘Connect’ again each time you switch them.
What can I do to make it so that I only have to click ‘Connect’ the first time for ‘USB0’ and ‘ETH2’ devices, and it never forgets them when switching?
If that isn’t possible, what command is the ‘Connect’ button performing so I can just automate that somehow?
Open to all answers, thank you everyone…
You want to have two interfaces, one for USB0 and one for ETH2. You cannot do this in the default UI, here is what you should do:
SSH to the router and edit
You will find the config like below.
config interface 'tethering' option proto 'dhcp' option ifname 'eth2' option metric '30' option disabled '0'
You should copy this section and create another section. Give it a new name e.g. tethering1. You can change the metric 30 to other values, e.g. 35 or 50 to give it another priority. The less the value, the more priority.
config interface 'tethering1' option proto 'dhcp' option ifname 'usb0' option metric '30' option disabled '0'
Then you should edit
/etc/config/firewall and find the following section, and add tethering1
config zone option name 'wan' option input 'REJECT' option output 'ACCEPT' option forward 'REJECT' option masq '1' option mtu_fix '1' option masq6 '1' option network 'wan wan6 tethering tethering1'
Then reboot your router and it should be OK.
Please note, you should not use the UI to connect tethering later because it may erase your modifications.
Thank you for the beautiful solution my friend. You really helped me a lot (and probably others too). You definitely earned your good-karma points for today.
I may have a follow-up question. But I will try to save it so you can earn your good-karma points on another day also…