Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Switching Between Internet Providers 1

Status
Not open for further replies.
Aug 3, 2007
2
US
In my office, we have two internet pipes. One pipe goes through ISP 1 and the second goes through ISP 2. Upper management would like to be able to switch between providers with a .bat file if possible. Anyone have any suggestions?
 
Management...[banghead] I won't ask you what they hope to accomplish.

How are you directing traffic now? One router loadsharing between the two, or are they on different gateways? If on different gateways, you may be able to write a script that changes an individual PC's default gateway. One script to change from 1 to 2, another to change from 2 to 1.
 
Read up on Dual WAN routers and show management they can switch without a .BAT file

I tried to remain child-like, all I acheived was childish.
 
You could create two .bat files named properly...

One that would delete the default route and then add a default route for the new gateway...

For example if One Gateway was 192.168.0.1 and the new gateway you were trying to acquire was 192.168.0.2... You could run the following... (You can run a route print from command prompt to confirm the mask is correct).

route delete 0.0.0.0 mask 255.255.255.0 192.168.0.1
route add 0.0.0.0 mask 255.255.255.0 192.168.0.2

Then if you wanted to switch back to original gateway just reverse the entries... as such.

route delete 0.0.0.0 mask 255.255.255.0 192.168.0.2
route add 0.0.0.0 mask 255.255.255.0 192.168.0.1

Hope this helps.

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top