Jump to content

Help with Gateway switch script


Recommended Posts

Hi all,

I'm hoping someone wiser that me can shred some light on this problem.

We have 2 internet connection into the office, I want to write a default gateway switcher script.

For day-to-day stuff we have a very high speed but capped DSL line.

For downloading large files and less important stuff, we have a slower speed unlimited line.

I'm trying to write a script that goes like:


if ([find_current_gateway] == 192.168.0.100) then
REM change to slower DSL
route change 0.0.0.0 mask 0.0.0.0 192.168.0.200
echo Gateway is now [find_current_gateway]
else
if ([find_current_gateway] == 192.168.0.200) then
REM change to faster DSL
route change 0.0.0.0 mask 0.0.0.0 192.168.0.100
echo Gateway is now [find_current_gateway]
endif
endif

Does anyone know the DOS command (or group of commands) to return just the default gateway [find_current_gateway]?

'netstat -nr' returns far too much information

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy