Labels

Showing posts with label IP Route. Show all posts
Showing posts with label IP Route. Show all posts

Monday, January 28, 2013

HowTo: Adding a Static Route in Windows

To view the existing routes,
    C:\> route print

To add a static route,

    Syntax:
    C:\> route add <target> mask <netmask> <gateway IP> metric <metric cost> if <interface>

    Example:
    C:\> route add 10.10.10.0 mask 255.255.255.0 192.168.1.1 metric 1

Note: If there is more than one Network Interface and if the interface is not mentioned, the interface is selected based on the gateway IP.

This Static route gets erased when the system reboots. To avoid this, use the -p (Persistent) switch to the above command:
   
    C:\> route -p add 10.10.10.0 mask 255.255.255.0 192.168.1.1 metric 1

Monday, December 17, 2012

How To add a static IP route-WindowsXP & Windows7


To add a static IP route

1. Open Command Prompt
2. At the command prompt, type:

route add destination mask subnetmask gateway metric costmetric if interface

where:

destination 
Specifies either an IP address or host name for the network or host.
subnetmask
Specifies a subnet mask to be associated with this route entry. If subnetmask is not specified, 255.255.255.255 is used.
gateway
Specifies either an IP address or host name for the gateway or router to use when forwarding.
costmetric
Assigns an integer cost metric (ranging from 1 through 9,999) to be used in calculating the fastest, most reliable, and/or least expensive routes. If costmetric is not specified, 1 is used.
interface
Specifies the interface to be used for the route that uses the interface number. If an interface is not specified, the interface to be used for the route is determined from the gateway IP address.