The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Posts Tagged ‘default gateway’

Windows command-line: Finding default routes and setting their metric

Posted by jpluimers on 2014/03/23

When you have multiple network connections, sometimes you want to prefer one to be used as “default” (i.e. because it has higher speed or lower latency).

Windows already tries to accommodate for that by assigning “metrics” to your network connections. They depend on the kind of network (wired over wireless) and speed of the connection.

To see the current default network routes and their metrics, you use the route print command and filter it with findstr like this:

route print | findstr /C:"Metric" /C:" 0.0.0.0"

The “0.0.0.0” string is to filter out the default routes, and “Metric” includes the header line.

For one of my XP machines, the result is this:


Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.71.1 192.168.71.28 10
0.0.0.0 0.0.0.0 192.168.171.1 192.168.171.140 10

Now, even though both metric are 10, my 192.168.71.1 gateway is much slower than my 192.168.171.1 gateway, so I want to prefer the last one. Read the rest of this entry »

Posted in Power User, Windows, Windows 7, Windows 8, Windows Vista, Windows XP | Tagged: , , , , , | Leave a Comment »