dual nic access to 2 networks

How does an application decide which nic to go out when going to an external IP or network?

I have a home router going to internet with

I also have a home lab with 3 routers connected together and routing between them.  The ethernet networks on these 3 routers are:

Then I have an Windows XP home box w/ 2 nics.
Nic 1 is connected to default gateway is (router connected to and
Nic 2 is connected to default gateway is router connected to internet.

If I try and ping it fails.
If I disable Nic 2, then ping it works.

Why does it try to go out Nic 2?  How do I configure it to go out Nic 1 for and and go out Nic 2 for everything else?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi Gfarnham,

This is the routing table of windows XP deciding on which network to push packets throug. You can see your routing table via the command

route print
netstat -rn

on the command prompt.

Ok, as you may see from your output the list has 2 directly connected networks and and a DEFAULT route noted as

So you can reach two KNOWN networks and all packets for other directions are routed through the default network which is directing your Internet network.

Windows unable to get information about other networks unless you use a "routing protocol" (like RIP, OSPF) or enter them manually. The first is not a simple task on XP environment (needs extra software) and second is the way you shold follow.

Back to command prompt, type the commands:

route add mask
route add mask

Do a route print do confirm your setup

So you simply instruct your network stack to forward packets for and VIA

Thats it.

You may add the two lines in a start up script to avoid doing it every time.

Hope this helps.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
the only thing I might add to the good advoce above, is  you can use the -p switch to make the route persistent (to avoid the startup script or batch file)
OK, I lied LOL some more info on multi homed machines


When two network adapters are present in a computer (multihomed), a default gateway should only be assigned

to one of the network adapter's TCP/IP properties. If one of the network adapters is used to connect

to the Internet, the default gateway should be assigned to that network adapter. In many cases, the

default gateway, as well as the other necessary TCP/IP information is assigned automatically by the

Internet Service Provider by using Dynamic Host Configuration Protocol (DHCP). This can be confirmed

by using the IP Configuration utility (Winipcfg.exe) to view the TCP/IP properties for the network adapter

you are using to connect to the Internet.

For the network adapter that is connected only to the Local Area Network (LAN), such as a home or corporate

network, a static routing entry must be entered into the computer's routing table if the computer needs

to obtain access to network resources across a router or multiple routers. For example, if the router

interface on the same subnet has an IP address of and the router is connecting the

network to a network, the following command would need to be entered either at a command

prompt within Windows or from a batch file:


This command instructs Windows to send all traffic that is destined for the network to the interface on the router. To verify that the ROUTE ADD command was successful, use the ROUTE

PRINT command to view the current routing table. If multiple routers are being used on the LAN segment,

a separate ROUTE ADD is needed for each router.

Note that the routing entry is not persistent in Windows 98/95, even with the -p switch, and is lost

after you restart the computer. To have this entry automatically added for every Windows session, create

a batch file with the necessary ROUTE ADD command(s) and place it in the Windows StartUp folder to be

executed each time Windows starts.

If DHCP is used to assign IP addresses on the LAN, the DHCP server should be configured to not provide

a default gateway.

gfarnhamAuthor Commented:
Thank caqri, great answer.
stevenlewis, I used -p since I'm on XP probably is ok, your 2nd message says not supported in 98/95.
It means the -p (persitent) switch is not supported in 9x, but the route add command is :-)
so you have to use a batch file on 9x and put it in the startup folder, and then it will run and add the routes on startup
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows XP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.