Jump to content

Recommended Posts

Posted

Our internet connection via the LEA isn't reliable, despite their best efforts. Disruptions to the connection are frequent and I need a solution. I'm halfway there already, but the current method is inconvenient.

 

I have an Android phone with tethering built in. I can plug the phone into the machine via USB and connect to the internet, but I have to disable the NIC to do so (the web browsers continue to try and use the LEA connection if I don't) which is a bit annoying and leads to obvious problems.

 

Is there a way to force internet traffic through the tethered connection if it's present? I'm full up with a cold at the moment so I'm probably missing something pretty obvious.

 

Any suggestions appreciated.

Posted
Our internet connection via the LEA isn't reliable, despite their best efforts. Disruptions to the connection are frequent and I need a solution.

 

Any suggestions appreciated.

 

Assuming all of the above (and the subsequent dissatisfaction) has been clearly stated to them, get them to agree to a backup business ADSL line - it might be in breach of your contract with them, so make sure they agree to this as a backup solution.

 

You'll probably need to engage the big guns to push this through, so brief them appropriately before you let them trundle across the deck and crush any opposition against the poop deck.

Posted
you want to run the network internet through your phone! thats a lot of traffic for one little phone, your LEA must be awfull to even consider doing that

 

Haha, not for everyone, only me!

 

I don't want Top Gear interrupted because the ISA server's playing up!

Posted
Only way I can think of is by altering your routing tables with static routing. Making Sense of Windows Routing Tables

 

You could script that, so that you just have to run a script when you tether, and then when normal connection is up, run another one to set it back to normal.

 

Ah-ha! I've set up the command, I just need to work on how to run it when the phone is tethered.

Posted (edited)
Ah-ha! I've set up the command, I just need to work on how to run it when the phone is tethered.

 

That is an interesting question. Only way I can think of would be a service which checks WMI for network connections, which you'd then compare with the connection that you know it should be called (or the number of connections if the number of connections normally remains static).

 

On windows PowerShell,

get-wmiobject win32_networkadapter | select-object name

would return the device names, and you can run a powershell script as a service using srvany.

 

http://www.vistax64.com/powershell/37213-powershell-script-windows-service.html

http://support.microsoft.com/kb/137890

Edited by localzuk
Posted (edited)

As another option you should be able to do this realitivly easily by using VBScript and a WMI event sink. It is just a script that you would set to run on startup that will just wait in the background until you plug the phone in. It will see the phones adapter show up and then run your required commands.

 

another alternative is to use WMI. This can set up somethng called an event sink which sits there waiting for an event to happen. When it does, you carry out a particular action.

 

The attached script will do just that. run it (best to use wscript because otherwise you'll see a window on screen) and it will sit in the background waiting.

 

When a USB stick is inserted, the sink event will trigger. I wrote this for something else (question here about how to check for "bad" files on a USB stick) but it's easy to adapt. Basically, when the USB device arrives it gets given a DEVICEID; this is used to find out more info about the drive including its name (not C: etc but things like harddisk0). This is then queried using WMI to get a list of partitions (USB sticks often have more than one partition)

 

finally, the routine CheckFolder is called once for each partition - it's called with the drive letter and a backslash - eg G:\

 

In that routine you could add something like:

 

Set oShell=createobject("wscript.shell")
sCmd="robocopy " & sFolder & " c:\backup /s /e"
oShell.run sCmd,7,true

 

This will copy the contents of the partition to c:\backup - you can obviously put it where you want!

 

http://www.edugeek.net/forums/attachments/how-do-you-do/1955d1212261372-robocopy-help-usbdiskarrival2.txt

 

You will need to find the adapter name or ID of the phone and modify the script a bit ie. with the event sync set to look for new adapters as above in localcuk's post but it is quite doable.

Edited by SYNACK
  • Thanks 1
Posted
Cheers for the replies all. When I get a bit of time I'm going to automate it, but at the moment I'll make do with my batch file which turns the route on or off, depending on which argument you pass it.
Posted
Unfortunately it doesn't work. The routing table, once set up when the machine is switched on, won't replace the ISA server with the phone as the default gateway. It still needs to be scripted or changed manually.
Posted
Unfortunately it doesn't work. The routing table, once set up when the machine is switched on, won't replace the ISA server with the phone as the default gateway. It still needs to be scripted or changed manually.

 

So I take it you have the tethered network connection as the top priority?

Posted
So I take it you have the tethered network connection as the top priority?

 

Yep, I checked and it was top by default. Then it was the ethernet connection, and then the virtualbox adapter.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...