Re: Modifying default routes. Use route.exe?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Thu, 17 Jan 2008 10:16:38 +0000, James Egan <jegan@xxxxxxxxx>
wrote:
Hello,

Does anyone know if it's possible to modify the metrics on two default
gateways from a command line or something that can be executed
automatically without requiring a user to make advanced manual
alterations to the tcp/ip network settings?

Currently on startup (having set the metrics manually), the routing
table looks like this where the second default gateway is only used if
the first one is dead. This works okay.

===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface
Metric
0.0.0.0 0.0.0.0 192.168.7.1 192.168.7.50 1
0.0.0.0 0.0.0.0 192.168.7.2 192.168.7.50 20
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.7.0 255.255.255.0 192.168.7.50 192.168.7.50 25
192.168.7.50 255.255.255.255 127.0.0.1 127.0.0.1 25
192.168.7.255 255.255.255.255 192.168.7.50 192.168.7.50 25
224.0.0.0 240.0.0.0 192.168.7.50 192.168.7.50 25
255.255.255.255 255.255.255.255 192.168.7.50 192.168.7.50 1
Default Gateway: 192.168.7.1
===========================================================================
Persistent Routes:
None

I would like to occasionally switch the metrics around on these
gateways so that 192.168.7.2 is used first but I don't know how to do
it automatically.

Whatever I do with the route command, I always end up with a single
default gateway.

Perhaps there is something other than route.exe I can use?


Jim.

Delete the default routes, then create routes with the desired
metrics. Here are two ways to do it:

route delete 0.0.0.0 mask 0.0.0.0
route add 0.0.0.0 mask 0.0.0.0 192.168.7.1 metric 1
route add 0.0.0.0 mask 0.0.0.0 192.168.7.2 metric 20

or:

route change 0.0.0.0 mask 0.0.0.0 192.168.7.1 metric 1
route add 0.0.0.0 mask 0.0.0.0 192.168.7.2 metric 20
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com
.



Relevant Pages

  • Re: How to limit a computer to specific website surfing
    ... lecter wrote: ... On the command line. ... Then you must flush out all "default routes" (removes default gateway) ...
    (comp.security.misc)
  • Modifying default routes. Use route.exe?
    ... Does anyone know if it's possible to modify the metrics on two default ... Default Gateway: 192.168.7.1 ... Persistent Routes: ... Whatever I do with the route command, I always end up with a single ...
    (microsoft.public.windowsxp.network_web)
  • Re: Routing problems
    ... default gateway, not an interface). ... accessible from the Internet. ... routes programmed into it, making it essentially a usable default gateway ... not even touching the Linux firewall. ...
    (comp.os.linux.networking)
  • Setting up a multihomed server.
    ... I'm adding a second NIC to my home Win2003 Server so I can create a separate subnet in order to help me with preparation for 70-291. ... At the moment the machine doesn't seem to realise that is needs to act as a default gateway for the second subnet, rather than just having a second NIC with an assigned IP. ... Would I do this through adding static routes, or is there something else obvious that I've missed? ...
    (microsoft.public.cert.exam.mcsa)
  • Re: Cant ping my PC from the internet
    ... The TCP/IP stack of the 100Mb/sec card should Not be bound to File Sharing. ... The Giga card should be configured as part of the LAN, ... Gateway metric: 100 ... My last change was to put the gateway and interface metrics on the GigE port to 100 to ensure any remote traffic was going through that interface, and to keep my local LAN traffic on the GigE interface. ...
    (microsoft.public.windowsxp.network_web)