From the computer of: qmchenry
(338 recipes)
Created: Jun 23, 2004
To add a route to the network 192.168.1.1/24 (corresponding to a subnet mask of 255.255.255.0) through the gateway 172.16.100.1, use the following command:
This is the simplest method of adding a temporary route. The subnet mask parameter is optional and defaults to 255.255.255.255 which specifies that the target is a single IP address instead of a network.
An optional routing metric can be added to the route command for more complex situations. The metric can be considered a cost for using the route. If a routing table contains multiple routes to the same destination, the cheapest route (lowest cost or metric) will be used. To add a route with a metric of 10 to the host 192.168.15.123 through the gateway 172.16.10.1, use the following command:
In this case, the subnet mask is not given so the command defaults to the mask 255.255.255.255.
It is possible to use names instead of numbers for the gateway and subnets. If you use a name for the gateway, the name is looked up in the hosts file ({windows_home}\system32\drivers\etc\hosts) and the corresponding IP address is used. Named subnets will be looked up in the networks file ({windows_home}\system32\drivers).
If multiple network interfaces are available to route to the same destination, the interface can be specified in the route command. The interface number associated with the interface is shown using the route print command. Windows will automatically guess which interface is most appropriate for the given route. If you are dissatisfied with Windows's guess, the optional if {interface} parameter can be used. To specify that the previous route example should use interface 2 (identified with the hexadecimal value 0x2 in the route print command), use the following command:
Subscribe to the Tech-Recipes Newsletter
You can get tips like this delivered in your email every week!
We will never, ever sell your email address or spam you.
Related recipes:
NT/2000/XP: Display or view the Windows routing table
Connect to XP's Remote Desktop Connection with Windows 95,98,ME,NT, or 2000
NT/2000/XP: Free GUI IP Configuration Tool from Microsoft
Windows: Service Managing Through Command Line
Add The Stored User Names and Passwords Applet to XP's Control Panel
XP: Set or configure static network IP address wtih netsh from command line
Encrypt Files in XP Using EFS
Setup and Use a Direct Connection to Easily Transfer Data
Opening Blocked Attachments with Outlook 2003
Increase Number of Windows Open before XP Starts to Group Them
Sponsored links
Login
Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.Search
Tech Recipes
· Home
· Mac OS X
· Solaris
· Windows
· Programming
· UNIX
· Cisco
· MySQL
· Google
· Instant messaging
· Add recipes
· Leave feedback
· Recommend us
· RSS Syndication
Hot recipes
Firefox 3: Display Search Results in New Tab
XP: Small, Free Way to Use and Mount Images (ISO files) Without Burning Them
How Do I Use or Open Bin, Cue, or ISO Files?
Make XP look like Windows Vista / Longhorn for free!
MySpace Hack: View Pictures and Comments on a Private Profile
Vista: Should I Install 64-bit or 32-bit Version? (x64 vs x86)
SMS through E-Mail: Cingular, Nextel, Sprint, T-Mobile, Verizon, Virgin Mobile
Hacks to Beat Rapidshare Download Limits and Waiting Time
Who's Online
There are currently, 2044 guest(s) and 3 member(s) that are online.
You are Anonymous user. You can register for free by clicking here
Information
Wish to advertise with us?
All logos and trademarks in this site are property of their respective owner. The comments and forum posts are property of their posters, all the rest © 2003-2007 by QD Ideas, LLC.
Users of this site are legally bound by the Terms and conditions and Disclaimer. Do not use this web site if you do not agree with these policies.
The members, admins, and authors of this website respect your privacy.
Page Generation: 0.91 Seconds
Sun Jul 20 17:57:02 2008