Subscribe to How-To Geek

Adding a TCP/IP Route to the Windows Routing Table

The Routing table dictates where all packets go when they leave your system. On most environments, all packets that leave your system will be forwarded over to your router or hub, and from there out to the internet.

In some circumstances, you may have a testing network configured to duplicate another environment, or you may be configuring a more complex network topology that requires the use of additional routes. Adding routes to your machine is a useful testing tool for some of these situations.

Syntax:

route ADD xxx.xxx.xxx.xxx MASK xxx.xxx.xxx.xxx  xxx.xxx.xxx.xxx

Means:

route ADD “network” MASK “subnet mask”  “gateway ip”

For example, if you were on the 192.168.1.0 network, and you had a gateway on 192.168.1.12 configured to access the 10.10.10.0/24 network, you would use a route add statement like this:

route ADD 10.10.10.0 MASK 255.255.255.0 192.168.1.12

Your routing table should now reflect that change, and all traffic to the 10.10.10.x range will now be sent over to the gateway machine.

The route add change will only stick across reboots if you add it with the -p flag, as in the following:

route -p ADD 10.10.10.0 MASK 255.255.255.0 192.168.1.12

| More
This article was originally written on 09/13/06 Tagged with: Networking, Windows

Daily Email Updates

You can get our how-to articles in your inbox each day for free. Just enter your name and email below:


Name:
Email:

Comments (4)

  1. wan

    I’ve a few question and Need help.
    1) Where is right place to put that network route statments on suse 9
    2) How to make auto route scripts so that, i don’t need to up manually this routing on suse9.

  2. Graham Allen

    Nice intro into adding static routes.
    Do you have any other articles on TCP/IP?
    If not, I have a detailed document that explains TCP/IP and routing I would be happy to email you to post on your site. I had to create this a while ago for training in my company.

  3. Drowles

    I had to put the -p at the end in order to get the registry updated.
    All the help docs that I found show it at the beginning ?*&%??
    route ADD 10.10.10.0 MASK 255.255.255.0 192.168.1.12 -p

  4. camil7

    Thanks for the hint. Saved the day for a windows newbie :)

    By the way: removing routes (e.g. in case of typos) works as well as:

    route delete “network”

    e.g. to remove the route for 10.10.10.0 one types in

    route delete 10.10.10.0

    Ok, and “route help” even gives help, e.g. “route print” to show the routing table (actually the same output as “netstat -nr”)


Leave a Comment




Leave your friendly comment here.

If you have a computer help question, click here to leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Our Friends
Getting Started


About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
mDNSResponder.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
conhost.exe
Dpupdchk.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. All Rights Reserved.