automate 4g usb dongle connection / disconnection

ericch51

Newbie
Joined
Sep 27, 2020
Messages
12
Reaction score
1
hello i am considering buying usb 4G dongle to plug it into laptop, but first looking for a solution to be able to change IP address every X minutes. If I turn off the dongle and turn it on again, it will reconnect to the 4G network and get a new IP address. Do you know how I can automate this? Is there a windows program to turn the dongle off and on again every X minutes? Thank you !!
 
The easiest way without hardware modification would be to reboot the machine on a schedule. It might sound idiotic if you connect the dongle to a laptop, but it is a feasible solution if you connect it to a sbc for example a raspberry pi, and then use the pi to create a wireless network (or use it's lan port) or something. For scheduling the reboot, use crontab.

Alertnatively, look for a 4g router that can do auto reboot. It will be a more robust solution, but it will definitely cost more than a pi.
 
Last edited:
Run batch script "Rasdial connection-name disconnect" and next line, "Rasdial connect".

This just off my memory, might be a little different. Can't know until I can check up what I used to do when I did do this with 4g modems. Can also iterate the sleep (x) amount of time in a loop in the batch script.

Cheers.
 
Run batch script "Rasdial connection-name disconnect" and next line, "Rasdial connect".

This just off my memory, might be a little different. Can't know until I can check up what I used to do when I did do this with 4g modems. Can also iterate the sleep (x) amount of time in a loop in the batch script.

Cheers.
Thanks
 
I'd like to do the same but with a phone used as a hotspot, to change ip every x minutes. But no solution since you can't activate/deactivate plane mode without rooting the phone.
 
Run batch script "Rasdial connection-name disconnect" and next line, "Rasdial connect".

This just off my memory, might be a little different. Can't know until I can check up what I used to do when I did do this with 4g modems. Can also iterate the sleep (x) amount of time in a loop in the batch script.

Cheers.
Did not understand anything.
 
I'd like to do the same but with a phone used as a hotspot, to change ip every x minutes. But no solution since you can't activate/deactivate plane mode without rooting the phone.
You can. With Autoinput and Tasker apps.

But it's messy though. And whole phone has to be dedicated to it
 
I'd like to do the same but with a phone used as a hotspot, to change ip every x minutes. But no solution since you can't activate/deactivate plane mode without rooting the phone.
indeed, I made this system with an old android phone and the application "automate" (and you need android < 6)...and now i would like to do the same with a usb 4g dongle

Edit : I think you can do this with the MacroDroid app on an unrooted phone ...
 
Last edited:
What dongle do you have? I used to do that on mine
 
Back
Top